Any transaction group that records to a DB can be replaced by a script that performs the following:
-
Call
system.tag.readBlocking()
with a list of needed tags, and/or callsystem.opc.readValues()
with a list of needed OPC Items (or both), -
Perform any arithmetic necessary for expression items using the above values,
-
Execute
system.db.runPrepUpdate()
call to INSERT or UPDATE into the database, -
Perform any writes to handshake tag(s), if applicable. (Many more possibilities than the simple fire-and-forget handshake you otherwise must use.)
The above operations would be called from a gateway timer event or gateway scheduled event for any unconditional groups. You would call from a gateway tag change event for triggered groups. If your trigger condition is an always-run expression item, you would make an expression tag from that expression and monitor changes of the expression tag.
Using scripts allows you to factor out common operations into subroutines, and to monitor multiple tags with a single script (as long as they use the same underlying structures). Multiple unconditional recordings running at the same pace can be packed into a single script using looping and subroutines.