Simultaneous Sequences
In How Sequential Function Charts Work, we explained the basic principles of a Sequential Function Chart. However, the SFC in the example only had a single branch (or path). You can connect multiple steps to a transition so that there are multiple branches—each branch is independent of the other branches but is executed at the same time. This allows you to create an SFC that has several processes that occur simultaneously as a result of a specific condition.
To create simultaneous sequences, simply create steps and transitions in the same way as you would for a single branched sequence, then connect the first steps of the simultaneous branches to the transition. When the selected transition is true, the simultaneous branches will occur at the same time.
You can bring the simultaneous branches back into a single sequence by connecting the final steps in the branches to a single transition that occurs after the branches.
Example:
The following Sequential Function Chart shows a basic program that could be used to control a drain and pump when there is a high level of fluid in a pipeline:
The sequence begins with the Start step, and the first condition that has to be met is that the PipeAlarm transition has to be true. The PipeAlarm transition corresponds to the state of a point that monitors the alarm status of the pipe. So, if ClearSCADA detects an alarm condition at the pipe, the Start step is deactivated and the next step (CheckLevel) is activated.
For the CheckLevel step, the system checks the value of a point that monitors the level of fluid in the pipe. The transition defines that the next steps (CheckFlow and OpenDrain) will only be executed if the value for the level is higher than 70.
If the level is higher than 70, the system executes the next steps simultaneously. The OpenDrain step and its sub-steps are executed at the same time as the CheckFlow step and its sub-steps. The conditions in the two paths are independent—the OpenDrain sub-steps and transitions are not affected by the CheckFlow sub-steps and transitions and vice-versa.
When the OpenDrain step is active, it triggers the Drain action. The Drain action has been configured on the Actions window for the SFC to change the state of a point. The point is used to control a drain cover in the pipe—when the point is in state 0, the drain is closed; when it is in state 1, the drain is open. The qualifier of the Drain action association defines that the action only occurs once, when the action first becomes active.
When the Drain action has been executed, this branch of the SFC will continue with the Level<50 transition. However, the Level<50 transition will only be performed if the Drain action has been executed and the CheckLevelAgain step in the CheckFlow branch of the SFC is active. The branches that occur simultaneously have to be complete so that their last step is active before the next transition (Level<50) becomes active.
When the CheckFlow step is active, the system checks for another condition (defined by the Flow<25 and Flow>25 transitions). If the value of the Flow point is less than 25, the system proceeds to the PumpOn step. If the value is more than 25, the system will proceeds to the CheckLevelAgain (as the OpenDrain step is also occurring, and there is a flow in the pipe, the fluid level will drop eventually).
When the PumpOn step is active, it triggers the Pump action. The Pump action has been configured on the Actions window for the SFC to change the state of a point. The point is used to turn a pump on and off—when the point is in state 0, the pump is off; when it is in state 1, the pump is on. The qualifier of the Pump action association defines that the action only occurs once, when the action first becomes active.
When the pump is turned on, the flow of fluid in the pipe will increase. This is also aided by the open drain (the drain is opened at the same time as the CheckFlow step). So, the next part of this branch is to determine whether the flow is greater than 25 (Flow>25).
When the flow is greater than 25, the CheckLevelAgain step becomes active. If the Drain action has been executed and the CheckLevelAgain step is active, the system will proceed to the Level<50 transition.
If the level is lower than 50, the amount of fluid in the pipe is normal and so the SFC can be stopped—the system proceeds to the Stop step and performs the CloseDrain action and the StopPump action.
If the level is higher than 50, the drain remains open and the pump remains on. They will only be closed and turned off when the level drops below 50.