Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » 4DIAC - Framework for Distributed Industrial Automation and Control » OPCUA_Handler getNodeForPath fail with my custom opcua server(relativePath includeSubtypes)
OPCUA_Handler getNodeForPath fail with my custom opcua server [message #1778360] Wed, 13 December 2017 13:05 Go to next message
Yannick THiessoz is currently offline Yannick THiessozFriend
Messages: 7
Registered: November 2017
Junior Member
He,
I try to access opcua objects on my own opcua server. Unfortunately it does not work for my structures composed of several folders.

After many research I finally find the reason.
I have a structures composed of several folders.
When forte create the TranslateBrowsePathsToNodeIdsRequest it correctly adds the related items. It correctly define the option is inverse by the code
browsePaths[i].relativePath.elements[j].isInverse = UA_FALSE;

However, he does not deal with the includeSubtypes option. This means that by default this option is set to false. If I change this option to true with this code
browsePaths[i].relativePath.elements[j].includeSubtypes= UA_TRUE;
, 4diac works with my server!

Is there a reason why this option is not set by default to TRUE ?

If I look in the literature I found rather examples where it is recommended to put this option to true :
http://documentation.unified-automation.com/uasdkcpp/1.5.3/html/classUaClientSdk_1_1BrowseContext.html#a8d84facb3917ecb3f46c15f9cc4433eb
https://books.google.ch/books?id=de9uLdXKj1IC&pg=PA140&lpg=PA140&dq=opc+ua+includeSubtypes&source=bl&ots=EGLDfTogsh&sig=UiRr333-ny8XmfvUtqSxhN6N3vA&hl=fr&sa=X&ved=0ahUKEwjF1Pza_IbYAhXD_KQKHVzAACEQ6AEIRDAE#v=onepage&q=opc%20ua%20includeSubtypes&f=false

Best Regars
Yannick
Re: OPCUA_Handler getNodeForPath fail with my custom opcua server [message #1778494 is a reply to message #1778360] Fri, 15 December 2017 00:00 Go to previous messageGo to next message
Kirill Dorofeev is currently offline Kirill DorofeevFriend
Messages: 26
Registered: February 2016
Junior Member
Hi Yannick,

thanks for a hint!
In the OPC-UA Spec there is no default value specified for RelativePath.element[].includeSubtypes, so it depends on the implementation. This component is not set in the forte code, it's coming from the open62541 stack, where RelativePathElement is by default created with both components includeSubtypes and isInverse set to false (so this line
browsePaths[i].relativePath.elements[j].isInverse = UA_FALSE;
has actually no effect).

Best regards,
Kirill
Re: OPCUA_Handler getNodeForPath fail with my custom opcua server [message #1778613 is a reply to message #1778494] Mon, 18 December 2017 18:05 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 454
Registered: January 2014
Senior Member
Maybe this is also something to be discussed with the open62541 developers?
Re: OPCUA_Handler getNodeForPath fail with my custom opcua server [message #1778695 is a reply to message #1778613] Wed, 20 December 2017 08:55 Go to previous messageGo to next message
Yannick THiessoz is currently offline Yannick THiessozFriend
Messages: 7
Registered: November 2017
Junior Member
Hello,
Thanks a lot for your answers !
Indeed, the following line is useless. Although it is reversed in the 2nd part of the construction of the query and there it is therefore important for the code comprehension.
browsePaths[i].relativePath.elements[j].isInverse = UA_FALSE;

The line that interests me is rather that one.
browsePaths[i].relativePath.elements[j].includeSubtypes= UA_TRUE;

As Kirill says, in the specification there is no default value specified and it really depends on the implementation. I'm not really sure I understand correctly the includeSubtypes parameter. But since changing this parameter to TRUE in the code change the behavior, I guess that is well implemented by open62541 developers. For your information, our server is based on the source code of OPC Foundation. Because I did not see any negative impact on your implementation (in the example Client / server OPC_UA) if I change its parameter. So I guess it would be interesting to add this line to the source code of forte in order to avoid problems with servers based on the source code of OPC foundation. What do you think ?
For me it does not really impact because I can add this line for my tests in my prototyping environnement. If eventually our prototype had to evolve (towards an integration of 4diac for our solutions) we would probably think to implement in forte a new protocols for direct access to our data server without going through the OPC_UA layer.
Best Regards
Yannick
Re: OPCUA_Handler getNodeForPath fail with my custom opcua server [message #1778717 is a reply to message #1778695] Wed, 20 December 2017 12:24 Go to previous messageGo to next message
Kirill Dorofeev is currently offline Kirill DorofeevFriend
Messages: 26
Registered: February 2016
Junior Member
Yannick THiessoz wrote on Wed, 20 December 2017 09:55
I'm not really sure I understand correctly the includeSubtypes parameter.

includeSubtypes indicates whether subtypes of the ReferenceType should be followed. Subtypes are included if this value is TRUE.
Therefore, I guess, in your server there are some references, which are Subtypes of HasComponent that should be followed to find the RelativePath.
Alois Zoitl wrote on Mon, 18 December 2017 19:05
Maybe this is also something to be discussed with the open62541 developers?

Yep, Stefan might comment on that as soon as he's back.
Re: OPCUA_Handler getNodeForPath fail with my custom opcua server [message #1779907 is a reply to message #1778717] Mon, 15 January 2018 16:48 Go to previous messageGo to next message
Stefan Profanter is currently offline Stefan ProfanterFriend
Messages: 11
Registered: July 2017
Junior Member
Yannick, thanks for the question!

As Kirill already mentioned, includeSubtypes=true has the effect that the browse path is also resolved, if the reference type from one node to another is a subtype of the given reference type.
I just checked our FORTE code, and interestingly the referenceTypeId field is not set, so it is always 0. Maybe that's the problem and open62541 handles 0 reference type in a different way.

I'm not sure if I understood your usecase. Can you post your forte application/screenshot on what you are trying to achieve? It would be interesting to see if the bug is in open62541 or OPC Foundation's code.

Or can you try to set the referenceTypeId to HierarchicalReferences and then set includeSubtypes=true

I have to debug that further to see how and why a 0 reference type works in open62541 (and if it is really 0, or some other value)

BR
Stefan
Re: OPCUA_Handler getNodeForPath fail with my custom opcua server [message #1780081 is a reply to message #1779907] Wed, 17 January 2018 08:53 Go to previous messageGo to next message
Stefan Profanter is currently offline Stefan ProfanterFriend
Messages: 11
Registered: July 2017
Junior Member
Yannick, I just checked the implementation of the translateBrowsePathToNodeIds:

In FORTE we are not setting the value of
browsePaths[i].relativePath.elements[j].referenceTypeId


According to the OPC UA Spec Part 4, 7.26 RelativePath this means:

Quote:

referenceTypeId:
The type of reference to follow from the current node.
The current path cannot be followed any further if the referenceTypeId is not available on the Node instance.
If not specified then all References are included and the parameter includeSubtypes is ignored.


Therefore it shouldn't matter what we set for includeSubtypes since its value should be ignored. So everything is fine in FORTE.

This means that that's probably a bug in the OPC UA server you are using?

BR
Stefan
Re: OPCUA_Handler getNodeForPath fail with my custom opcua server [message #1780119 is a reply to message #1780081] Wed, 17 January 2018 14:31 Go to previous message
Yannick THiessoz is currently offline Yannick THiessozFriend
Messages: 7
Registered: November 2017
Junior Member
Hi
First of all thank you for yours answers.
I am unfortunately not the developer of our server OPC_UA and my knowledge is limited.
I will look directly with the developer if he has an idea.
On the other hand, what I can tell you is that if I recompile forte by adding this line, The problem is corrected.
browsePaths[i].relativePath.elements[j].includeSubtypes= UA_TRUE;

Best regards
Yannick
Previous Topic:problems in using client and server
Next Topic:Problem with FBRT
Goto Forum:
  


Current Time: Tue Feb 20 21:30:26 GMT 2018

Powered by FUDForum. Page generated in 0.01677 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software