Get Method Arguments with an OPC UA Client - Best Practices|OPC UA Implementation: Stacks, Tools, and Samples|Forum|OPC Foundation

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
Get Method Arguments with an OPC UA Client - Best Practices
Avatar
Gerhard Helfrich
Member
Members
Forum Posts: 4
Member Since:
04/04/2017
sp_UserOfflineSmall Offline
1
06/07/2018 - 01:42
sp_Permalink sp_Print

Hello together,

I am building an OPC UA Client based on Open62541 and I a want to retrieve the method arguments of an OPC UA server.
My starting point is the NodeId of the Method. Getting the NodeId of the Method is easy because I use the nodeClass to identify if the Node is a Method. The nodeClass is part of the ReferenceDescription, which is returned when calling the Browse Service.

The next thing I would do is call Browse using the NodeId of the Method as starting point. This will return various ReferenceDescriptions like the InputArguments/OutputArguments but also References like HasModellingRule. I could imagine that various References are possible.

My Quesiton is: which filter is the best practice to apply on the ReferenceDescription to find out if it is a InputArguments/OutputArguments Variable/PropertyType?

What I do by now (which is far from optimal) is checking if the NodeId of the ReferenceDescription is part of namespace 0 (to sort out the referencres, which are usually namespace 0). Then I retrieve the Node using the NodeId and check if the type of the value of this Node has the DataType Argument. However, there are some methods that are part namespace 0 e.g., CreateFile from FolderDirectoryType. Using my rush job filter I sort them out. Therefore, I need better filtering to sort out the non-relevant Referecnes like HasModellingRule, etc. and keep the methods arguments of namespace 0.

Avatar
Gerhard Helfrich
Member
Members
Forum Posts: 4
Member Since:
04/04/2017
sp_UserOfflineSmall Offline
2
06/07/2018 - 03:01
sp_Permalink sp_Print

I changed my Filtering to the following.

 

First, I check the NodeClass of the ReferenceDescriptions that are returned when calling Browse with the MethoId as starting point.

If it is Variable I retrieve the browseName and compare it if it equals to either InputArguments or OutputArguments. If so I retrieve the Value and check if the Value's Type (DataType) equals to Argument. I hope that I do not miss any Arguments by using this procedure.

Forum Timezone: America/Phoenix
Most Users Ever Online: 510
Currently Online:
Guest(s) 6
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Forum Stats:
Groups: 2
Forums: 10
Topics: 1347
Posts: 4567