This is a very basic example of a design pattern we've dubbed the "Sequence Loop". The VI is set up to place VI contents (created with this cool Quick Drop tool) so it is easy to add a sequence loop to your VI via the palettes or Quick Drop.
Stacked sequences are hard to read and generally disliked (for good reasons). That is why they are no longer on the palette. But what do you do if you have a VI with a lot of relatively simple logic that needs to get executed sequentially? A block diagram with a width many times the width of a monitor is hard to read. The overhead associated with introduction and maintenance of numerous subVIs may not be worth the trouble. A string or enum driven state machine is overkill, because you will never need decision making, but the design pattern is appealing for its readability.
Enter the Sequence Loop. It is a simple way to keep your code clean and compact while utilizing Shift registers to pass values around (yay for no sequence locals or backwards wires!).
It looks like this:
Super simple and effective, and easy to extend. Here's a typical loop that could be used in a test program developed with TestStand Semiconductor Module (TSM):
Enjoy being able to drop Sequence Loops from the palette (or even faster with Quick Drop since QD automatically pulls in all the VIs on the palette)
Additional Information or References
Q: Isn't this just a stacked sequence structure in disguise? Is it terrible too?
A: No. Sequence Loop satisfies the needs that the Stacked Sequence was intended for without the downsides of the Stacked Sequences. Stacked sequences have sequence locals which break dataflow and are difficult to reason through and debug. The Sequence Loop looks and feels like a very simple state machine and is easy to read.
Q: Why is there an increment function, why didn't you just start your case structure numbering at 0?
A: This was the subject of much debate. From a functional standpoint 0 would be fine. From a linguistics standpoint we all agreed that we don't like using the word "zeroth" in normal conversation and that calling case 0 the "first case" would be super annoying, so the increment stuck.
Q: What if I want to add a case in the middle? Do I have to renumber all X remaining cases to preserve execution order?
A: Not at all! If you're using this design pattern you can download the companion right-click menu that makes adding or removing frames as simple as a couple clicks.
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.