FB_VN_ReadMemory

FB_VN_ReadMemory 1:

This FB reads consecutive memory locations from the camera. Requires an open control channel (e.g. by calling FB_VN_GevCameraControl.OpenCamera() before)

Syntax

Definition:

FUNCTION_BLOCK FB_VN_ReadMemory
VAR_INPUT
    nAddress                 : GVCP_REGISTER_ADDRESS;
    nLength                  : UINT;
    pBuffer                  : PVOID;
    bRead                    : BOOL;
    nTimeout                 : TIME;
END_VAR
VAR_OUTPUT
    bBusy                    : BOOL;
    bError                   : BOOL;
    nErrorId                 : UDINT;
END_VAR
VAR
    oidITcVnGevImageProvider : OTCID;
END_VAR

FB_VN_ReadMemory 2: Inputs

Name

Type

Default

Description

nAddress

GVCP_REGISTER_ADDRESS

 

The address of the first byte to read from the camera (must be 32-bit aligned)

nLength

UINT

 

The number of bytes to read, starting with nAddress (must be a multiple of 4, not more than 536)

pBuffer

PVOID

 

Pointer to the buffer where the read memory content is written to (The buffer must have a size of at least nLength bytes!)

bRead

BOOL

 

Reading the memory is triggered by a rising edge at this input.

nTimeout

TIME

VISION_ADS_TIMEOUT

Indicates the time before the function is cancelled.

FB_VN_ReadMemory 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.

Further information

FB_VN_ReadMemory 4:

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

nAddress

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_ReadMemory 5:

Required License

TC3 Vision Base

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