ReadBarcode (Exp)

Detect and interpret a 1d barcode within the provided image. Can be canceled by Watchdog.

Syntax

Definition:

HRESULT ReadBarcode(
    HRESULT                     hrPrev,
    ITcVnImage*                 ipSrcImage,
    ITcVnContainer*&            ipDecodedData,
    ITcVnContainer*&            ipContours,
    ULONG                       eBarcodeType,
    LONG                        nCodeNumber,
    ETcVnBarcodeSearchDirection eSearchDirection,
    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 (USINT elements, 1 channel or 3 channel (3 channel input is expected to be RGB and internally converted to Gray))

ipDecodedData

ITcVnContainer*&

 

Returns the decoded code (ContainerType_Vector_String_SINT)

ipContours

ITcVnContainer*&

 

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

eBarcodeType

ULONG

 

Types of barcode to search for (ETcVnBarcodeType)

nCodeNumber

LONG

 

Number of 1d barcode that should be detected within the provided image (currently only 1 supported).

eSearchDirection

ETcVnBarcodeSearchDirection

 

Barcode search direction.

pipAngles

ITcVnContainer**

nullptr

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

ReadBarcode (Exp) 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