Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Scripting_function



Panel
titleDescription

Performs an asynchronous bulk write. Takes two sequences that must have the same number of entries. The first is the list of tag paths to write to, and then second is a list of values to write. This function is dramatically more efficient than calling write multiple times.


Panel
titleClient Permission Restrictions

This scripting function has no Client Permission restrictions.


Panel
titleSyntax

system.tag.writeAll(tagPaths, values)

  • Parameters

String[] tagPaths - The paths of the tags to write to.

Object[] values - The values to write.

  • Returns

int[] - Array of ints with an element for each tag written to: 0 if the write failed immediately, 1 if it succeeded immediately, and 2 if it is pending.

  • Scope

All



Panel
titleCode Examples


Code Block
languagepy
titleCode Snippet
# This code write to 5 tags at once.
 
tags = ["Tags/T1", "Tags/T2", "Tags/T3", "Tags/T4", "Tags/T5"]
values = [2, 4, 8, 16, 32]
values = system.tag.writeAll(tags,values)


Code Block
languagepy
titleCode Snippet
# Similar to the prior example, except this includes the tag provider in the tag path of each tag. 
 
tags = ["[tagProvider]Tags/T1", "[tagProvider]Tags/T2", "[tagProvider]Tags/T3", "[tagProvider]Tags/T4", "[tagProvider]Tags/T5"]
values = [2, 4, 8, 16, 32]
values = system.tag.writeAll(tags,values)