Example Code

How to combine ring or enum control output with combo box search

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

Download All

Overview

This is a very simple example to show how to effectively turn a combo box with its delightful search feature into a ring or enum control, which goes from string->value.

 

Description

This is a very simple example to show how to effectively turn a combo box with its delightful search feature into a ring or enum control, which goes from string->value. This would be particularly helpful when you have an enum or ring with a very large number of values, so scrolling becomes a hassle.

 

Rings, enums, and combo boxes all have two inputs, the "string", which is what is seen,  and the "value" which is what the program reads. The "value" for a ring/enum is a number, while its a string for a combo box. To convert from enum to combo box, Im simply changing that value over to a string of the same information, then converting it back to an integer after it is read. This is an easy way to get a ring or enum out of a combo box with search.

 

Requirements

  • LabVIEW 2012 (or compatible)

 

Steps to Implement or Execute Code

  1. Run the VI and it generates a 20 items for the combo box, with the string "message number [number].
  2. Select one item Message number [number] and it will output the value [number], converted to integer, like an enum

 

Additional Information or References

VI Snippet

1.png

 

 

 

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

 

Regards,

Kyle M.
Applications Engineering
National Instruments

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