system.tag.writeAllSynchronous
This function is used in Python Scripting.
Description
Performs a synchronous write to multiple tags. Synchronous means that execution will not continue until this function has completed, so you will know that a write has been attempted on the provided tags. The first write to fail or time out will throw an exception, but any subsequent tags in the provided list will still be attempted. This function cannot be called from the event dispatch thread, meaning it cannot be called directly from a GUI event like a button press without creating a new thread with a call to system.util.invokeAsynchronous. You can call this from project event scripts like timer scripts.
Note that the order of the tags listed in the tagPaths parameter determines the order that the writes will occur.
Client Permission Restrictions
This scripting function has no Client Permission restrictions.
Syntax
system.tag.writeAllSynchronous(tagPaths, values [, timeout])
Parameters
Type | Parameter | Description |
---|---|---|
String[] | tagPaths | The paths of the tags to write to. |
Object[] | values | The values to write. |
int | timeout | How long to wait in milliseconds before timing out pending writes. The default is 45000 milliseconds. [optional] |
Returns
Nothing
Scope
All
Code Examples
# This code write to 5 tags at once, waiting up to 30 seconds for any pending writes to complete.
tags = ["Tags/T1", "Tags/T2", "Tags/T3", "Tags/T4", "Tags/T5"]
values = [2, 4, 8, 16, 32]
timeout = 30000
system.tag.writeAllSynchronous(tags,values,timeout)