You are here

Stacked Sequence

26 July, 2019 - 09:47
Available under Creative Commons-ShareAlike 4.0 International License. Download for free at

A Stacked Sequence provides a more compact representation of program sequences. It is programmatically identical to the Flat Sequence with the exception that a Sequence Local enables data to flow to subsequent frames. Additionally, as frames are added, a Sequence Selector provides access to the desired frame (see Stacked Sequence).

Figure 5.51 Stacked Sequence 

For this timing example, start with a Stacked Sequence and add 3 more frames. The sequence frames are labeled 0, 1, 2 and 3 and will execute in that order.

Figure 5.52 Four Frame Stacked Sequence  

Go to the first frame (frame 0) and add a Tick Count (ms) function. Right click on the sequence structure and select Add Sequence Local from the pop-up menu.

Figure 5.53 Adding Sequence Locals  
Figure 5.54 Adding Sequence Locals  

The Sequence Local is shown as an undefined tunnel. Wire the Tick Count (ms) function to the Sequence Local to define the tunnel data type and data flow. Data can now flow from frame 0 to the other frames as needed.

Figure 5.55 Sequence Local 
Figure 5.56 Sequence Local 

Go to the next frame sequence (frame 1) and enter the program to be timed.

Figure 5.57 Frame to Time 

Go to the third frame of the sequence (frame 2), add a Tick Count (ms) function, add another Sequence Local and wire the Tick Count (ms) to the new Sequence Local. The wired sequence frame is shown in Stop Time Stamp.

Figure 5.58 Stop Time Stamp  

Go to the last frame (frame 3) and add aSubtract function. Wire the Sequence Locals from frame 2 and frame 0 to the Subtract function as shown in Stacked Timing G Program. To complete the diagram, wire the output of the Subtract function to the unsigned integer 32 output.

Figure 5.59 Stacked Timing G Program  

It is important to note that the programs in Timing G Program and Stacked Timing G Program are programmatically identical.