You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I kindly request an example of (client side) encoding and decoding of an extension object, containing a custom structure datatype value with potentially variable length components.
Many thanks!
Simple Example (pseudo code):
type MyCustomStructure structure {
NodeAID *ua.NodeId
NodeBID *ua.NodeId
Message string
LowerBound time.Time
UpperBound time.Time
}
// let's assume, there is a custom OPC UA structure DataType matching MyCustomStructure definition
// the nodeId of the dataType is
dataTypeID := NewNumericNodeId(123, 4456)
structDef := *ua.StructureDefinition... // the structure definition of the custom dataType has already been read
// encoding
value := MyCustomStructure{ ... }
variant := ua.MustVariant(????). // Variant to contain the binary encoded ExtensionObject of a value
// decoding
extObjWithCustomValue := .... // this is the extensionObject to be decoded; the encoding and dataType have been checked
// ???? how do I get the field values from the extension object, when field values have upfront unknown length
The text was updated successfully, but these errors were encountered:
hbrackel
changed the title
Request for example: Decoding of custom structure dataType values
Request for example: Decoding of custom structure dataType values with variable length components
Feb 11, 2025
I kindly request an example of (client side) encoding and decoding of an extension object, containing a custom structure datatype value with potentially variable length components.
Many thanks!
Simple Example (pseudo code):
The text was updated successfully, but these errors were encountered: