ReadDataMatrixCode

Detect and interpret a data matrix code (ECC200) within the provided image.
Can return partial results when canceled by Watchdog.

Syntax

Definition:

HRESULT ReadDataMatrixCode(
    HRESULT          hrPrev,
    ITcVnImage*      ipSrcImage,
    ITcVnContainer*& ipDecodedData,
    ITcVnContainer** pipContours = nullptr,
    LONG             nCodeNumber = 1,
    ULONG            eSearchStrategy = CSS_DEFAULT,
    ITcVnContainer** pipAngles = nullptr
)

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 or 3 channels)

ipDecodedData

ITcVnContainer*&

 

Returns the decoded code (ContainerType_Vector_String_SINT)

pipContours

ITcVnContainer**

nullptr

Returns the code positions as contours (optional, set to 0 if not required; ContainerType_Vector_Vector_TcVnPoint2_DINT)

nCodeNumber

LONG

1

Number of data matrix codes that should be detected within the provided image. (If set to -1, it tries to detect all data matrix codes.)

eSearchStrategy

ULONG

CSS_DEFAULT

Used search strategy (ETcVn2dCodeSearchStrategy)

pipAngles

ITcVnContainer**

nullptr

Returns the clockwise code rotation angles (optional, set to 0 if not required; ContainerType_Vector_REAL)

ReadDataMatrixCode 1: Return value

HRESULT

Required License

TC3 Vision Code Reading

System Requirements

Development environment

Target platform

PLC libraries to include

TwinCAT V3.1.4024.54 or later

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

Tc3_Vision