How to get/set a base variable inside a 2. level folder?

Questions regarding the use of UaModeler

Moderator: uamodeler

Post Reply
MartinMajewski
Full Member
Full Member
Posts: 7
Joined: 24 Jun 2021, 17:13

How to get/set a base variable inside a 2. level folder?

Post by MartinMajewski »

Hi there,

I’m using the current C++ Server SDK and I generate my code via UaModeler!

I also know how to access variables, enums, structs, etc. in a 1. level folder inside a custom ObjectType: there are getFolderOne_VariableA() methods available (and set counterparts).

I can also get a pointer to a 2. level folder a la getFolderOne_FolderTwo.

But this is a general FolderType pointer without any semantics on the enclosing children.

So my question: What is the most elegant and easiest way to get e.g. VariableA from a FolderTwo that is inside FolderA that in turn is inside ObjectA?

A practical advice would be very appreciated!

Best wishes,
Martin

User avatar
Support Team
Hero Member
Hero Member
Posts: 3064
Joined: 18 Mar 2011, 15:09

Re: How to get/set a base variable inside a 2. level folder?

Post by Support Team »

Hello,

the code generation of C++ has currently an issue with more then two levels without additional type information - we are working on that issue.
You might want to check if your type is even exposed correctly in that case (browse the Server under Types->ObjectTypes etc., for example with UaExpert).
I assume the nodes are not there as well. If the nodes are there, you can in general use the internal client to browse to the nodes:
http://documentation.unified-automation.com/uasdkcpp/1.7.4/html/L2ServerSdkInternalClient.html

In case the type is already not complete in the generated code you have the following work-arounds:
- Use the XML import and create instances "by hand"
- Change your model so that the stuff under the second level is based on type definition (e.g. a subtype of FolderType).
Best regards
Unified Automation Support Team

Post Reply