Add Optionally Modelled Properties Programatically

Questions regarding the use of UaModeler

Moderator: uamodeler

Post Reply
acidiclustre
Full Member
Full Member
Posts: 9
Joined: 09 Jun 2015, 21:16

Add Optionally Modelled Properties Programatically

Post by acidiclustre »

Hi,

I am trying to create a simple DI Information Model and I am adding my instances of 'DeviceType' programatically. Now, the DI DeviceType has some Optional Properties. How can I make sure that when I create an Instance for this type some or all of the Optional properties are also created? As far as I could observe the CreateObjectSettings getter setters, I couldn't find any flag or something which would help me achieve what I am trying to (I am trying to create the instance as shown in the docmentation under 'HowTo and Short Tutorial' -> 'HowTo for .Net Server' -> 'HowTo: Create a Server supporting...' -> 'Step7: Create an Object Instance' ).
I understand that I have to somehow make use of the autogenerated DeviceModel Class in the DIClasses.cs file (which is generated by UAModeler), but is there a tutorial on how I could be able to do that?

Thanks,
Sup

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

Re: Add Optionally Modelled Properties Programatically

Post by Support Team »

Hello,

There is no tutorial. If you want to create optional children, you need to specify the OptionalBrowsePaths in the CreateObjectSettings. You can get the strings for setting this property with AbsoluteName.ToString.
Please see
[*] OptionalBrowsePaths
[*]AbsoluteName.ToString
Best regards
Unified Automation Support Team

Post Reply