04/04/2017
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.
04/04/2017
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.
1 Guest(s)