Closed DavideFigundio closed 6 months ago
You can not bitmask a float. If you still want to do this, write your own function like this:
def set_bit(node: SyncNode, bit: int, value: bool):
v = node.get_value()
t = None
if isinstance(v, float):
v = int(v)
t = type(v)
val = int()
if bit:
val = val | (1<<bit)
else:
val = val & ~(1<<bit)
if t is not None:
val = t(val)
node.set_value(val)
Currently it is not possible to change the attribute bits for float and double values.
I am running the following code:
Whenever the value attribute of
node
is a float or double, calling this function raises an exception:Python version: 3.12 opcua-asyncio version: 1.0.6