To download NI software, including the products shown below, visit ni.com/downloads.
Overview:
This example provides tools to implement a pop-up alpha-numeric keyboard or numeric keyboard in a LabVIEW VI or application. This is extremely useful in touch screen applications.
Description:
The main elements of this library are the pop-up alpha-numeric keyboard VI (HMI Pop Up Alpha KB.vi), the pop-up numeric keyboard VI (HMI Pop Up Num KP.vi), and an example VI (Sample Usage.vi). The library also includes custom controls and a keyboard driver.
The keyboard VIs can be used as subVIs, as shown in the example, named Sample Usage.vi. In this example, when a user clicks on a control on the front panel, either the alpha numeric or numeric keyboard pops up. This is done using an event structure as shown in the code below.
After the keyboard pops up, the user can type, and then press accept. This will close the pop-up and the words that were typed will be entered in the control. The keyboard VIs include a setup, an event structure, and a finish. The event structure executes each time a button is pressed.
In the event structure, information is passed to the keyboard driver each time there is an event. The keyboard driver performs an operation and then returns the string and the edit position. The keyboard driver is works as a functional global variable. Depending on the command, it will initialize, add a character, replace a character, delete a character, move the cursor to the left or the right, update the edit position, or nothing. The edit position, string, and maximum character length from the previous iteration of the driver are stored in shift registers.
Requirements:
LabVIEW 2012 (or compatible)
No hardware is required, but this would be most useful on a touch panel device.
Information about National Instruments Touch Panel Computers can be found here:https://www.ni.com/en-us/shop/category/hmis-and-displays.html.
Steps to Implement or Execute Code:
Additional Information or References:
To simply run the keyboard VIs ("HMI Pop Up Alpha KB.vi" or "HMI Pop Up Num KP.vi"):
To implement a keyboard in a VI:
Sample Usage Example VI Block Diagram
Alpha-Numeric Keyboard Front Panel
Alpha-Numeric Keyboard Block Diagram
Numeric Keyboard Front Panel
Numeric Keyboard Block diagram
**This document has been updated to meet the current required format for the NI Code Exchange.**
Description-Separate-2Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.