Example Code

Auto Data Entry Combo Box 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 VI allows users to automatically enter and delete entries during run time using a combo box

 

Description

This VI includes a combo box that will allow users to automatically enter and delete entries during run time. To insert an element, simply type in the combo box and hit enter.  You will then be able to select that item from the drop down.  To delete an element, simply select the element you want to delete, highlight the text, hit backspace and then enter.  This functionality is all wrapped around an XControl for convenient use when programming.

The full functionality of a typical combo box has not been implemented.  For example, there are no "Values" associated with any of the "Strings".  Thus, there is also no "Strings and Values" property node.  In addition to this, elements are always inserted alphabetically.  An improvement to the XControl could include adding a "SortEnabled?" property to the control so that this feature can be used as desired.

 

Requirements

LabVIEW 2012 or compatible

  

Steps to Implement or Execute Code

  1. Run the VI
  2. To Insert, provide a string in Data Entry Combo Box (or choose one) and hit Enter
  3. To Delete, select it, highlight it, hit Backspace and then Enter

Additional Information or References

VI Block DiagramData Entry Combo Box bd.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.

Comments
leamon
Member
Member
on

thanks.

i am the beginning,can you tell me how to use xcontrols in the test.vi?

Burt_S
NI Employee (retired)
on

To use the XControl, simply start typing in values and hit enter.  You should then see those values entered automatically into the Combo Box Drop Down list.  With a typical combo box, this information would not be added to the list.  To use this XControl in your own VI, add the control to your project and then click and drag it to the VI's front panel.  Let me know if anything is unclear.

leamon
Member
Member
on

thanks.