Skip to content

incendium.tag.write

César Román edited this page Apr 30, 2024 · 9 revisions

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): The path of the tag to write to.
  • value (object): 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)
Clone this wiki locally