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 was facing an issue to read/write dimensional array in the variant variable with direct node access.
It looks like there was a TODO placeholder for dimensional arrays in the decoder. But encoding is also missing it.
I have made a comit 348ab93 in a forked branch with read/write example working.
It would be useful to have some kind of a structure to keep the information about additional properties of the Variant like this to be part of the variant.:
type VariantMetadata struct {
//mask contains the type and the array flags
//bits 0:5: built-in type id 1-25
//bit 6: array dimensions
//bit 7: array values
EncodingMask byte
ArrayLength int32
ArrayDimensionsLength int32
ArrayDimensions []int32
}
That TODO placeholder has been there for years. Thank you for working out a solution.
Why would it be useful to add the metadata fields to Variant?
If we did would users need to use methods like ua.NewVariant() and value.Value() to wrap and unwrap a Variant?
I added support to encode a Variant with a 2D or 3D matrix value (from 2D or 3D slices).
I still need to support encoding Structure with a matrix property.
And then I would consider adding more dimensions.
I was facing an issue to read/write dimensional array in the variant variable with direct node access.
It looks like there was a TODO placeholder for dimensional arrays in the decoder. But encoding is also missing it.
opcua/ua/binary_decoder.go
Lines 1294 to 1296 in 387afc9
I have made a comit 348ab93 in a forked branch with read/write example working.
It would be useful to have some kind of a structure to keep the information about additional properties of the Variant like this to be part of the variant.:
I looked into https://github.com/gopcua/opcua library as alternative solution and used some of its array reconstruction method as well as flattened array read/write.
I hope my fork can help to add it here to the master branch eventually.
What do you think?
Let me know how you see it in the end, so I can adapt it for merging...
The text was updated successfully, but these errors were encountered: