FB_VN_WriteRegister_ULINT

FB_VN_WriteRegister_ULINT 1:

This FB writes a ULINT value into a register on the camera. Requires an open control channel (e.g. by calling FB_VN_GevCameraControl.OpenCamera() before)

Syntax

Definition:

FUNCTION_BLOCK FB_VN_WriteRegister_ULINT
VAR_INPUT
    nAddress                 : GVCP_REGISTER_ADDRESS;
    nValue                   : ULINT;
    nEndian                  : UINT;
    bWrite                   : BOOL;
    nTimeout                 : TIME;
END_VAR
VAR_OUTPUT
    bBusy                    : BOOL;
    bError                   : BOOL;
    nErrorId                 : UDINT;
END_VAR
VAR
    oidITcVnGevImageProvider : OTCID;
END_VAR

FB_VN_WriteRegister_ULINT 2: Inputs

Name

Type

Default

Description

nAddress

GVCP_REGISTER_ADDRESS

 

The address of the register that should be written

nValue

ULINT

 

The value to write

nEndian

UINT

 

OPTIONAL: The endianness of the register. 0 = Big, 1 = Little. Default: 0

bWrite

BOOL

 

Writing the register is triggered by a rising edge at this input.

nTimeout

TIME

VISION_ADS_TIMEOUT

Indicates the time before the function is cancelled.

FB_VN_WriteRegister_ULINT 3: Outputs

Name

Type

Description

bBusy

BOOL

This output remains TRUE until the function block has executed a command, but at the longest for the duration supplied to the 'nTimeout' input. While bBusy = TRUE, no new command will be accepted at the inputs.

bError

BOOL

This output is switched to TRUE as soon as an error occurs during the execution of a command. The command-specific error code is contained in ‘nErrorId’. If the function block has a timeout error, 'bError' is TRUE and 'nErrorId' is 1861 (hexadecimal 0x745). Is reset to FALSE by the execution of a command at the inputs.

nErrorId

UDINT

Contains the ADS error code or the command-specific error code of the last executed command. Is reset to 0 by the execution of a command at the inputs.

Weiterführende Informationen

FB_VN_WriteRegister_ULINT 4:

Offener Kamera-Control-Channel nötig!

Um diesen Funktionsblock benutzen zu können, muss der Control Channel der GigE Vision Kamera offen sein. Zudem können einige Kamera-Parameter nur geändert werden, wenn die Bild-Akquisition gestoppt ist. Daher wird empfohlen, die Kamera zuvor in den State TCVN_CS_OPENED zu bringen.

Parameter

nAddress

Die Register-Adresse identifiziert das zu adressierende Register der Kamera. Sie ist vom Typ GVCP_REGISTER_ADDRESS, welcher ein Alias auf den Typ UDINT ist. Damit haben alle Register-Adressen eine Größe von 4 Bytes. Die Register-Adresse eines Kamera-Parameters können Sie an entsprechender Stelle im Konfigurationsbaum der GigE Vision Kamera Instanz nachsehen:

FB_VN_WriteRegister_ULINT 5:

nEndian

Die Endianess beschreibt die Reihenfolge, in der die Bytes eines Kamera-Registers angeordnet werden. Diese muss anwendungstechnisch nicht weiter beachtet werden und kann als Eigenschaft des jeweiligen Parameters vom Konfigurationsbaum der GigE Vision Kamera Instanz übernommen werden:

FB_VN_WriteRegister_ULINT 6:

Ein Big Endian wird dabei durch nEndian := 0 und ein Small Endian durch nEndian := 1 dargestellt. Big Endian ist Standard.

Beispiele

Lesen/Schreiben eines Registers

Required License

TC3 Vision Base

System Requirements

Development environment

Target platform

PLC libraries to include

TwinCAT V3.1. 4024.44 or later

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

Tc3_Vision