So I'm currently testing out the library and I'm having some trouble registering UDTs.
I have succesfully registered a UDT which is on the public OPC Milo server:
Using the following code
This all worked fine and I got the values that are in the foo, bar and baz fields.
Now I'm trying to do this for one of my servers, which has the following struct:
For which I'm using the following code to register:
type UDT_SemVer struct {
major uint8
minor uint8
patch uint8
}
func init() {
ua.RegisterExtensionObject(ua.NewStringNodeID(3, "\"MasterController\".\"Modules\".\"Compressor\".\"ID\".\"ElectricalVersion\""), new([]byte))
ua.RegisterExtensionObject(ua.NewStringNodeID(3, "DT_\"UDT_SemVer\".BinaryEncoding"), new(UDT_SemVer))
}
The reading is almost identical to the previous one, the only differences being the nodeId and the type conversion at the end.
The response is as follows:
Any idea why this isn't working?
So I'm currently testing out the library and I'm having some trouble registering UDTs. I have succesfully registered a UDT which is on the public OPC Milo server:
Using the following code
and read it as follows
This all worked fine and I got the values that are in the foo, bar and baz fields. Now I'm trying to do this for one of my servers, which has the following struct:
For which I'm using the following code to register:
The reading is almost identical to the previous one, the only differences being the nodeId and the type conversion at the end. The response is as follows:
Any idea why this isn't working?