NI Vision for LabVIEW

IMAQ Read Barcode 2 VI

Owning Palette: Instrument Readers
Requires: 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 (GS1 DataBar Limited). For more information, see 2D Code Regeneration Concepts.

Tip  It is recommended that you disable the Pharmacode barcodes unless you are specifically decoding barcodes of this type. Pharmacodes are simple, and many barcodes can be mistaken for this type.
Tip  When using multiple barcodes that include Code 39, Code 93, or Interleaved 2 of 5, it is recommended that you set the Validate parameter to FALSE (unchecked).

Examples

Supported Image Types

8-bit unsigned grayscale 16-bit unsigned grayscale 32-bit RGB 16-bit signed grayscale 64-bit RGB floating point grayscale 32-bit HSL

IMAQ Read Barcode 2

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.

cgenclasstagrefflat.gif

Image is a reference to the source image.

ccclst.gif

Barcode Search Options is a cluster that contains the barcode search options to use when searching for barcodes in the image.

cu32.gif

Min Bar Width is minimum bar width of the barcode in the image, in pixels. The VI relies on this parameter to determine barcode characteristics to locate the barcode in the image.

cu32.gif

Min Edge Strength specifies the minimum difference in intensity values to allow between the edge of a barcode and its surroundings. A lower value helps locate low-contrast barcodes. A higher value helps remove noise.

cu32.gif

Min Bars is the minimum number of bars required in the barcode to be qualified for reading.

cbool.gif

Skip Location Search?, if TRUE, specifies that the VI should assume that the barcode code occupies most of the image or the search region. The VI skips the location phase, moving immediately to extraction and decoding. If FALSE (default), the VI does not make any assumptions about the percentage of the image occupied by the barcode.

c1du32.gif

Barcode Types To Search is an array of Barcode types to search in the image.

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 (GS1 DataBar Limited) barcode.

cu32.gif

Num of Required Barcodes defines the number of barcodes to be read from the image. The default is 1.

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.

ccclst.gif

Barcode Grading Options provides options for Barcode Grading

cbool.gif

Calculate Grading Report is a boolean that decides if grading report should be generated or not. The default value is False.

ci32.gif

Scan Width specifies the aperture/width of the proble to use while scanning the barcode to calculate the grading report. The default width is 1.

igenclasstagrefflat.gif

Image (duplicate) is the reference to the image that contains the barcode.

i1dcclst.gif

Barcodes contains the information about the barcode that was read.

istr.gif

Data is the decoded barcode data.

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.

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.
iu32.gif

Barcode Type is the type of barcode read.

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.
i1dnclst.gif

Bounding Box is an array of points that define the boundary of the code in the image.

isgl.gif

x is the x-coordinate of the point.

isgl.gif

y is the y-coordinate of the point.

iu32.gif

Num of Barcodes outputs the number of barcodes that were read.

i1dcclst.gif

Barcode ANSI/CEN/ISO Grading Report is a cluster detailing the grading information of the barcode. It has 9 grades and 1 overall grade. All the grades displayed are the average of the grades over ten scan lines across the barcode, as recommended by the ANSI/CEN/ISO Bar Code Print Quality standard.

Note  

For more information about barcode grading, refer to The Layman's Guide to ANSI, CEN and ISO/IEC Linear Bar Code Print Quality Documents. This document is available free online.

istr.gif

Overall Grade provides the overall grade (A, B, C, D or F) of the barcode. For each scan line, an overall scan grade is calculated as the lowest of all the other eight grades (not including the quiet zone). The Overall Grade displayed is the average of these ten scan grades.

istr.gif

Edge Determination Grade specifies if there are enough elements (bars and spaces) present in the barcode for it to be decoded. It is either A (pass) or F (fail). Excessive bar growth (ink spread) or weak printing of narrow bars can result in an F grade.

istr.gif

Minimum Reflectance Grade is the letter grade assigned to a barcode based on the minimum reflectance score, which is the ratio of the intensity of the darkest bar to the lightest space. The darkest bar must have intensity less than or equal to half of the space. For example, if the highest intensity value of the spaces is 80%, the intensity value of at least one bar must be 40% or less. The grade is either A (pass) or F (fail).

istr.gif

Minimum Edge Contrast Grade is the letter grade assigned to a barcode based on the minimum edge contrast score, which is the lowest contrast in any edge (transition from bar to space and vice versa). The grade is either A (pass) or F (Fail). Incorrect bar color or background color and unfocused print will yield a low grade.

istr.gif

Symbol Contrast Grade is the letter grade assigned to a barcode based on the symbol contrast score, which is the difference between the intensity of the darkest bar and lightest space of the barcode. The grade varies from A to F. Low contrast means either the bars are too light or the background is too dark or both.

istr.gif

Modulation Grade is the letter grade assigned to a barcode based on the modulation score, which is the ratio of Min Edge Contrast score and the Symbol Contrast Score. It measures the uniformity of the intensity of the bars and spaces in the barcode. The grade varies from A to F. Press gain or undesirable bar widening causes a low Modulation grade.

istr.gif

Defects Grade is the letter grade assigned to a barcode based on the amount of noise present in the barcode. The noise can exist as white gaps on the bars (less ink) and dark gaps on spaces (dirt). The grade varies from A to F.

istr.gif

Decode Grade is the letter grade assigned to a barcode based on the success of the VI in decoding/reading the barcode. The grade is A if the barcode is decoded, otherwise it is F.

istr.gif

Decodability Grade is the letter grade assigned to a barcode based on its decodability score, which is the measure of the accuracy of the printed bar code against the appropriate reference decode algorithm. The theoretical bar widths are compared with the actual bar widths obtained from the barcode to calculate the deviation and higher this deviation, the lower the grade. The grade varies from A to F. Uneven scanning, press gain or bar widening and bars with blurred and uneven edges lead to low decodability grades.

istr.gif

Quiet Zone is the letter grade that specifies if the quiet zone is present (A) or absent (F). Scanners require a quiet zone to the left and right of the barcode symbol to be able to successfully decode the barcode. This area must be clear of all text or graphics. The quiet zone dimension requirements vary according to the type of the barcode.

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\Barcode\Read 1D Barcode.vi

  • LabVIEW\examples\Vision\Image Management\Unwrap Barcode.vi

Was this information helpful?

Log in to get a better experience