The sequencer design pattern is a way to organize code on the block diagram without hiding code behind subVIs.
In LabVIEW we often find ourselves writing code that extends beyond the width of our monitors. For example, VI Server or VI Scripting calls can become very wide. Classically we have addressed this problem by creating subVIs to organize our code. A subVI's main benefits are to enable code reuse, encapsulate an idea in a single unit, and enable unit testing. But to use subVIs to simply make code fit on one screen means you pay the cost of creating subVIs (documentation, unit tests, connector pane styles, etc) without the benefits of code reuse. Further, you hide implementation details from the block diagram and create unnecessary depth to your VI hierarchy.
I believe that creating subVIs for code organization versus reuse isn't organization at all; it is obfuscation. So I've created a very simple pattern that makes your code very readable and abstract while maintaining the low level implementation details all in one diagram. I call this pattern the "Sequencer".
The sequencer is a modified state machine where each state affects the sequence only through means of returning an error. On error, the machine stops. The sequencer is based on CLAD level syntax and is implemented with arrays, case structures, for loops, a shift register and clusters.
Below you see the Sequencer TemplateSequencer Pattern
The array of hard coded strings represent the abstract ideas to be sequenced. This array can act as a summary of your code.
The cluster is local data used between sequences. This should not be turned into a type def unless passed into a subVI.
The for loop iterates through all the sequences in the order specified by the sequence array. As a modification, you can place a case structure around the sequence array and pass a "mode" into the sequencer to change its behavior.
The inner case structure contains the implementation details of each sequence.
The error handler creates a custom message indicating which sequence failed and with what specific error. Upon error, the sequencer aborts.