F_VN_ReadQRCodeExp

F_VN_ReadQRCodeExp 1:

Detect and interpret a QR code within the provided image. Can be canceled by Watchdog.

Syntax

Definition:

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

F_VN_ReadQRCodeExp 2: Inputs

Name

Type

Description

ipSrcImage

ITcVnImage

Source image (USINT elements, 1 channel or 3 channel (3 channel input is expected to be RGB and internally converted to Gray))

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 QR codes that should be detected within the provided image (currently only 1 supported).

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_ReadQRCodeExp 3: Return value

HRESULT

Further information

Notice

Floating point exceptions

This function can unnecessarily cause errors if the option Floating point exceptions of the executing PLC task is active. Therefore, deactivate this option.

The function F_VN_ReadQRCodeExp corresponds to the function F_VN_ReadQRCode, extended by the following parameters.

ipContour

The parameter ipContour returns the code position that is found as a contour.

nCodeNumber

The parameter nCodeNumber defines how many codes to search for.

F_VN_ReadQRCodeExp 4:

Searching for more than one QR code not currently supported

Searching for several QR codes in one image is currently not supported. The parameter nCodeNumber therefore has to be set to 1.

eSearchStrategy

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

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