12/13/2020
I like to check with you if this is possible :
- Currently i successfully implemented opcua pubsub of a set of variables to a mqtt broker. I can inspect the data on the broker as it is encoded using json.
- Now I want to do the reverse:
2a. A new opcua client will publish a request to invoke opcua methodcalls via mqtt.
2b. The opcua server will listen (subscribed) for this request; when it receives the subscribed request it will invoke the corresponding methodcalls and return the result back to the broker by publishing to it;
Based on the sample codes in open62541.org that implements opcua-mqtt subscriber, it seemed to me that the architecture supported by opcua-mqtt pubsub is as follows:
opcserver1 (publisher) —> mqtt —> opcserver2 (subscriber) <- opcclient
All data published to the mqtt has to be populated into opcserver2 as nodes.
for methodcalls involved by opcclient, it will read off from opcserver2 without going to opcserver1. Reason is opcserver1 would have published all the metadata and sent to opcserver2.
Please confirm if my understanding is correct.
- The opcua client in turns subscribe to this results
05/30/2017
The mapping to variables in the OPC UA server is an optional feature.
A server could do anything it wants with the message including reporting an event containing the dataset.
You could implement a method call with by subscribing to the variables but you could never really when the method is "called" since you could receive updates at slightly different times for each variable or never get an update at all if the current parameters are the same as the previous parameters.
The only reliable to way to implement this is with an event rather than variables.
The same problem exists for returning the response. Writing to multiple variables cannot guarantee that the values will be sent in the same message. You would need a method on opcserver2 to guarantee that the response is sent correctly.
12/13/2020
Hi Randy
do you mean this:
1. App1 (as a opcua client) makes a methodcall@opcuaserver1 eg shutdown(machine 1)
2. Method@opcuaserver1 generates an event and sends it across the wire via mqtt.
3. Opcclient2 (at the same location of opcuaserver1) subscribes for this event.
4. Opcclient2 processes the event (eg calling a sensor api => machine1::shutdown)
05/30/2017
Yes that model works with the disconnected nature of MQTT.
A PubSub DataSet could have the semantics of a "method call".
All subscribers would decide if it applies to them.
Those that do react send another PubSub DataSet with the semantics of a "method call result".
All subscribers to "method call result" which get the results.
The WG is developing an extension to PubSub that formalizes methods over pubsub.
12/13/2020
Hi Randy,
I want to implement the Events subscriptions of OPCUA based on your suggestion above.
Currently in open62541 ccmake options, i configureUA_NAMESPACE = Minimal, UA_FILE_NS01 = OFF. My OPCUA Server code runs normally.
However, when i configure ccmake options as UA_NAMESPACE = FULL, UA_FILE_NS01 = ON, the same program caused segmentation fault when trying to execute the following statement:
UA_UInt16 namespaceIndex=1;
UA_Server_addVariableNode(uaServer, UA_NODEID_NUMERIC(namespaceIndex, 10001),
r1_airgardroot_Id,
UA_NODEID_NUMERIC(0, UA_NS0ID_HASPROPERTY),
UA_QUALIFIEDNAME(namespaceIndex, "Software Version"),
UA_NODEID_NUMERIC(0, UA_NS0ID_BASEDATAVARIABLETYPE),
vSoftwareVersionAttr, NULL, NULL);
I already perform the following:
a. git submodule_update --init --recursive
b. export open62541_NODESET_DIR = "/home/pi/open62541/deps/ua_nodeset/Schema"
So far, compiling and running under UA_NAMESPACE = MINIMAL has no issues. But when i want to implement Events subscriptions, open62541 insists that I use UA_NAMESPACE=FULL.
Can i know what is the difference between UA_NAMESPACE = Minimal and UA_NAMESPACE = FULL?
What additional configuration i need to do when UA_NAMESPACE = FULL?
Thanks.
Jacky
1 Guest(s)