Example Code

Read 1D Barcode Example



 Use this example to read common 1D barcodes from sample images.




This example performs a simulated image acquisition using the Vision Acquisition Express VI. It then uses IMAQ Read Barcode 2.vi to locate and read 1D barcodes within the acquired image. The barcode location and data is overlayed onto the image and the results are shown in the front panel indicators. This VI is configured to only search for EAN 13, Code 39, and Code 128 barcodes, although it could be configured to search for additional types of barcodes.


This example is included with the LabVIEW Vision Development Module and can be found in the LabVIEW Example Finder.



Hardware and Software Requirements


 LabVIEW Vision Development Module


Steps to Implement or Execute Code


  1. Ensure that the Vision Development Module is installed.
  2. Open the example from Help >> Find Examples >> Toolkit and Modules >> Vision >> Barcodes >> Read 1D Barcode.vi.
  3. Run the VI.

Additional Information or References


The IMAQ Read Barcode 2 VI supports the following types of barcodes:

  • Codabar
  • Code 39
  • Code 93
  • Code 128
  • EAN 8
  • EAN 13
  • Interleaved 2 of 5
  • MSI
  • UPCA
  • Pharmacode
  • RSS Limited (GS1 Databar Limited)

Front Panel:

2017-12-19 14_33_31-Read 1D Barcode.vi.png

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


I am doing my final year project entiled smart inventory system. 

How do I connect barcode scanner to LabVIEW in order to read the barcode labels?


Thank you.


 yeah, can i know how to connect barcode scanner with labview?? if yes please send the answer to ragaphanigna99@gmail.com