The byte string I read from the ExtensionObject node on the opcua server side is how do I convert it to a decimal, this is the result of parsing one of the bytestrings according to the struct module in python.
This is obviously wrong, what am I supposed to do about it, the data I got was something like this
This is my code:
import struct# Example byte string containing double valuesbyte_string = b'\x84^\x05\x00\x00\xf7\n\x19\n\....'# Determine the size of a double in bytesdouble_size = struct.calcsize('!d')# Calculate the number of double values in the byte stringnum_values = len(byte_string) // double_size# Loop through the byte string and unpack double valuesfor i in range(num_values): # Calculate the offset for the current double value offset = i * double_size # Unpack the double value from the byte string double_value = struct.unpack_from('!d', byte_string, offset)[0] print(double_value)
If someone has advices,thank you inadvance.