Solution
You can use the VISA API to communicate with the USB device. Any USB device that doesn't have an associated driver in the Operating System (OS) gets attached to VISA by default. This means that if you plug any USB device in your system, it should have a VISA resource that can be referenced with the VISA API.
The type of VISA communication will depend on the type of USB instrument. The two types of USB instruments and resources to communicate with the instrument are listed below:
- USBTMC (USB Test & Measurement Class):
An instrument must have support for the USBTMC protocol in order to be considered part of the USB Test & Measurement Class, otherwise it is lumped into the USB RAW category.
If a device is USBTMC, it acts exactly like a GPIB instrument. For more information about communicating with USBTMC devices, please see the following:
- USB RAW:
If an instrument is USB RAW, make sure the communication method is supported by NI-VISA. For any USB instrument, there are four different ways of communicating: Bulk, Control, Interrupt, and Isochronous. NI-VISA driver supports Bulk, Control, and Interrupt communication.
In the National Instruments Example Finder, there are three examples that demonstrate Bulk, Control, and Interrupt communication. To find them:
- Navigate to NI Example Finder by selecting the Help tab in LabVIEW >> Find Examples.
- Navigate to Hardware Input and Output >> VISA. The examples are called:
- USB RAW - Bulk.vi
- USB RAW - Control.vi
- USB RAW - Interrupt.vi