A Sequencer is a design pattern used for executing LabVIEW code sequentially.
This particular implementation was made possible in LabVIEW 2017 SP1 when a new malleable VI named Enum to Array of Enums.vim was created.
A malleable VI (with extension .vim) is a VI that is inlined into its calling VI and can adapt each terminal to its corresponding input data type. What this means is that this VI can work with any enum that you create. This VI will create an array of enums, one for every possible value within the enum. This array is then indexed using a For Loop and then each enum value is passed to a case structure to perform that particular step in the sequence.
This pattern, sometimes called the Natt Sequence after NI employee Darin Nattinger (who also invented Quick Drop and is often called the world’s fastest LabVIEW programmer), has multiple benefits over other sequential code constructs such as the Flat Sequence and Stacked Sequence structures.
- It is self-documenting via the sequence enum which will display in the case structure identifying each case.
- No extra tooling required, just edit the sequence enum to add/remove/modify/rearrange sequence steps.
- Shift registers can be used to share data between sequence steps.
- Optional early break with For Loop conditional terminal.