system.tag.writeAllSynchronous
Performs a synchronous bulk write to tags. This means that you know at the end of this function whether or not the writes succeeded or not. Writes that fail or time out will throw errors. However, this function cannot be called from the event dispatch thread, which means that it cannot be called directly from a GUI event like a button press, without wrapping it in a system.util.invokeAsynchronous. You can call this from project event scripts like timer scripts.
system.tag. writeAllSynchronous( tagPaths, values [, timeout] )
-
Parameters
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
#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)