SendDataItem (value) Action

The SendDataItem() action sends a value for a specified data item to an asset. This message is sent asynchronously. The data type of the value must match the data type of the data item or the action fails.

Note: The difference between this action and the SetDataItem() action is that the SetDataItem() action sets the data item in the Platform; SetDataItem does NOT change the value of the data item at the asset. SendDataItem() changes the value at the asset.

Format:

SendDataItem(String dataitem, value)

where:

dataitem - name of the data item to which you want to write the value. Make sure the data type of the data item supports the value you want to write (for example, do not define a String value for a digital or analog data item).

Important! If your data item names contain colons (for example, in SNMP data items), you MUST use the escape sequence, $C, when using these data item names in an expression. For example, when you want to refer to a data item named 'Temp:12' in an expression rule, you need to use 'Temp$C12' in the rule for the data item to resolve to its current value. When updating that data item through an action, you need to use the actual data item name as a string variable: SendDataItem("Temp:12", 20).

value - value to write to this data item.

Example:

The following example sends the value 1 to the data item, valve_position:

Then/Else: SendDataItem("valve_position", 1)

See Also