Example Code

Use the TAB Key to Register a String Without Changing Front Panel Objects

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 uses a Key Down Filter Event to disregard the TAB key (and not swich front panel objects) while at the same time reading in the entered string.


Description:

This example program was written while use a USB barcode scanner to enter data. The scanner appends a TAB character after every scan to denote the end of the bar code. The TAB key by default changes front panel objects when pressed. So, in order to scan the next bar code, the user must reselect the sting control to enter the next bar code. 

This VI uses a Key Down Filter Event to disregard the TAB key (and not swich front panel objects) while at the same time reading in the entered string.


Requirements: LabVIEW 2012 (or compatible). Hardware: none.


Steps to Implement or Execute Code:

1. Run the VI.
2. Start typing in the Input String.
3. Press the TAB key.
4. Notice that the "TAB Pressed" indicator is On.
5. Notice that the entered string is now in the Entered String.
6. Repeat steps 2-3. Notice that the user does not need to move hands from keyboard (or scanner) to enter the next string.
7. Stop stops the program.

 


Additional Information or References: 

 

Use the TAB Key to Register a String Without Changing Front Panel Objects FP.png

 

Use the TAB Key to Register a String Without Changing Front Panel Objects BD.png


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

 

Hope this helps.
-Ben

WaterlooLabs

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

Comments
titi_nicolas
Member
Member
on

The VI Use the TAB Key to Register a String Without Changing Front Panel Objects LV2012 NI Verified.vi ‏31 ... does not work as expected.

 

To make it work, a Flat sequence must be added around the Input String control as shown below :

titi_nicolas_1-1645000193970.png

 

 

I am using LV 2020.