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
Writing custom structured datatype
Moderator: uasdknet
- Support Team
- Hero Member
- Posts: 3072
- Joined: 18 Mar 2011, 15:09
Re: Writing custom structured datatype
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.
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
Unified Automation Support Team