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).
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.
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.
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.
Go to the next frame sequence (frame 1) and enter the program to be timed.
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.
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.
It is important to note that the programs in Timing G Program and Stacked Timing G Program are programmatically identical.
- 1967 reads