ReadIDMax

The ReadIDMax function finds and decodes 1D or 2D symbols (1D/Stacked, Data Matrix, QR Code and Postal) within a region of interest. You can configure the ReadIDMax function for a variety of symbologies, a number of results, and to handle a high degree of rotation and perspective distortion. Optionally, You can also use the ReadIDMax function to train Data Matrix and QR Code models, and verify quality metrics. You can use the ReadIDMax function to locate and decode 1D or 2D symbols.

1D Symbologies

The ReadIDMax function supports decoding multiple 1D symbologies in the same image, including:

  • Code 128
  • Code 39
  • Interleaved 2 of 5
  • Pharmacode
  • UPC/EAN
  • Code 93
  • Codabar
  • MSI
  • Code 25
  • PDF417
  • DataBar
  • DataBar Limited
  • DataBar Expanded
  • EAN.UCC Composite
  • POSTNET
  • PLANET
  • Japan Post
  • Australian Post
  • UPU
  • Intelligent Mail Barcode
Note: Training of 1D symbologies is supported, but not required.

2D Symbologies

The ReadIDMax function can locate and decode 2D symbols, including:

  • Data Matrix
  • QR Code
  • MaxiCode
  • Aztec Code
  • DotCode

The function can locate multiple 2D symbols, but unlike 1D symbols, all the symbols must be the same symbology type. For example, if the image contained a mixture of Data Matrix and QR Code symbols, and the Symbology Group parameter of the function is set to Data Matrix, the function ignores the QR Code symbols and only returns the Data Matrix symbols.

You can train the function to decode the same type of 2D symbol by:

  • Establishing the size of the symbol grid size;
  • The 2D symbology type; and
  • The error checking and correction (ECC) method the symbol uses to verify the accuracy of the data it contains.

Cognex recommends training the ReadIDMax function when the 2D symbols used in the application all share the same characteristics. Training the ReadIDMax function can improve its performance, especially when all the symbols to be decoded share the same qualities.

If the 2D symbols can vary in grid size or polarity, do not train the function, and instead allow it to consider all possible settings when decoding a 2D symbol. By not training the ReadIDMax function, it can decode a wider variety of symbols without needing to reconfigure it.

1D/2D Image Requirements

The ReadIDMax function requires minimal configuration before scanning 1D symbols, but you must consider the following requirements for input images:

  • All symbols must be greater than 50 pixels in length, while the maximum width of any module cannot exceed 10 pixels.

    Note: A module is the narrowest element of the symbol (either a space or a bar).
  • For linear symbologies (where modules have different widths, but uniform heights), a module must be at least 1.6 pixels in width and 50 pixels high. For Postal Codes (where the modules are of uniform width, but varying height), a module must be at least 2.5 pixels in width.
  • A quiet zone (an area on either end of a symbol that contains no marks) must be present and at least the minimum size specified in the print specification for the symbology type.
  • The contrast between modules and the background must be at least 32 grey levels.
  • The pixel aspect ratio can be no greater than 1.35 to 1.

2D symbols have fewer image requirements. In general, there must be a quiet zone (or margin) surrounding the symbol on all four sides that is equal to the width of one module inside the symbol itself.

IDMax® and IDQuick™

The ReadIDMax function offers two processing modes for the decoding algorithm:

  • Choose IDQuick for high-speed decoding of symbols that are well formed and appear in high contrast.
  • Choose IDMax for advanced image processing and image-analysis techniques for challenging images.

By default, the function uses IDMax. However, you can experiment with IDQuick to determine how it affects the performance of the function in the application.

Results

Only symbols that are found and decoded generate results. For each symbol in an image, the ReadIDMax function generates the following results through Vision Data Access functions:

  • The decoded string.
  • The angular orientation of the found symbol, in degrees.
  • A location (Row/Column) for the center of the symbol.
  • The particular symbology of the symbol.
  • Codes and modifiers from the ISO/IEC to uniquely identify the symbology according to industry standards.
