Writing custom structured datatype

Questions regarding the use of the .NET SDK 2.0 for Server or Client development or integration into customer products ...

Moderator: uasdknet

Post Reply
opcstudent
Full Member
Full Member
Posts: 6
Joined: 16 Dec 2015, 15:41

Writing custom structured datatype

Post by opcstudent »

Hi,

in my server, there is a custom strutured data type to keep two info, for example, 'initial_datetime' and 'finish_datetime'. Moreover, one object has a variable which is an array of this kind of strutured data type.

So, I would to increment this array when call a writing service.
1- how can i create and write a single custom structured datatype?
2- is there a way to increment arrays during a writing call?

best regards

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

Re: Writing custom structured datatype

Post by Support Team »

If you have knowledge about the custom structured DataTypes, you should create code. We recommend to generate code with UaModeler.

If you do not have knowledge about the structured DataTypes, you can use the DataTypeManager class. There is an example for reading a value of a structured DataType ([ulr=http://documentation.unified-automation ... ple28.html]Read Structure[/url]. You can extend this example to support writing.

From OPC UA point of view, you can change the size of an array when writing a value. You can read the ArrayDimension attribute of a Variable to the maximum size of the array. But you have to keep in mind that many servers fill the ArraysDimensions attribute.
So it is a implemenation detail of the server if changing the array sizes of a Variable value is allowed.
Best regards
Unified Automation Support Team

Post Reply