Is there a function or method for decoding OPC-UA extension objects to readable form
Question:
UaExpert is displaying this array as follows:
Is there any way to decode this extension object to a readable form? My output is the following. I done some research and the question has been raised but I haven’t found any examples. Using the dict function gets you part way there but some of the items are returned as bytes.
{'TypeId': NumericNodeId(ns=2;i=543214), 'Encoding': 1, 'Body': b'x1bx00x00x00External Application Closedx13x00x00x0025/01/2023 12:40:56x05x00x00x00dfiusx00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00', '_freeze': True}
Answers:
You can load the type definition with the following method:
await client.load_type_definitions()
The complete Sample can be found here:
- Server: Sever with Structs
- Client: Client reading Structs
UaExpert is displaying this array as follows:
Is there any way to decode this extension object to a readable form? My output is the following. I done some research and the question has been raised but I haven’t found any examples. Using the dict function gets you part way there but some of the items are returned as bytes.
{'TypeId': NumericNodeId(ns=2;i=543214), 'Encoding': 1, 'Body': b'x1bx00x00x00External Application Closedx13x00x00x0025/01/2023 12:40:56x05x00x00x00dfiusx00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00', '_freeze': True}
You can load the type definition with the following method:
await client.load_type_definitions()
The complete Sample can be found here:
- Server: Sever with Structs
- Client: Client reading Structs