Invoke opcua methodcalls from a client using mqtt | OPC UA Standard | Forum

Avatar
Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
Lost password?
sp_Feed sp_PrintTopic sp_TopicIcon
Invoke opcua methodcalls from a client using mqtt
Avatar
Jacky Bek
New Member
Members
Forum Posts: 1
Member Since:
12/13/2020
sp_UserOfflineSmall Offline
1
01/07/2021 - 18:28
sp_Permalink sp_Print sp_EditHistory

I like to check with you if this is possible :

  1. 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.
  2. 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.

 

  1. The opcua client in turns subscribe to this results
Avatar
Randy Armstrong
Admin
Forum Posts: 532
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
2
01/08/2021 - 20:52
sp_Permalink sp_Print

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.

Forum Timezone: America/Phoenix
Most Users Ever Online: 202
Currently Online: Mircea-Stefan Radu
Guest(s) 25
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Forum Stats:
Groups: 2
Forums: 9
Topics: 796
Posts: 2359