Replies: 3 comments 1 reply
-
Which values did you expect and how is the type defined on the OPC/UA server? |
Beta Was this translation helpful? Give feedback.
-
We found root cause for this issue. This custom structure was type_1 structure ( structure with optional fields ) and in this case 4 byte would be for EncodingMask. When we included EncodingMask in our structure, we were able to read correctly. ask is- @magiconair , @kung-foo - Please refer 5.2.7 Structures with optional fields |
Beta Was this translation helpful? Give feedback.
-
We don't have explicit support for structures with optional fields at this point. I'm open to a PR. |
Beta Was this translation helpful? Give feedback.
-
Hello,
we are trying to read a custom extension object from opcua server. However , we received incorrect value of a node.
we followed steps below -
1- Register custom structure data type using ua.RegisterExtensionObject.
2- Read custom extension objects using func (*opcua.Client).Read(req *ua.ReadRequest) (*ua.ReadResponse, error)
3- we notice incorrect value.
Note - With UAExpert tool, we are able to read value of node correctly.
Value return by Read method -
"Value": {
"Field1 ": 1.732800029556475e-83,
"Field2 ": "2240-10-23T03:33:15.350302776Z",
"Field3 ": -4.5784509639558184e-216,
"Field4 ": -1.2664930322085519e-220,
"Field5 ": 5.310555374e-315,
"Field6 ": 0
}
Structure definition -
type A struct {
Field1 float64
Field2 time.Time
Field3 float64
Field4 float64
Field5 float64
Field6 float64
}
@kung-foo @magiconair
Thanks !
Beta Was this translation helpful? Give feedback.
All reactions