Looping process

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.

while process_is_active: 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.

Are you using a PLC? I’d say this belongs in it and should just be activated by the HMI. What would happen if the HMI/network/Ignition server goes down while the process is running?

Thanks for the input. We will be using a PLC so that may be the best solution. However, this process is non-critical so it’s not a big deal if the communication with the Ignition server cuts out. The advantage to doing it in the HMI is that it is easier to view and change the programming after the system is installed if necessary.

Just wondering if there is a better way of accomplishing it in Ignition than what I described.

jackswiggett

take a look at Ignitions SFC module, it may be what you want

https://inductiveautomation.com/scada-software/scada-modules/sequential-function-charts

yes.. 100%.