Note: The Verify checkbox must be enabled to generate results beyond the decoded string. Use the VerifyIDCode and ValidateIDData functions to process additional verification metrics about the decoded symbol(s).

ReadIDMaxInputs

Syntax: ReadIDMax(Image,Fixture.Row,Fixture.Column,Fixture.Theta,Region.X,Region.Y,Region.High,Region.Wide,Region.Angle,Symbology Group,Maximum Results,Advanced Decode Mode,Enable Training,1D Symbologies.Code 128,1D Symbologies.Code 39,1D Symbologies.I2of5,1D Symbologies.Pharmacode,1D Symbologies.UPC/EAN,1D Symbologies.Code 93,1D Symbologies.Codabar,Stacked Symbologies.PDF 417,Stacked Symbologies.DataBar,Stacked Symbologies.DataBar Limited,Stacked Symbologies.DataBar Expanded,Stacked Symbologies.EAN.UCC Composite,Postal Symbologies.POSTNET,Postal Symbologies.PLANET,Postal Symbologies.Japan Post,Postal Symbologies.Australia Post,Postal Symbologies.UPU,Postal Symbologies.Intelligent Mail Barcode,Decode Settings.Perspective,Decode Settings.QRMode,Decode Settings.Ignore Polarity,Decode Settings.Allow Flexible Grid Size,Decode Settings.Symbol Damage,Decode Settings.Checksum,DecodeSettings.Polarity,Decode Settings.Omnidirectional,DecodeSettings.Sort Mode,Decode Settings.Allow Identical 1D Symbols,Decode Settings.Expand UPC-E,Decode Settings.Rectangular Extension,Decode Settings.Minimum Decodes Before Output,Verify,Timeout,Show)

Note: The ReadIDMax function does display updated results in the spreadsheet when the property sheet is open. To view the affect of updating parameter values, press the OK button to accept the changes and close the property sheet.
Parameter Description

Image

This parameter must reference a spreadsheet cell that contains an Image data structure. By default, this parameter references A0, the cell containing the AcquireImage Image data structure. This parameter can also reference other Image data structures, such as those returned by the Vision Tool Image functions. For more information, see AcquireImage and Image.

Note: If using a color vision system, the function must reference an Image function (for example, ColorToGreyscaleFilter), which converts the color image to greyscale.

Fixture

Defines the Region of Interest (ROI) relative to a Fixture input or the output of a Vision Tool function's image coordinate system. Setting the ROI relative to a Fixture ensures that if the Fixture is rotated or translated, the ROI will be rotated or translated in relation to the Fixture. For more information, see Fixture and Vision Tools Functions.

The default setting is (0,0,0), the top leftmost corner of the image.

Row

The row offset, in image coordinates.

Column

The column offset, in image coordinates.

Theta

The angle of orientation, in the image coordinate system.

Region

The Region of Interest (ROI) specifies the region of the image that undergoes analysis and creates a rectangular image region that can be transformed and rotated. For more information, see Interactive Graphics Mode.

Tip: With this parameter selected, you can press the Maximize Region button on the property sheet's toolbar to maximize the region and cover the entire image.

X

The x-offset of the origin, in fixture coordinates.

Y

The y-offset of the origin, in fixture coordinates.

High

The dimension along the region's x-axis.

Note: The ReadIDMax function supports a maximum region size based on the selected symbol. For more information, see 1D and 2D Symbology - Maximum Region of Interest. If either the High or Wide parameters are set to a larger value, the function returns #ERR.

Wide

The dimension along the region's y-axis.

Note: The ReadIDMax function supports a maximum region size based on the selected symbol. For more information, see 1D and 2D Symbology - Maximum Region of Interest. If either the High or Wide parameters are set to a larger value, the function returns #ERR.

Angle

The orientation, in fixture coordinates.

Symbology Group

Specifies one of the symbology groups to read.

1D/Stacked (default)

Selects 1D and Stacked Code reading.

Data Matrix

Selects Data Matrix reading.

QR Code

Selects QR Code reading.

Postal

Selects Postal Code reading.

