Skip to content

Writing arrays of generic structs #2265

Answered by SachaSaxer
SachaSaxer asked this question in Q&A
Discussion options

You must be logged in to vote

Finally found a way. I'm reading the structure information of the first element and use this to tell the OPC UA server how to interpret the data I send.

`var innerNode = GetNodeId(path+"[0]");
Dictionary<uint, DataValue> nodeAttributes = ReadNodeAttributes(nodeId.ToString());
DataTypeNode dataTypeNode = (DataTypeNode)ReadNode(nodeAttributes[Attributes.DataType].ToString());

                    //Get the structure definition
                    StructureDefinition structureDefinition = (StructureDefinition)dataTypeNode.DataTypeDefinition.Body;

                    ExtensionObject[] values = new ExtensionObject[customTable.Count];
                    int i = 0;
                    foreach (…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@SachaSaxer
Comment options

Answer selected by SachaSaxer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant