F_VN_ReadDotCodeRoi

F_VN_ReadDotCodeRoi 1:

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

Syntax

Definition:

FUNCTION F_VN_ReadDotCodeRoi : HRESULT
VAR_INPUT
    ipSrcImage    : ITcVnImage;
    ipDecodedData : Reference To ITcVnContainer;
    fModuleWidth  : REAL;
    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.

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

Further information

The F_VN_ReadDotCodeRoi function searches for a single DotCode within a defined region of interest (ROI) and decodes it. This requires that the code be centered within the provided image.

fModuleWidth

The fModuleWidth parameter defines the expected average diameter of the individual DotCode modules (dots) in pixels. The module size must be at least 3 pixels, whereby 5 to 8 pixels are recommended for optimum and reliable results. Significant deviations from the parameterized value can lead to increased processing time or no result.

Rotation angle (Return value)

The return value fAngleDeg returns the clockwise rotation angle.

Required License

TC3 Vision Code Reading