ReadPharmaCode

Detect and interpret a pharma code within the provided image. Can be canceled by Watchdog.
Can use available TwinCAT Job Tasks for executing parallel code regions.

Syntax

Definition:

HRESULT ReadPharmaCode(
    HRESULT          hrPrev,
    ITcVnImage*      ipSrcImage,
    ITcVnContainer*& ipDecodedData,
    ITcVnContainer** pipContours = nullptr,
    LONG             nCodeNumber = 1,
    SHORT            nMinBarNumber = 4,
    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 (1 channel (all element types) or 3 channel with elements of type TCVN_ET_USINT, TCVN_ET_UINT or TCVN_ET_REAL (3 channel input is expected to be RGB and internally converted to Gray))

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

nMinBarNumber

SHORT

4

Minimal number of (dark) bars that codes must have.

pipAngles

ITcVnContainer**

nullptr

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

ReadPharmaCode 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