I am new to SCADA, so forgive me if this is a silly question, but I would like to create a continuously looping sequence of actions - a “process” - that can be activated or deactivated, but that runs indefinitely in the background when activated. The HMI would have a simple switch to start or stop the process.
For example, given a system with two hydraulic cylinders, and sensors to determine when each cylinder is fully extended or retracted, execute a process such as the following pseudocode.
extend the first cylinder until the sensor indicates that it is fully extended
extend the second cylinder until the sensor indicates that it is fully extended
retract the first cylinder until the sensor indicates that it is fully retracted
retract the second cylinder until the sensor indicates that it is fully retracted
The only way I see to do this would be to have a tag indicating whether the process is active or inactive, and four event scripts that execute when the first cylinder is extended, first cylinder is retracted, second cylinder is extended, and second cylinder is retracted. Each script would check whether the process is running and, if it is, update the movement of the cylinders accordingly. This logic would be divided across five scripts (the fifth being to activate/deactivate the process) and would not be very clean.
Is there a way of combining this logic into a single script that runs looping in the background, or another simpler way of accomplishing this, still without spending too much time on the processor? The other question is whether this kind of logic is better left to a PLC and shouldn’t be implemented in the SCADA.