Synchronous and Asynchronous Operation Modes

Synchronous and Asynchronous Operation Modes

This is a vital setting that determines the working principle of your scripts.

ModeDescriptionWhen to Use?
SynchronousSCADA waits until the script finishes its operation before continuing with other tasks.Prefer this if the script is small, executes quickly, and contains no delays. The performance cost is low.
AsynchronousSCADA runs the script in the background and proceeds with other tasks without waiting for it to finish.Use this mode if the script is large or contains operations that require waiting (e.g., fetching data from the internet, long database queries).

Control Mechanism in Asynchronous Execution

In asynchronous scripts, monitoring the Done bit is crucial to manage the risk of the script being triggered multiple times simultaneously.

  1. Start: Before the script starts running, the relevant Done Tag is set to False.
  2. Completion: When the script execution finishes, the Done Tag is set to True.
  3. Check: Always check if the Done Tag is True before triggering the script. If it is False, it means the previous execution is still in progress, and a new execution should be avoided.

Leave a Reply