MaxiCode Selects MaxiCode reading.
Aztec Code Selects Aztec Code reading.
DotCode Selects DotCode reading.

Maximum Results

Specifies the maximum number of symbols to be located and decoded (1 to 128; default = 1).

Note: If this parameter's specified value exceeds the number of symbols in the ROI , the function continues to search for the specified number of symbols. If the number of symbols in the ROI varies, the execution time of the function can be reduced by lowering the Timeout parameter setting.

Advanced Decode Mode

Specifies the setting used to decode Data Matrix or 1D/Stacked symbology groups.

IDMax (default)

Uses advanced image processing and image analysis techniques to ensure the highest yield on difficult 1D codes (for example, symbols with low contrast, severe damage, low pixels per module, etc.) or challenging 2D DPM codes produced by laser, dot peen, ECE and Ink Jet technologies.

IDQuick

Provides high-speed decoding of symbols that are well formed and appear in high contrast.

Enable Training

When enabled, trains a model of the first symbol read. Training the function may improve performance, especially when all the symbols to be decoded share similar characteristics.

Trained information is retained until this checkbox is disabled. To retrain a symbol, disable the checkbox, then enable the checkbox again.

Tip: It is recommended to have only one symbol in the Region when training is enabled.

Off (default)

Do not train a model.

On

Train a model of the first symbol read.

1D Symbologies

Specifies which 1D Symbologies to read (multiple symbologies can be selected and read).

Code 128

Selects Code 128 reading. Code 128 is a very high-density alphanumeric symbology which can be scanned bidirectionally. The symbology can encode the entire 128 ASCII character set plus four non-data characters. A symbol using Code 128 symbology encodes each character using 11 black or white modules, and each symbol includes a checksum character.

Code 39

Selects Code 39 reading. Code 39 (also called USS Code 39, BC39 and/or Code 3 of 9) is a widely-used symbology developed for use in non-retail environments, and can encode both letters, digits, and special characters such as " % " and " / ". A symbol using Code 39 symbology encodes each character using 5 bars and 4 spaces for a total of 9 elements, and 3 out of the 9 elements are always wide. The symbol can include a checksum character for error detection.

Interleaved 2 of 5

Selects Interleaved 2 of 5 reading. Popular in warehouse applications, Interleaved 2 of 5 (also called I2of5, I-2/5 or ITF) is a variable-length, numeric-only code. A symbol using Interleaved 2 of 5 symbology encodes 2 characters in a unit of 5 bars and spaces, where the even position character is encoded into bars while the odd position character is encoded into spaces. The Interleaved 2 of 5 symbology can only encode data with an even number length. The symbol can include a checksum character for error detection.

Pharmacode

Selects Pharmacode reading. Pharmacode is used in the pharmaceutical industry as a packing control system.

UPC/EAN

Selects UPC (Universal Product Code) and EAN (European Article Numbering) reading. UPC is a fixed-length, numeric-only symbology which can be scanned bidirectionally. The size for a UPC symbol can vary to accommodate various printing processes, but the code works best when the height of the symbol exceeds its width. European companies use the generally equivalent EAN system.

UPC supports Version A (Regular version) and Version E (Zero-suppression version) UPC barcodes, as well as two- and five-character supplemental encodations. EAN supports EAN-8 and EAN-13 barcodes, as well as two- and five-character supplemental encodations.

Code 93

Selects Code 93 reading. Code 93 encodes the same characters as Code 39, but uses nine bar code elements per character instead of 15.

Codabar

Selects Codabar (also known as USD-4 and Code 2 of 7) reading. Codabar is an older symbology that encodes digits.

MSI

Selects MSI (also known as Modified Plessey) reading. The symbology encodes digits 0 - 9. The symbol can include a checksum character for error detection.

Code 25 Selects Code 25 (also known as Code 2 of 5) reading. The symbology encodes digits 0 - 9. The symbol can include a checksum character for error detection.

Stacked Symbologies

Specifies which Stacked Symbologies to read (multiple symbologies can be selected and read).

PDF 417

