Teilen Sie Ihre Erfahrunge und Wünsche mit uns und anderen Usern!
Subscription fields are mostly null
Dear game4automation team,
so far the OPCUA4Unity asset works very smooth. Great work!
In my project I tried to update my data like you show in the DemoTextWithDelegate example. But the subscription object returned in OPCUA_Interface :
sub = connection.SubscribeNodeDataChange(nodeid,del);
is pretty much empty:
I used UAExpert to test the subscription with the same node id, which worked. As far as I can tell I do not get any warnings or errors. Here is my code how I subscribe:
private OPCUANodeSubscription _safetyLevelSubscription; //subscription is a class member [...] _safetyLevelSubscription = _interface.Subscribe(node.NodeId, SafetyLevelNodeChanged); //this is the call [...] public void SafetyLevelNodeChanged(OPCUANodeSubscription sub, object obj) //this is the delegate signature
Now, I noticed that the OPCUAInterface gameobject holds pretty much all the nodes of the top node as childs and keeps them up to date. At least in the editor. Wouldn't it be best practice then to always access those child OPCUA_Nodes instead of adding an additional subscription?
Thanks for your thoughts!
JG
EDIT:
Maybe I should add, that the delegate is not called when the value on the OPC UA server changes. I assume it is due to the null ptr in the subscription. Also, I use a codesys opc ua stack.
Thanks for the positive feedback. Please give us a review in the Asset Store if you like it.
You have both options. Subscribe in code or use the imported child nodes for accessing the values.
Usually the subscription gets null if the server is not reachable. Some servers are also limiting the number of subscriptions - maybe this is the case on your server. Do you see anything in the console log?
Exception in OPCUAConnection.Connect on Android
Hi all!
I am using the OPCUA4Unity asset in my project. When I run it on android devices an exception is thrown in game4automation.OPCUAConnection.Connect(). Here is the full output:
The type initializer for 'Opc.UaFx.Client.OpcClient' threw an exception. at game4automation.OPCUAConnection.Connect () [0x00000] in <00000000000000000000000000000000>:0 at game4automation.OPCUA_Interface.Connect () [0x00000] in <00000000000000000000000000000000>:0 UnityEngine.Logger:Log(LogType, Object) game4automation.OPCUA_Interface:Connect()
I am able to run it in Unity Editor aswell as Win Standalone App. I am also able to connect with another OPC UA client from the same android device to the server.Is Android not supported?
Please let me know if you need additional infos!
JG
Hi, we tested it also with android and it shoudl workl.
Are you compiling with ILCPP and are you having .Net20 compatibility turned on. Are you allowing Internet Access for your Android Device?
Thomas
It is licensed on a purchase per set basis. Updates are included through the Unity Asset Store. We never tested it, but I am pretty shure that WebGL will not work. We are no planning extra effort to support WebGL.
help for reading values from opcua server
I bought the OPCUA4UNITY asset recently, then I set up a simple opcua server with python-opcua (code is here). It’s able to connect the server, import the nodes, but there is no data showing in the inspector when I click the “Update Node” button.
I tried to debug in VS. It seems the "Value" property of opcNode is missing.
Then I used OPC watch, the value can be read.
I also tried other opcua servers, like UA-.NETStandard has the same problem and another problem is it cannot import all the nodes in unity.
For “OPC UA C++ Demo Server V1.7.0” server, value can be read correctly, but it cannot import all the nodes in unity.
I have struggled several days, please help me, thanks a lot!
I have found the problem. It will be included in the next release. I will send you a patch via mail!
Display NodeID value as text in Unity
Hello. I have since bought your OPCUA4Unity, and followed your tutorials in the YouTube video. I wish to refer to your Text with Delegate text. I tried doing the same thing but i am unable to output anything to my game. I am able to type in the "Text From OPCUA Node" and it comes out in the game. May I know how did you connect the script to the string that you wanted for display?
In my case, I wish to reference it to the "Value". I have tested running your OPCUA_Node and Interface and they work well (sweet!) but as we know it does not show up in the game scene. So I hope you may advise me on what are the steps needed. Thank you!
Hi,
a few questions from my side to understand the problem.
Did you checked the NodeID you want to display the text from with an OPC UA Browser (you can find several in the internet).
Is the text displaying if you use an OPCUA_Node Script - the text should be sown under value?
If both things can be answered yes the communication is correct and it is just a programming issue on your side.
What I am wondering about is, that your NodeID is called "Counter1". It seems more that it is not of type string. Maype you missed to convert the integer to a string?
Best regards
Thomas
Questions Regarding Compatibility Between Versions
Hi there,
I am a student who wants to use your product for my project to connect my Android Augmented Reality app made from Unity to read the values from a Siemens PLC in real time. In short, I wish to be able to have something like this in my app from your photos.
I am slightly confused as the PLC I want to connect to is covered in the starter pack. However, I am more familiar with using OPC UA client to connect to the servers. As this is a proof of concept for education, I may not have the capital for the OPCUA4unity. Would the Game4Automation Starter be able to achieve my objective? If not, would there be a educational license for the OPCUA4Unity?
I hope to hear from you soon. Thank you!
Allen
Yes sure this is possible. The ip adress is just a property and you can start the connect at any time by script if you want. You will need to build a GUI based on Unitys UI system to let the user put in the IP adresse and then you can start the connection via script.
Hallo, OPC UA müsste eine Möglichkeit sein. Bosch Rexroth bietet diese Schnittstelle sicher an. Grundsätzlich kann man auch alles selbst ergänzen, wenn Bosch Rexroth eine .Net API anbietet. Unsere Schnittstellen sind Sourcecodeoffen, beispielsweise die zur S7, man kann diese als Vorlage nehmen. Gerne können wir auch unterstützen bei der Entwicklung einer Bosch-Rexroth Schnittstelle. Sie im Standard anzubieten ist aktuell noch nicht geplant da der Bedarf (noch) nicht groß genug ist. Gruß
Thomas
Zu unterscheiden ist auch die Editor Version und die Build Version. Man kann z.B. von dem Editor auf viele Zielplattformen compilieren (PC, MAX, Linux, IOS, Androis usw). D.h. mit dem compilierten "Digitalen Zwilling" geht Linux auf jeden Fall. Ob der Editor auch mit Linux in der notwendigen Version geht (siehe oben) wäre zu testen. Im Prinzip müsste es aber gehen.
Ich selbst hier kann leider aktuell nicht das aktuelle Game4Automation auf Linux testen - ein Feedback, ob es geht, wäre sehr interessant.
What is the difference to other tools?
Hi,
there are other tools on the market like NX Mechatronics Concept Designer or Industral Physics - what are the differences to these tools?
Hi Jeff,
I know NX MCD very well (for example, we did a Simit coupling for the first time before Siemens did it themselves, and we also implemented and sold NX MCD to several customers as a Siemens partner). Nowadays we are completely out of the Siemens business and I don't know the latest developments of NX MCD, but I'll try to give you my opinion about the differences.
This is comparable to NX MCD:
- Import CAD data (via Step or other formats with PIXYZ).
- Define kinematics, kinematic groups, ....
- Define drives (in G4A there are more detailed drive behaviors and you could implement your own with C#, then you wouldn't need Simit).
- Connect the drives and sensors with Simit or PLCSim-Advanced or OPCUA or TwinCAT....
- You have the choice to use Simit or to model the behavior of the sensors and drives in Unity
- Define movements, gears, CAMS
- Moving goods based on forces, transport surfaces and gravity.
What does not work with G4A:
- Measure forces (because of PhysX limitations).
- Moving drives with forces (which mostly doesn't make sense because we need to guarantee the position of kinematic chains, which doesn't work stably based on physics due to a certain spring behavior of the solver) - in G4A we can guarantee the final positions
- Use as CAD system (design is always imported via Step or PIXYZ).
What works in G4A and not in NX MCD
- Distribute your Digital Twin as a fully functional executable to anyone in the world without paying license fees to anyone.
- Distribute it across WebGL, Android, IOS, Linux (one Digital Twin, multiple distribution platforms).
- Create your own UI functions, buttons.
- Use all available Unity features, asset store solutions ....
- Integrate any type of VR, AR with any type of user interaction.
- Render in real-time high quality with live shadows, reflections, real materials....
- Move more than 800 things on transport surfaces (in my time, MCD lost performance very quickly)
- Open source code, documented and freely available C# API.
Best regards
Thomas
Customer support service by UserEcho