F_VN_ReadDotCodeRoiExp

F_VN_ReadDotCodeRoiExp 1:

Detect and interpret a DotCode within the provided image. The code should be in the image center and horizontally or vertically aligned. (expert function)
Can use available TwinCAT Job Tasks for executing parallel code regions.

Syntax

Definition:

FUNCTION F_VN_ReadDotCodeRoiExp : HRESULT
VAR_INPUT
    ipSrcImage    : ITcVnImage;
    ipDecodedData : Reference To ITcVnContainer;
    fModuleWidth  : REAL;
    ipContour     : Reference To ITcVnContainer;
    eOptions      : ULINT;
    hrPrev        : HRESULT;
END_VAR
VAR_OUTPUT
    fAngleDeg     : REAL;
END_VAR

 Inputs

Name

Type

Description

ipSrcImage

ITcVnImage

Source image (USINT elements, 1 channel)

ipDecodedData

Reference To ITcVnContainer

Returns the decoded code (ContainerType_String_SINT)

fModuleWidth

REAL

Average dot diameter of the code in the image (in pixels). Must be at least 3, preferably 5 - 8.

ipContour

Reference To ITcVnContainer

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

eOptions

ULINT

Specifies a combination of one or more ETcVnDotCodeOptions

hrPrev

HRESULT

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

 Outputs

Name

Type

Description

fAngleDeg

REAL

Returns the clockwise rotation angle in degree

 Return value

HRESULT

Weiterführende Informationen

Die Funktion F_VN_ReadDotCodeRoiExp ist die Expert-Variante von F_VN_ReadDotCodeRoi und enthält zusätzliche Parameter.

ipContour

Der Parameter ipContour gibt die Code-Eckpunkte als vier Konturpunkte vom Typ ContainerType_Vector_TcVnPoint2_DINT zurück. Dabei entsprechen die Koordinaten den Mittelpunkten der theoretischen Eckmodule des DotCode-Gitters, unabhängig davon, ob an der jeweiligen Ecke tatsächlich ein Punkt gedruckt ist. Die Kontur kann z.B. direkt mit F_VN_DrawContours gezeichnet oder mit den Funktionen zur Contour Analysis weiter analysiert werden. Dieser Parameter ist optional und kann auf 0 gesetzt werden, wenn er nicht benötigt wird.

eOptions

Der Parameter eOptions (ETcVnDotCodeOptions) definiert die Erkennungs- und Vorverarbeitungsstrategien. Die Optionen können teilweise (über eine bitweise OR-Verknüpfung) kombiniert werden. Folgende Einstellungen stehen zur Verfügung:

Required License

TC3 Vision Code Reading

System Requirements

Development environment

Target platform

PLC libraries to include

TwinCAT V3.1.4026 or later

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

Tc3_Vision