imaqReadBarcode

NI Vision for LabWindows/CVI Function

imaqReadBarcode

Usage

BarcodeInfo* imaqReadBarcode(const Image* image, BarcodeType type, const ROI* roi, int validate);

Purpose

Reads a barcode from an image.

Image Types Supported

IMAQ_IMAGE_U8, IMAQ_IMAGE_I16, IMAQ_IMAGE_SGL

Parameters

Name

Type

Description

image const Image* The image containing the barcode to read.
type BarcodeType The type of the barcode to read.
roi const ROI* A region of interest specifying the location of the barcode in the image. The first contour of roi must be a rectangle. Set this parameter to NULL to use the entire image.
validate int If type is IMAQ_I2_OF_5, IMAQ_CODE39, or IMAQ_CODABAR, set validate to TRUE to use the error correction information of the barcode to validate the data. If type is not IMAQ_I2_OF_5, IMAQ_CODE39, or IMAQ_CODABAR, or if you set validate to FALSE, the function does not validate the data.

Return Value

Type

Description

BarcodeInfo* On success, this function returns a structure containing information about the barcode. On failure, this function returns NULL. To get extended error information, call imaqGetLastError(). When you are finished with this structure, dispose of it by calling imaqDispose().