How Do I Use LabVIEW to Communicate with a Printer Through USB?

Updated Jun 4, 2019

Reported In

Software

  • LabVIEW

Driver

  • NI-VISA

Issue Details

I have a 3rd-party Zebra printer that has a USB port. How can I use LabVIEW to control the printer?

Solution

In general, a printer with a USB port has a virtual COM port created by USB-to-serial adapters within the printer. Using LabVIEW to communicate with the printer you will need communicate with the printer as a serial device. Additionally, you will need to understand the communication protocol of the printer. You can consult Zebra by contacting their technical support for more information about the printer protocol. 
 
Using LabVIEW to communicate with a serial device:
  1. Install the NI-VISA driver in the computer. You can download the NI-VISA  installer from ni.com.
  2. Plug in the device to the computer.
  3. Find the serial port of the device in the computers device manager.
    1. If the computer is unable to identify the device, please check if the device’s driver is effective, or consult the device provider.
  4. Program in LabVIEW to communicate with the serial port. You can search in the NI Example Finder with keyword “VISA” for related examples. To open the NI Example Finder, click HelpFind Example in LabVIEW. The following examples may help:
    • Simple Serial.vi
    • Continuous Serial Write and Read.vi

WAS THIS ARTICLE HELPFUL?

Not Helpful