IMAQ Read Barcode VI

LabView NI Vision

IMAQ Read Barcode VI

Owning Palette: Instrument ReadersInstalled With: NI Vision Development Module

Reads common 1D barcode types, including Codabar, Code 39, Code 93, Code 128, EAN 8, EAN 13, Interleaved 2 of 5, MSI, UPCA, Pharmacode, and RSS Limited.

Examples

IMAQ Read Barcode

cgenclasstagrefflat.gif

Image is a reference to the source image.

ccclst.gif

ROI Descriptor is a descriptor that defines the region of interest within which the code is located. The ROI must be a rectangle or rotated rectangle with a rotation of 0 degrees. If the ROI descriptor is empty or not connected, the entire image is considered to be the region.

c1di32.gif

Global Rectangle contains the coordinates of the bounding rectangle.

c1dcclst.gif

Contours are each of the individual shapes that define an ROI.

cenum.gif

ID refers to whether the contour is the external or internal edge of an ROI.

cu32.gif

Type is the shape type of the contour.

c1di32.gif

Coordinates indicates the relative position of the contour.

cu32.gif

Barcode Type is the type of barcode to read.

Codabar (1)

Reads a Codabar barcode.

Code 39 (2)

Reads a Code 39 barcode.

Code 93 (3)

Reads a Code 93 barcode.

Code 128 (4)

Reads a Code 128 barcode.

EAN 8 (5)

Reads an EAN 8 barcode.

EAN 13 (6)

Reads an EAN 13 barcode.

Interleaved 2 of 5 (7)

Reads an Interleaved 2 or 5 barcode

MSI (8)

Reads an MSI barcode.

UPCA (9)

Reads a UPCA barcode.

Pharmacode (10)

Reads a Pharmacode barcode.

RSS Limited (11)

Reads an RSS Limited barcode.

cerrcodeclst.gif

error in (no error) describes the error status before this VI or function runs. The default is no error. If an error occurred before this VI or function runs, the VI or function passes the error in value to error out. This VI or function runs normally only if no error occurred before this VI or function runs. If an error occurs while this VI or function runs, it runs normally and sets its own error status in error out. Use the Simple Error Handler or General Error Handler VIs to display the description of the error code. Use error in and error out to check errors and to specify execution order by wiring error out from one node to error in of the next node.

cbool.gif

status is TRUE (X) if an error occurred before this VI or function ran or FALSE (checkmark) to indicate a warning or that no error occurred before this VI or function ran. The default is FALSE.

ci32.gif

code is the error or warning code. If status is TRUE, code is a nonzero error code. If status is FALSE, code is 0 or a warning code.

cstr.gif

source describes the origin of the error or warning and is, in most cases, the name of the VI or function that produced the error or warning. The default is an empty string.

cbool.gif

Validate specifies whether to validate the barcode's data. If the barcode type is Codabar, Code 39, or Interleaved 2 of 5, the error correction information is used to validate the results. For all other barcode types, either no validation is performed or the validation is performed automatically because the type requires it.

istr.gif

String is the decoded barcode data.

icclst.gif

Extra Info is a cluster that returns information about the barcode read. Extra Info contains the following elements:

istr.gif

Special Char 1 contains information about the barcode, depending on the type of barcode read.

  • Codabar—If the VI reads a Codabar barcode, this parameter returns the start character.
  • Code 128—If the VI reads a Code 128 barcode, this parameter returns the FNC character.
  • EAN 8 and EAN 13—If the VI reads an EAN 8 or EAN 13 barcode, this parameter returns the first country code.

For all other barcodes types, the value of this parameter is set to 0.

istr.gif

Special Char 2 contains information about the barcode, depending on the type of barcode read.

  • Codabar—If the VI reads a Codabar barcode, this parameter returns the stop character.
  • EAN 8 and EAN 13—If the VI reads an EAN 8 or EAN 13 barcode, this parameter returns the second country code.
  • UPCA—If the VI reads a UPCA barcode, this parameter returns the system number.

For all other barcodes types, the value of this parameter is set to 0.

isgl.gif

Confidence Level is a quality measure of the decoded barcode ranging from 0 to 1000, with 1000 being the best. This value weights the error in the widths of the bars and spaces with the size of the character in the barcode. In general, a confidence level of less than 800 means the decoded string is suspect.

Note   Confidence Level is particularly useful in decoding EAN 13 barcodes because 11 of the 12 values are encoded as characters in the barcode, and the twelfth value is encoded by the parity of the first 11 encoded characters.
iu32.gif

Barcode Type is the type of barcode read.

istr.gif

Checksum(s) is error correction information added to the encoded data that you can use to validate the decoded data. Because Checksum(s) is not part of the input data, it is not returned in the output string.

Note  Not all barcode types have checksum error correction capabilities.
Note  In many cases, the text printed below the barcode contains the encoded data, including the checksum. For example, an EAN-13 barcode can display text containing 13 numeric digits. The first 12 digits represent the actual input data and the thirteenth is the checksum.
ierrcodeclst.gif

error out contains error information. If error in indicates that an error occurred before this VI or function ran, error out contains the same error information. Otherwise, it describes the error status that this VI or function produces. Right-click the error out indicator on the front panel and select Explain Error from the shortcut menu for more information about the error.

ibool.gif

status is TRUE (X) if an error occurred or FALSE (checkmark) to indicate a warning or that no error occurred.

ii32.gif

code is the error or warning code. If status is TRUE, code is a nonzero error code. If status is FALSE, code is 0 or a warning code.

istr.gif

source describes the origin of the error or warning and is, in most cases, the name of the VI or function that produced the error or warning. The default is an empty string.

Examples

Refer to the following for examples that use this VI.

  • LabVIEW\examples\Vision\3. Applications\Barcode Example.vi

  • LabVIEW\examples\Vision\2. Functions\Image Management\Unwrap Barcode Example.vi