Example Code

Boolean Array Case Selector in LabVIEW

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Overview

This example gives an efficient way to handle all possible combinations of multiple boolean input values.

 

Description

This VI demonstrates one way to organize your logic for determining which case of a case structure to execute. It becomes very useful when you have to handle every possible combination of multiple boolean values. The number of possibilities is 2^n, so with 4 boolean values there are 16 possible combinations of those values.

 

Requirements

LabVIEW Full Development System 2012 or compatible

 

Steps to Implement or Execute Code

  1. Run the VI
  2. Click on the Input Array control to change the binary values and selected case Messages

  

Additional Information or References

Note that the functionality of the case structure makes it possible to handle multiple possibilities with one case very easily. See the LabVIEW help for the case structure for the syntax for having a case handle both close and open ended ranges and lists of values.

 

VI Block Diagram

 4746.PNG

**This document has been updated to meet the current required format for the NI Code Exchange. **

 

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.