Selects PDF417 reading. PDF417 is a stacked linear barcode symbol format used in a variety of applications, primarily transport, identification cards, and inventory management.

DataBar

Selects DataBar reading (previously referred to as RSS, and also known as GS1 DataBar). DataBar symbols can identify small items and carry more information than the current EAN/UPC bar code.

DataBar Limited

Selects DataBar Limited reading (also known as GS1 DataBar Limited).

DataBar Expanded

Selects DataBar Expanded reading (also known as GS1 DataBar Expanded).

EAN.UCC
Composite

Selects EAN.UCC Composite reading. When enabled, a composite code (a 1D code with a 2D component) can be decoded. The 1D codes that the EAN.UCC can be used with are DataBar and Code 128.

Postal Symbologies

Specifies which Stacked Symbologies to read (multiple symbologies can be selected and read).

POSTNET

Selects POSTNET reading. The Postal Numeric Encoding Technique (POSTNET) barcode was invented by the US Postal Office to encode ZIP Code information. A barcode using the POSTNET symbology encodes each numeric character using a combination of 5 bars, either short or long. A POSTNET barcode can contain a 5-digit ZIP Code, a 5-digit ZIP + 4 Code, or an 11-digit delivery point code. The symbol always includes a checksum character.

PLANET

Selects PLANET reading. The PLANET barcode is the inverse of the POSTNET barcode, using short bars where the POSTNET symbology uses long bars and long bars where the POSTNET symbology uses short bars. The US Postal Office uses PLANET barcodes to track pieces of mail. A PLANET barcode can have up to 12 digits.

Japan Post

Selects Japan Post reading.

Australia Post

Selects Australia Post reading. Also known as a 4-State Customer Barcode, it is an alphanumeric symbology adopted by the Australian Post. A barcode using the 4-State symbology encodes each character using 4 different types of bars, each of which has a distinct name and value. A 4-State barcode can be generated in one of three different structures of 37 bars (standard), 52 bars, or 67 bars. The ReadIDMax function supports the Australian, Japan Post, UPU and USPS versions of the 4-state symbology.

UPU

Selects UPU reading.

Intelligent Mail
Barcode

Selects Intelligent Mail Barcode reading. Also known as the IM barcode, this is a 65 bar code for use on mail in the United States.

Decode Settings

Perspective

Specifies the decoding of Data Matrix and QR Code symbols with perspective distortion and optionally trains Data Matrix symbols for a known perspective distortion.

  • No perspective: Decodes Data Matrix symbols that have no perspective distortion.
  • Perspective (default): Decodes Data Matrix and QR Code symbols with perspective distortion. The perspective distortion is estimated independently during model training and read time.
  • Train perspective: Decodes Data Matrix symbols with a known perspective distortion. The perspective is trained, then at read time, the symbol is searched in a space where the perspective distortion in the input image is compensated, using the trained attributes. This option requires that the run time symbols placed on the same plane as that of the trained symbol. This option provides the ability to decode severely damaged symbols, with known perspective distortion.

    Tip: When mounting the vision system, it is recommended that the angle of incidence (the angle between the optical axis of the sensor and the normal vector of the plane on which the symbol is presented) be no more than 40 degrees, and the resolution of the symbol be at least 5 pixels per cell.
  • Severe perspective: Decodes Data Matrix symbols with severe perspective distortion at read time.

QR Mode

Specifies the type of QR Code to read:

  • QR Model 1
  • QR Model 2
  • QR Models 1 and 2
  • Micro QR
  • Micro QR and QR Model 1
  • Micro QR and QR Model 2
  • All QR Modes (default)

Ignore Polarity

Specifies whether or not to read Data Matrix symbols where the polarity is inverted, with respect to the trained symbol.

Note: This parameter is only valid if the Enable Training parameter is On.
  • Off (default): Do not allow inverted polarity from the trained model.
  • On: Allow inverted polarity from the trained model.

Allow Flexible
Grid Size

Specifies whether or not to read Data Matrix and QR Code symbols of a different grid size, with respect to the trained symbol.

