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!
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.
Customer support service by UserEcho