Example Code

Retrieve HID Device Values for Use in 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

Download All

Overview

This VI simply provides a text field where HID compliant devices can enter data for use in LabVIEW.

 
Description

An HID device returns the values that it reads as if a keyboard typed it in, so this VI will take each reading and append it to an array. The primary value of this VI, is that after handling a data point, it refocuses input on the text field so the next point can be captured as well.

This has been tested with a USB barcode scanner, but should work with other HID compliant devices as well.


Requirements

  • LabVIEW 2012 (or compatible)


Steps to Implement or Execute Code

  1. Run the VI.
  2. Input data into the "Data Input" Control;
  3. Press Enter, you can see the data show in the array.

Additional Information or References
VI Snippet

006.png

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

Fred Visser -- SystemLink R&D -- National Instruments

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