This lesson is part of the Sequential Function Charts in Ignition course. You can browse the rest of the lessons below.

LESSON LIST

Autoplay Off

Description

Here is a detailed explanation of how the Parallel Section functions in a Sequential Function Chart.

Video recorded using: Ignition 7.7

Transcript

(open in window)

[00:00] The Parallel Section, right here on the Palette, is another powerful Element that you can use in an SFC. The Parallel Element allows multiple things to happen at once. Each different branch of logic that you start from the top of the Parallel will execute at the same time. I have a chart already made here that has three different branches of chart logic and we can watch it execute and watch how they all execute simultaneously. You can see how we have multiple steps running at a time. And outside of a Parallel Step, that will never happen. But inside of a Parallel Step, you can have as many branches of logic as you want run simultaneously. The flow of the chart won't move beyond the bottom of the Parallel chart until all three sections, or as many sections as you have, have reached the bottom of the Parallel area. So in this case we've got, this one has reached the bottom, that one reached the bottom, and now that one just finished and the chart is done. You can do anything that you would do outside of a Parallel, inside of a Parallel Section, except for using an End Step. Also, Jumps and Anchors have a separate name space inside of a Parallel Section. So you cannot Jump out of a Parallel Section, back into the normal chart. Normally, the Parallel Section won't continue until all the branches that were started have reached the bottom. But this can be changed using a Cancel Condition. This is an expression, much like a transition expression, that, if it becomes true, will cancel any remaining running Elements inside the Parallel Section and move on down below. So for example, you could use this to create a Parallel Section that waited for, say if I've got three branches here, I could create a Parallel Section that waited for two out of three of the branches to continue. And the way you would do that is by placing Actions at the very bottom of each branch of logic and these Actions would increment a counter. So for example, I could say, "chart dot parallel finished plus equal one." I would put that same Action on all three of these On Start Actions. You could initialize that variable here in the Begin Step Like that so that it was initialized to zero and then you would just write a Cancel Condition that compared the Parallel finish variable to make sure that it was greater than or equal to two. And this way, as soon as two of these branches have reached the bottom, this variable is going to be two and it'll cancel the remaining third branch. The Parallel Section is one of the most powerful constructs of Sequential Function Charts and one of the things that lets it stand out very distinctly from standard scripting. Using standard scripting it's very hard to have multiple things running at once unless you get into multi-threaded programing which is difficult to use as opposed to the Parallel Block which is very easy to use.

You are editing this transcript.

Make any corrections to improve this transcript. We'll review any changes before posting them.