Online, real-time mode
- Last UpdatedApr 30, 2024
- 2 minute read
This mode involves scheduling a sequence to run at an interval. You configure a sequence such that it runs on a schedule, for instance running it every hour or every five minutes. AVEVA Real-Time System (RTS) waits until it's time to run the sequence and then runs it automatically by using the schedule's timestamp.
You add schedules to the sequence_settings.json file, as shown in the following JSON code example:
"scheduled_runs": {
"Every1Hour": {
"interval": "01:00",
"offset": "00:00"
}
}
You can then invoke the scheduled sequence by using the start-sch command, as shown in the following code example:
rts start-sch basicsample Every1Hour
This example runs the basicsample sequence every hour.
The schedule whose is_default property is set to true is considered the default. When you don't specify a schedule on the command line, the default schedule is used.
The interval setting determines how often the sequence runs. The offset argument is optional. You can use it to prevent sequences from attempting to run at the same time. For example, if you have three different sequences that you want to run every hour and each sequence takes about ten minutes to run, you can configure the second and third sequence with an offset of "00:10" and "00:20", respectively, to spread them out.
The ScriptHost can run only one sequence at a time. A sequence that's ready to run waits for any other sequences to complete before starting. Then, when started, it uses the original timestamp for when it would have run. For example, if three sequences are queued to run at 3 AM and each sequence takes 10 minutes to run, the second one starts at 3:10 AM but still uses the timestamp of 3:00 AM, not 3:10 AM.
The stop-sch command stops whatever scheduled sequences were started by using the start-sch command.
Scheduled runs are resilient across system restarts if RTS is configured as a service. If you don't stop a scheduled sequence, it remains in the queued sequences even after the computer restarts.
To monitor the progress of a scheduled run, you can monitor the sequence log file. See Monitor a log file for more information.