F_VN_ReadDataMatrixCodeExp

F_VN_ReadDataMatrixCodeExp 1:

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

Syntax

Definition:

FUNCTION F_VN_ReadDataMatrixCodeExp : HRESULT
VAR_INPUT
    ipSrcImage      : ITcVnImage;
    ipDecodedData   : Reference To ITcVnContainer;
    ipContours      : Reference To ITcVnContainer;
    nCodeNumber     : DINT;
    eSearchStrategy : UDINT;
    hrPrev          : HRESULT;
END_VAR

F_VN_ReadDataMatrixCodeExp 2: Inputs

Name

Type

Description

ipSrcImage

ITcVnImage

Source image (USINT elements, 1 or 3 channels)

ipDecodedData

Reference To ITcVnContainer

Returns the decoded code (ContainerType_Vector_String_SINT)

ipContours

Reference To ITcVnContainer

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

nCodeNumber

DINT

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

UDINT

Used search strategy (ETcVn2dCodeSearchStrategy)

hrPrev

HRESULT

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

F_VN_ReadDataMatrixCodeExp 3: Return value

HRESULT

Further information

The function F_VN_ReadDataMatrixCodeExp corresponds to the function F_VN_ReadDataMatrixCode extended by the following parameters.

ipContours

The parameter ipContour returns the code positions that are found as a contour.

nCodeNumber

The parameter nCodeNumber defines how many codes to search for. At -1 the search continues until no further code is found in the image or a watchdog aborts the function.

eSearchStrategy

The parameter eSearchStrategy defines the search strategies for the code search. The standard option TCVN_CSS_DEFAULT leads to the search strategy TCVN_CSS_FIRST_NOT_FLIPPED. For a description of the search strategies see Code Reading search strategies.

F_VN_ReadDataMatrixCodeExp 4:

Search strategies

Currently, this function only supports the settings of the search strategy for mirroring. Inversion is always performed automatically if not all expected codes are found in the original image.

Samples

Related functions

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