Skip to main content
Version: 7.9

system.tag.write

This function is used in Python Scripting.

Description

Writes a value to a tag. Note that this function writes asynchronously. This means that the function does not wait for the write to occur before returning - the write occurs sometime later on a different thread.

Client Permission Restrictions

This scripting function has no Client Permission restrictions.

Syntax

system.tag.write(tagPath, value, suppressErrors)

Parameters

TypeParameterDescription
StringtagPathThe path of the tag to write to.
ObjectvalueThe value to write.
BooleansuppressErrorsA flag indicating whether or not to suppress errors. (optional, client-only).

Returns

int - 0 if the write failed immediately, 1 if it succeeded immediately, and 2 if it is pending.

Scope

All

Code Examples

Example #1
# 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
system.tag.write("Tanks/tankHiSP",calcValue)