AVEVA Real-Time System Events
- Last UpdatedApr 30, 2024
- 1 minute read
The ScriptHost runs a sequence script by invoking Events. The term Event here is an AVEVA Real-Time System (RTS) concept and not related to C# events. RTS Events are well-known, top-level function names that the sequence script must have.
The following table lists these Events.
|
Event |
Description |
|---|---|
|
Init |
RTS calls this Event first. If the Event returns false, it doesn't call the Run Event. This is a good place to perform any initialization commands needed in the script, such as opening a simulation. |
|
Run |
This is typically where the script does most of its work. This Event does not run if the Init Event returned false. |
|
Shutdown |
RTS calls this Event at the end to perform any clean-up activity. This Event runs even if the Init Event returned false. |
Typically, when a sequence script is invoked to run once (such as with rts run), RTS calls the Init Event first, followed by the Run Event, and finally the Shutdown Event. However, when a sequence runs over a range of timestamps, such as with a backfill run, RTS calls only the Run Event for each timestamp. It calls the Init and Shutdown Events at the start and the end of the range only. In this way, you can initialize the sequence script in the Init Event by opening the simulation once, use that opened simulation in the Run Event continuously with different timestamps, and then close the simulation in the Shutdown Event.