incendium.tag.write - ignition-devs/incendium GitHub Wiki
Description
Write a value to a tag.
Note that this function will block until the write operation is complete or times out.
Syntax
incendium.tag.write(tag_path, value)
Args:
- tag_path (
str
|unicode
): The path of the tag to write to. - value (
Any
): The value to write.
Returns:
- int: 0 if the write failed immediately, 1 if it succeeded immediately, and 2 if it is pending.
Code Examples
import incendium.tag
# This code would go on a property change event for a numeric text
# field to calculate and write a value to a tag.
if event.propertyName == intValue:
calcValue = event.newValue - 2.5
incendium.tag.write("Tanks/tankHiSP", calcValue)