FB_VN_WriteRegisters_UDINT

FB_VN_WriteRegisters_UDINT 1:

This FB writes multiple UDINT registers on the camera. Requires the same endianness for the specified registers and an open control channel (e.g. by calling FB_VN_GevCameraControl.OpenCamera() before).

Syntax

Definition:

FUNCTION_BLOCK FB_VN_WriteRegisters_UDINT
VAR_INPUT
    pAddressValuePairs       : Pointer To GVCP_ADDRESS_VALUE_PAIR;
    nArraySize               : UINT;
    nEndian                  : UINT;
    bWrite                   : BOOL;
    nTimeout                 : TIME;
END_VAR
VAR_OUTPUT
    bBusy                    : BOOL;
    bError                   : BOOL;
    nErrorId                 : UDINT;
END_VAR
VAR
    oidITcVnGevImageProvider : OTCID;
END_VAR

 Inputs

Name

Type

Default

Description

pAddressValuePairs

Pointer To GVCP_ADDRESS_VALUE_PAIR

An array containing address/value pairs of the registers that should be written

nArraySize

UINT

Number of address/value pairs in pAddressValuePairs

nEndian

UINT

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

bWrite

BOOL

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

nTimeout

TIME

VISION_ADS_TIMEOUT

Indicates the time before the function is cancelled.

 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.

Further information

FB_VN_WriteRegisters_UDINT writes to multiple UDINT registers of the camera in a single call.

FB_VN_WriteRegisters_UDINT 2:

Open camera Control Channel needed!

The Control Channel of the GigE Vision camera must be open in order to be able to use this function block. In addition, some camera parameters can only be changed if the image acquisition is stopped. It is therefore recommended to place the camera in the state TCVN_CS_OPENED first.

Parameter

pAddressValuePairs

The registers to be written are transferred as an array of type GVCP_ADDRESS_VALUE_PAIR. Each element of the array contains the register address (GVCP_REGISTER_ADDRESS) and the corresponding write value (GVCP_REGISTER_VALUE). The pointer to the array is transferred via the input pAddressValuePairs.

The register address identifies the camera register to be addressed. It is of the type GVCP_REGISTER_ADDRESS, which is an alias of the type UDINT. Thus, all register addresses have a size of 4 bytes. The register address of a camera parameter can be seen at the respective point in the configuration tree of the GigE Vision camera instance:

FB_VN_WriteRegisters_UDINT 3:

nArraySize

Specifies the number of address-value pairs in the array pAddressValuePairs.

nEndian

Endianess describes the order in which the bytes of a camera register are arranged. The value can be taken as a property of the respective parameter from the configuration tree of the GigE Vision camera instance:

FB_VN_WriteRegisters_UDINT 4:

A Big Endian is represented by nEndian := 0 and a Small Endian by nEndian := 1. Big Endian is the default.

FB_VN_WriteRegisters_UDINT 5:

Equal endianness of all registers required

All address-value pairs in the transferred array must use the same endianness. If registers with different endianness are to be written, separate calls with correspondingly separate arrays are required.

Required License

TC3 Vision Base