10/29/2021
Hello,
as an alternative, just in case I can't create in real time the array of structure or it's too complex, do you have an example where you have an array of structure written in the XML file from which the uanodes file is generated?
The structure can be something like:
<opc:DataType SymbolicName="SingleEvent" BaseType="ua:Structure">
<opc:Description>Generic event in the array</opc:Description>
<opc:Fields>
<opc:Field Name="Component" DataType="ua:String"/>
<opc:Field Name="TimeStamp" DataType="ua:DateTime"/>
</opc:Fields>
</opc:DataType>
For example if I want an array AllEvents made by 5 structure "SingleEvent", what should I add to the XML file above to have such array of SingleEvent?
Thanks,
Cristian
05/30/2017
The DataType is the same for arrays.
The ValueRank specifies whether an Array value is returned.
You likely need to declare:
BaseDataVariableState<OPCUAServer.SingleEvent[]> EventN
and ensure the ValueRank = 1.
The SDK infrastructure should handle returning an array of structures.
10/29/2021
If it's not a problem, in case i'm not able to modify the code quickly, can you provide me an example of array of structure using the XML from which the uanodes file is created?
The code in the XML file at the moment is this:
<opc:DataType SymbolicName="SingleEvent" BaseType="ua:Structure">
<opc:Description>Generic event in the array</opc:Description>
<opc:Fields>
<opc:Field Name="Component" DataType="ua:String"/>
<opc:Field Name="TimeStamp" DataType="ua:DateTime"/>
</opc:Fields>
</opc:DataType>
How to create a DataType in the XML file which is an array of single event?
Cristian
1 Guest(s)