'Writing data values using OPC UA by set_attribute

I would like to write data via OPC UA using a simple Python script. For this I use the following code for Boolean values:

first_value = Device1.get_objects_node().get_child("2:DeviceSet").get_child("3:BuR").get_child(
    "3:Memory").get_child("3:BoolFlag") #TODO: Pfad Kontrollieren


first_value.set_attribute(ua.AttributeIds.Value, ua.DataValue(False))

Now i´d like to change the script for ints

first_value.set_attribute(ua.AttributeIds.Value, ua.DataValue(10))

But sadly that is not working. Did somone already tried something similar?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source