Note: This parameter is only valid if the Enable Training parameter is On.
  • Off (default): Only allow symbols to be read that are the same grid size as the trained symbol.
  • On: Allow symbols to be read that are not the same grid size as the trained symbol.
Symbol Damage

Allows reading of low-quality Data Matrix and QR symbols, including symbols with damage to their quiet zones, finder patterns and clocking patterns.

  • Moderate (default): Enables 2DMax® to allow reading of low-quality symbols that have undergone normal wear.
  • Extreme: Enables 2DMax and PowerGrid® to allow reading of low-quality symbols with damage to their quiet zones, finder patterns and clocking patterns, due to occlusion or wear.

    Note:
    • For the Extreme Symbol Damage option to work properly, you must first train on a good, non-damaged code.
    • When logged on to an In-Sight emulator, the Extreme Symbol Damage option is available but functions the same as the Moderate Symbol Damage option. Extreme Symbol Damage only works on supported vision systems.

Checksum

Specifies whether the symbol is validated to ensure reliability using an error-detection algorithm. Checksum only applies to symbols with optional checksum algorithms included in the symbol; each symbol has its own unique checksum algorithm. The type of checksum that is used depends on the code type selected.

  • OFF (default): Do not verify checksum.
  • ON: Requires checksum to pass.
Note: Code 128, Code93, DataBar, UPC and EAN barcodes are validated with a checksum regardless of the parameter selection. If Checksumis enabled for any other barcode and no checksum is encoded, the read will fail.

Polarity

Specifies the color of the symbols.

  • Black: The symbol is darker than the background.
  • White: The symbol is lighter than the background.
  • Auto (default): The function automatically selects the polarity of the symbol.

Omnidirectional

Specifies the direction that scan lines are projected within the Region in order to detect all of the elements in the barcode. An element refers to either a bar or space in a barcode. At least one scan line must project across every element of the barcode for a successful decode. For more information, see Scan Lines.

  • 0 = OFF (default): Scan lines are projected in one direction to detect a barcode parallel to the Region.
  • 1 = ON: Scan lines are projected at various angles to detect a barcode that is rotated relative to the Region.
Note: PharmaCode barcodes will not decode correctly if rotated over 90° from the angle of the Region.

Sort Mode

Specifies the order results are returned.

Note: For accurate sorting of symbols, the Maximum Results parameter must be set to a value that is equal to or greater than the number of symbols contained in the image.
  • None (default): Sorts by first decoded results. Any undecoded results will follow decoded results.
  • Top Down: Sorts in ascending Row order.
  • Left To Right: Sorts in ascending Column order
  • Alphabetical: Sorts the results alphabetically.
  • String Length: Sorts the results by string length (shortest to longest).
  • Rows: Sorts the results by grouping the symbols into rows, and then sorting them from left-to-right within each row. When sorting by Rows, two symbols are considered part of the same Row if the center of one symbol overlaps vertically with any part of the other symbol.
  • Columns: Sorts the results by grouping the symbols into columns and then sorting them from top-to-bottom within each column. When sorting by Columns, two symbols are considered part of the same Column if the center of one overlaps horizontally with any part of the other symbol.

Allow Identical 1D Symbols

Specifies if the function should decode all symbols within the region even if they are identical. Two symbols are considered identical if they have the same length, symbology type and decoded string.

  • OFF (default): Only return one result if multiple symbols are decoded.
  • ON: Return all results, even if they are identical.
Expand UPC-E

Specifies whether the decoded 1D/Stacked symbol returns the 6-digit UPC-E string or the expanded 11-digit UPC-A equivalent string.

  • OFF: The decoded symbol returns the 6-digit UPC-E string.
  • ON (default): The decoded symbol returns the expanded 11-digit UPC-A equivalent string.
Note: The Expand UPC-E parameter is only supported on In-Sight Micro 1000 series, In-Sight 5000 series and In-Sight 70xx - 74xx series vision systems with firmware version 4.10.1 and higher.
Rectangular Extension

