From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Example Code

Multi-state LED Indicator using 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 uses a customized color box control to represent a multicolor LED.

 

Description

This custom control is actually a color box control that has been changed to be an indicator (right-click»Change to Indicator) and then customized (right-click»Advanced»Customize...) to look exactly like a Boolean LED indicator. Since the color box control is actually a U32 numeric, you can wire in any value from 0 to 4,294,967,295, however, the easiest way is usually to use a color box constant on the block diagram to assign a value to the multi-state LED indicator. Using this in conjunction with a Case Structure and then some sort of selection control, such as an enum, provides an easy way to use this multi-state LED indicator.

 

Requirements

  • LabVIEW 2012 (or compatible)

 
Steps to Implement or Execute Code

1. Run VI
2. Use Enum control to change color

 

Additional Information or References

VI Block Diagram

 Multistate Led Example LV2012 NI verified.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.