ReadDataMatrixCodeRoi

Detect and interpret a data matrix code (ECC200) within the provided image. The code should be in the image center.
Can use available TwinCAT Job Tasks for executing parallel code regions.

Syntax

Definition:

HRESULT ReadDataMatrixCodeRoi(
    HRESULT          hrPrev,
    ITcVnImage*      ipSrcImage,
    ITcVnContainer*& ipDecodedData,
    float            fModuleWidth,
    float&           fAngleDeg,
    ITcVnContainer** pipContour = nullptr,
    ULONGLONG        eOptions = DMO_DEFAULT,
    unsigned char    nRows = 0,
    unsigned char    nCols = 0,
    bool             bExtensiveSearch = true
)

Parameters

Name

Type

Default

Description

hrPrev

HRESULT

 

HRESULT indicating the result of previous operations (If SUCCEEDED(hrPrev) equals false, no operation is executed.)

ipSrcImage

ITcVnImage*

 

Source image (USINT elements, 1 channel)

ipDecodedData

ITcVnContainer*&

 

Returns the decoded code (ContainerType_String_SINT)

fModuleWidth

float

 

Minimum module width of the code in the image (in pixels). Must be at least 3, preferably 5 - 8.

fAngleDeg

float&

 

Returns the clockwise rotation angle in degree

pipContour

ITcVnContainer**

nullptr

Returns the contour of the detected code (ContainerType_Vector_TcVnPoint2_DINT; optional, set to 0 if not required)

eOptions

ULONGLONG

DMO_DEFAULT

Specifies a combination of one or more ETcVnDataMatrixOptions

nRows

unsigned char

0

Specifies the number of code module rows, including the finder and clock pattern, excluding the quiet zone (8 - 144; set to 0 to search for any size)

nCols

unsigned char

0

Specifies the number of code module columns, including the finder and clock pattern, excluding the quiet zone (10 - 144; set to 0 to search for any size)

bExtensiveSearch

bool

true

If true, tries different approaches if the specified options fail

ReadDataMatrixCodeRoi 1: Return value

HRESULT

Required License

TC3 Vision Code Reading

System Requirements

Development environment

Target platform

PLC libraries to include

TwinCAT V3.1.4024.59 or later

PC or CX (x64) with min. PL50, e.g. Intel 4-core Atom CPU

Tc3_Vision