Specifies whether the Data Matrix symbol to be decoded uses the Data Matrix Rectangular Extension (DMRE), for symbols used in applications with high data density and limited vertical space available for marking the code.

  • OFF (default): Rectangular extension format is not considered when decoding the Data Matrix symbol.
  • On: Rectangular extension format is considered when decoding the Data Matrix symbol.

    Note: Standard Data Matrix symbols can still be decoded when Rectangular Extension is enabled.
Minimum Decodes Before Output Specifies the number of matching decodes for a successful read of the 1D symbol (1 to 5; default = 2). Only modify this value if you frequently encounter problems such as misreads. If you increase this value, it may help to prevent misreads, but at a slower speed and a decreased chance of reading degraded codes (due to damage, noise, blur, etc.). If you decrease this value, it allows for more aggressive reads but increases the chance of a misread.

Verify

Specifies whether the print quality tests (also known as quality verification metrics) are performed. For more information, see ID.

  • OFF (default): Do not test quality.
  • ON: Test quality and display the results in the spreadsheet.
Note:
  • If the string cannot be decoded, #ERR is returned for all results that are automatically inserted into the spreadsheet.
  • All code types except PDF 417, Pharma code and DataBar support quality verification metrics. The EAN.UCC Composite code type supports verification metrics for the linear 1D symbol portion, but not the 2D portion.

Timeout

Specifies the amount of time, in milliseconds (0 to 30000), to search for a valid ID symbol before execution is halted and #ERR is returned. Setting the value to 0 disables the setting and a timeout is not applied.

Note: At times, the ReadIDMax function may exceed the specified Timeout parameter value by varying percentages. If this happens, adjust the Timeout parameter value lower to compensate for the overage.

Show

Specifies the display mode for the ReadIDMax graphical overlay on the image.

Note: The Show parameter is only implemented for Data Matrix and QR Code symbols.

Hide all (default)

The input region boundary is hidden, except when the cell containing the ReadIDMax function is highlighted in the spreadsheet.

Result graphics only

The result graphics (boxes for DataMatrix and QR Code) are displayed at all times.

Input and result graphics

The input graphics and result graphics are displayed at all times.

ReadIDMax Outputs

Returns

An IDMax data structure containing the decoded alphanumeric string, or #ERR if any of the input parameters are invalid.

Results

When the function is initially inserted into a cell, a result table is inserted in the spreadsheet. The number of indexed strings returned in the result table is equal to the value entered in the Maximum Results parameter. If no symbol can be located and decoded, #ERR is returned.

ReadIDMaxVision Data Access Functions

The number of Vision Data Access functions automatically added to the spreadsheet vary depending on the Maximum Results setting and whether the Verify checkbox is enabled. By default, the Maximum Results parameter is configured to locate and decode one symbol and the Verify checkbox is disabled. In this case, when the ReadIDMax function is initially created, a single Vision Data Access function is automatically inserted into the spreadsheet:

String

GetString(IDMax, [Index])

Returns the alphanumeric string encoded in the indexed symbol.

When the ReadIDMax function is initially created:

  • If the Maximum Results are configured to locate and decode more than one symbol, additional IDMax Vision Data Access functions are automatically inserted into the spreadsheet.
  • If the Verify checkbox is enabled, the function performs additional quality verification metrics, and additional Vision Data Access functions are automatically inserted into the spreadsheet. The functions that are inserted vary based on the selected Symbology Group.

Additional data elements can also be accessed using the ReadIDMax Vision Data Access functions. For more information, see IDMax.

Note:
  • If the Maximum Results are increased or the Verify checkbox is enabled after the ReadIDMax function is initially created, the additional Vision Data Access functions are not automatically inserted into the spreadsheet. In addition, the Verify checkbox must be enabled before the additional Vision Data Access functions can execute in the spreadsheet.
  • For Data Matrix symbols, the base 256 latch character (Decimal 231 Hex E7) causes encoded data to be processed as bytes, per the Data Matrix ISO/IEC 16022 specification. Use the GetString IDMax function to return the encoded data. For more information, see IDMax.