F_VN_ReadDataMatrixCodeRoi
Detect and interpret a data matrix code (ECC200) within the provided image. The code should be in the image center.
Can use available TwinCAT Job Tasks for executing parallel code regions.
Syntax
Definition:
FUNCTION F_VN_ReadDataMatrixCodeRoi : 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 | Source image (USINT elements, 1 channel) | |
ipDecodedData | Reference To ITcVnContainer | Returns the decoded code (ContainerType_String_SINT) |
fModuleWidth | REAL | Minimum module width of the code in the image (in pixels). Must be at least 3, preferably 5 - 8. |
hrPrev | 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 |
Weiterführende Informationen
Die Funktion F_VN_ReadDataMatrixCodeRoi
ist für die Erkennung eines einzelnen Data Matrix Codes (ECC200) innerhalb eines definierten Bildbereiches optimiert. Dafür nutzt die Funktion einen angepassten Algorithmus, der eine zentrierte Positionierung des Codes im übergebenen Bild voraussetzt.
fModuleWidth
Der Parameter fModuleWidth
definiert die minimal erwartete Modulbreite des zu lesenden Data Matrix Codes in Pixeln. Ein Modul entspricht einem schwarzen bzw. weißen Quadrat des Codes. Weicht die Modulgröße im Bild stärker davon ab, kann dies zu einer erhöhten Rechenzeit oder keinem Ergebnis führen.
Required License
TC3 Vision Code Reading
System Requirements
Development environment | Target platform | PLC libraries to include |
---|---|---|
TwinCAT V3.1.4024.59 or later | PC or CX (x64) with min. PL50, e.g. Intel 4-core Atom CPU | Tc3_Vision |