FrameLink Express

The FrameLink Express frame grabber is a ExpressCard/54 card with two Camera Link interfaces. It provides the ability to capture digital video data from both 'base' configuration Camera Link interfaces and transfer that data to host memory via an ExpressCard ( PCIe x1 ) interface.

  • About FrameLink Express
  • FrameLink Express Reference


About FrameLink Express

FrameLink Express provides next functionality:

  • Captures video data from two Base Camera Link interface, formats this data and stores it into local FIFO's.
  • Retrieves the formatted data from the FIFO's and transfers it into host memory via an intelligent scatter/gather DMA over the ExpressCard interface.
  • Provides a full-duplex asynchronous interface ( UART ) to/from an attached device on each Camera Link serial interface.
  • Provides the host processor with the ability to configure the four discrete Camera Control signals on each Camera Link interface.


FrameLink Express Reference

The following elements are used with FrameLink Express

  • FrameLink Express Enumerations
  • FrameLink Express Structures
  • FrameLink Express Functions
  • FrameLink Express Programmable Logic Controller (PLC)
  • FrameLink Express Power over CameraLink (PoCL)
Define | Description
VCECLB_H |


FrameLink Express Enumerations

The following enumerations are used in FrameLink Express

Enum | Description
VCECLB_Error | Error codes returned by FrameLink functions.
VCECLB_Capability | Frame grabber capabilities.
VCECLB_TapConfigPredefined | Predefined tap configuration.
VCECLB_EX_CC_State | Camera control strobe configuration.
VCECLB_DeviceType | Device type identificator.


VCECLB_Error

Error codes returned by FrameLink functions.
enum VCECLB_Error {
  VCECLB_Err_Success = = 0,
  VCECLB_Err_noDriver,
  VCECLB_Err_noDevicePresent,
  VCECLB_Err_notInitialized,
  VCECLB_Err_noMemory,
  VCECLB_Err_badArgument,
  VCECLB_Err_notPrepared,
  VCECLB_Err_notGrabbed,
  VCECLB_Err_bufferBusy,
  VCECLB_Err_lostContact,
  VCECLB_Err_SnapTimeout = = VCECLB_Err_lostContact,
  VCECLB_Err_cameraNotConnected,
  VCECLB_Err_UART_Timeout,
  VCECLB_Err_UART_Error,
  VCECLB_Err_DeviceBusy,
  VCECLB_Err_NoMoreItems,
  VCECLB_Err_notSupported = = 254,
  VCECLB_Err_UnknownError = = 255
};

Enum values:

VCECLB_Err_Success
Operation successful
VCECLB_Err_noDriver
Driver is not installed
VCECLB_Err_noDevicePresent
Device is not present
VCECLB_Err_notInitialized
Frame grabber has not been initialized
VCECLB_Err_noMemory
Not enough memory to perform operation
VCECLB_Err_badArgument
Argument is invalid
VCECLB_Err_notPrepared
Frame grabber has not been prepared to perform grabbing operations
VCECLB_Err_notGrabbed
Image has not been grabbed yet
VCECLB_Err_bufferBusy
Requested buffer has not been released
VCECLB_Err_lostContact
Camera stops streaming images
VCECLB_Err_SnapTimeout
Snap image timed out
VCECLB_Err_cameraNotConnected
Camera is not connected or not powered on
VCECLB_Err_UART_Timeout
Time-out occurs during UART operation
VCECLB_Err_UART_Error
Error occurs during UART operation
VCECLB_Err_DeviceBusy
Device busy or not responding
VCECLB_Err_NoMoreItems
Image buffer queue is full
VCECLB_Err_notSupported
Operation is not supported
VCECLB_Err_UnknownError
Unknown (system) error occurs


VCECLB_Capability

Frame grabber capabilities.

enum VCECLB_Capability {
  VCECLB_Cap_PoCL = = 0,
  VCECLB_Cap_PLC,
  VCECLB_Cap_FullDeca,
  VCECLB_Cap_DualChannels
};

Enum values:

VCECLB_Cap_PoCL
Power over CameraLink capability
VCECLB_Cap_PLC
Programmable Logic Controller capability
VCECLB_Cap_FullDeca
Full/Deca configuration capability
VCECLB_Cap_DualChannels
Dual CameraLink channels capability

See Also:

VCECLB_GetCapability()


VCECLB_TapConfigPredefined

Predefined tap configuration.

enum VCECLB_TapConfigPredefined {
  VCECLB_TapConfig_Custom = = 0,
  VCECLB_TapConfig_1TapLR,
  VCECLB_TapConfig_1TapRL,
  VCECLB_TapConfig_2TapInterLR,
  VCECLB_TapConfig_2TapInterRL,
  VCECLB_TapConfig_2TapSepLR,
  VCECLB_TapConfig_2TapSepRL,
  VCECLB_TapConfig_2TapSepConv,
  VCECLB_TapConfig_2TapSepDiv,
  VCECLB_TapConfig_3TapSepLR,
  VCECLB_TapConfig_4TapSepLR,
  VCECLB_TapConfig_4TapSepRL,
  VCECLB_TapConfig_4Tap2SegLR,
  VCECLB_TapConfig_4Tap2SegConv,
  VCECLB_TapConfig_4TapQuadConv,
  VCECLB_TapConfig_4TapInterLR,
  VCECLB_TapConfig_4TapInterRL,
  VCECLB_TapConfig_8TapInterLR,
  VCECLB_TapConfig_10TapInterLR
};

Enum values:

VCECLB_TapConfig_Custom
Custom tap configuration
VCECLB_TapConfig_1TapLR
One tap left to right configuration
VCECLB_TapConfig_1TapRL
One tap right to left (inversed) configuration
VCECLB_TapConfig_2TapInterLR
Two taps interleaved left to right configuration
VCECLB_TapConfig_2TapInterRL
Two taps interleaved right to left configuration
VCECLB_TapConfig_2TapSepLR
Two taps separated left to right configuration
VCECLB_TapConfig_2TapSepRL
Two taps separated right to left configuration
VCECLB_TapConfig_2TapSepConv
Two taps separated convergence configuration
VCECLB_TapConfig_2TapSepDiv
Two taps separated divergence configuration
VCECLB_TapConfig_3TapSepLR
Three taps separated left to right configuration
VCECLB_TapConfig_4TapSepLR
Four taps separated left to right configuration
VCECLB_TapConfig_4TapSepRL
Four taps separated right to left configuration
VCECLB_TapConfig_4Tap2SegLR
Four taps separated two segments by two elements left to right configuration
VCECLB_TapConfig_4Tap2SegConv
Four taps separated two segments by two elements left to right convergence configuration
VCECLB_TapConfig_4TapQuadConv
Four taps quadrate convergence configuration
VCECLB_TapConfig_4TapInterLR
Four taps interleaved left to right configuration
VCECLB_TapConfig_4TapInterRL
Four taps interleaved right to left configuration
VCECLB_TapConfig_8TapInterLR
Eight taps interleaved left to right configuration
VCECLB_TapConfig_10TapInterLR
Ten taps interleaved left to right configuration

See Also:

VCECLB_IsTapConfigPredefined() VCECLB_GetPredefinedTapConfig()


VCECLB_EX_CC_State

Camera control strobe configuration.
enum VCECLB_EX_CC_State {
  VCECLB_EX_CC_LOW = =0,
  VCECLB_EX_CC_HIGH,
  VCECLB_EX_CC_MASTER_PULSE,
  VCECLB_EX_CC_MASTER_INVPULSE,
  VCECLB_EX_CC_SLAVE_PULSE,
  VCECLB_EX_CC_SLAVE_INVPULSE,
  VCECLB_EX_CC_OC_MASTER_PULSE,
  VCECLB_EX_CC_OC_MASTER_INVPULSE,
  VCECLB_EX_CC_OC_SLAVE_PULSE,
  VCECLB_EX_CC_OC_SLAVE_INVPULSE
};

Enum values:

VCECLB_EX_CC_LOW
Logical Zero state
VCECLB_EX_CC_HIGH
Logical One state
VCECLB_EX_CC_MASTER_PULSE
Master pulse generator state
VCECLB_EX_CC_MASTER_INVPULSE
Inverted master pulse generator
VCECLB_EX_CC_SLAVE_PULSE
Slave pulse generator state
VCECLB_EX_CC_SLAVE_INVPULSE
Inverted Slave pulse generator
VCECLB_EX_CC_OC_MASTER_PULSE
Opposite port master pulse generator state
VCECLB_EX_CC_OC_MASTER_INVPULSE
Opposite port inverted master pulse generator
VCECLB_EX_CC_OC_SLAVE_PULSE
Opposite port slave pulse generator state
VCECLB_EX_CC_OC_SLAVE_INVPULSE
Opposite port inverted Slave pulse generator


VCECLB_DeviceType

Device type identificator.
enum VCECLB_DeviceType {
  VCECLB_DT_FrameLink,
  VCECLB_DT_FrameLink_EX,
  VCECLB_DT_Unknown = = -1
};

Enum values:

VCECLB_DT_FrameLink
FrameLink cardbus controller
VCECLB_DT_FrameLink_EX
FrameLink Express card controller
VCECLB_DT_Unknown
Unknown controller


FrameLink Express Structures

The following structures are used in FrameLink Express

Structure | Description
VCECLB_DeviceData | Device initialization data.
VCECLB_EnumData | Device description information.
VCECLB_TapConfig | Tap reconstruction configuration.
VCECLB_CameraDataEx | Frame grabber configuration settings.
VCECLB_FrameInfoEx | Acquired frame information.
VCECLB_CCStrobesEx | Camera control strobes configuration.
VCECLB_PulseGeneratorEx | Pulse generator configuration.
VCECLB_GrabStatEx | Image acquisition statistical information.
VCECLB_RawPixelInfoEx | Raw pixel description structure.
VCECLB_ConfigurationW | Frame grabber configuration file.
VCECLB_ConfigurationA | Frame grabber configuration file.
Typedef | Description
VCECLB_GrabFrame_CallbackEx | Type definition for Application-defined callback function.
Define | Description
VCECLB_Configuration | Frame grabber configuration file.


VCECLB_GrabFrame_CallbackEx

Type definition for Application-defined callback function.

See GrabFrame_CallBackEx() for more information

typedef void(__stdcall * VCECLB_GrabFrame_CallbackEx)(void *lpUserData, VCECLB_FrameInfoEx *pFrameInfo);


VCECLB_Configuration

Frame grabber configuration file.

#define VCECLB_Configuration VCECLB_ConfigurationA

See Also:

  • VCECLB_ConfigurationW for UNICODE version of structure
  • VCECLB_ConfigurationA for Multibyte version of structure


VCECLB_DeviceData

Device initialization data.

struct VCECLB_DeviceData {
  unsigned long cbSize;
  char DevicePath[1];
};

Members

cbSize
Size of the structure
DevicePath
Internal data

Remarks:

Internal usage only. Do not modify it.


VCECLB_EnumData

Device description information.
struct VCECLB_EnumData {
  unsigned long cbSize;
  unsigned long dwSlot;
  VCECLB_DeviceData * pDeviceData;
  char * pSlotName;
};

Members

cbSize
Size of the structure.
Should be initialized to sizeof(VCECLB_EnumData) before passing to VCECLB_EnumNext() function
dwSlot
System defined slot number
pDeviceData
pointer to the device initialization data
pSlotName
pointer to the system defined slot name


VCECLB_TapConfig

Tap reconstruction configuration.

struct VCECLB_TapConfig {
  unsigned char channels;
  unsigned char channelOrder;
  unsigned char channelOutput;
  unsigned char channelDirection[2];
  unsigned char taps;
  unsigned char tapOutput;
  unsigned char tapDirection[4];
};

Members

channels
Number of input channels (1 or 2)
channelOrder
Order of channel:
value | meaning
TCCR_NORMAL | Normal channel order TCCR_NORMAL
TCCR_REVERSE | Reversed channel order TCCR_REVERSE
channelOutput
Format of channels output:
value | meaning
TCCP_SEGMENTED | Segmented channel output TCCP_SEGMENTED
TCCP_INTERLEAVED | Interleaved (Interlaced) channel output TCCP_INTERLEAVED
channelDirection
Channel direction:
value | meaning
TCCD_TOP_DOWN | Top-Down channel direction TCCD_TOP_DOWN
TCCD_BOTTOM_UP | Bottom-up channel direction TCCD_BOTTOM_UP
taps
Number of taps per channel (1 to 4)
tapOutput
Format of taps output
value | meaning
TCTO_SEGMENTED | Segmented tap output TCTO_SEGMENTED
TCTO_ALTERNATE | Alternated tap output. Two interleaved taps per segment TCTO_ALTERNATE
TCTO_INTERLEAVED | Interleaved tap output TCTO_INTERLEAVED
tapDirection
Tap direction:
value | meaning
TCTD_LEFT_RIGHT | Left-Right tap direction TCTD_LEFT_RIGHT
TCTD_RIGHT_LEFT | Right-Left tap direction TCTD_RIGHT_LEFT

Remarks:

Number of camera output taps is product of channels and taps


VCECLB_CameraDataEx

Frame grabber configuration settings.

Image height that camera produces should be equal to sum of HeightPreValid, Height and HeightPostValid

struct VCECLB_CameraDataEx {
  unsigned long WidthPreValid;
  unsigned long Width;
  unsigned long WidthPostValid;
  unsigned long HeightPreValid;
  unsigned long Height;
  unsigned long HeightPostValid;
  unsigned long BitDepth;
  unsigned long Packed;
  VCECLB_TapConfig TapConfig;
  unsigned long SwapTaps;
  unsigned long IgnoreDVAL;
  unsigned long InvertDVAL;
  unsigned long InvertLVAL;
  unsigned long InvertFVAL;
  unsigned long LineScan;
};

Members

WidthPreValid
Number of pixels at start of line to ignore
Width
Width of output image line
WidthPostValid
Number of pixels at end of line to ignore
HeightPreValid
Number of lines at start of image to ignore
Height
Number of lines in output image
HeightPostValid
Number of lines at end of image to ignore
BitDepth
Camera output bit depth
Packed
Packing settings.
  • 0 - Do not pack data (better CPU performance)
  • 1 - Pack data (better bandwidth utilization)
TapConfig
Tap reconstruction settings
SwapTaps
Swap taps for dual tap output.
IgnoreDVAL
Ignore DataValid signal
InvertDVAL
DataValid signal is inverted
InvertLVAL
LineValid signal is inverted
InvertFVAL
FrameValid signal is inverted
LineScan
LineScan camera

Remarks:

Image width that camera produces should be equal to sum of WidthPreValid, Width and WidthPostValid


VCECLB_FrameInfoEx

Acquired frame information.

E.g. for image 1000x1000@12bit the image size is:

1000(pixels)*1000(lines)*2(byte for 12bits) = 2 000 000 = 488*4096+1152

So alocated buffer size will be 489*4096 = 2 002 944

struct VCECLB_FrameInfoEx {
  unsigned long number;
  unsigned long timestamp;
  void * lpRawBuffer;
  unsigned long bufferSize;
  unsigned long dma_status;
};

Members

number
Number of the frame, since start of the grabbing
timestamp
Timestamp in microseconds (uSecs), since start of the grabbing
lpRawBuffer
Pointer to buffer with raw image data
bufferSize
Size of the raw image buffer
dma_status
DMA status of the captured image

Remarks:

Image buffer size is calculted from width, height and bitdepth rounded up to the next page size (4KB).


VCECLB_CCStrobesEx

Camera control strobes configuration.
struct VCECLB_CCStrobesEx {
  VCECLB_EX_CC_State cc[4];
};

Members

cc
Array of the camera control strobes


VCECLB_PulseGeneratorEx

Pulse generator configuration.

SlaveWidth should be less then MasterPeriod.

SlaveDelay should be less then MasterPeriod.

MasterPeriod, MasterWidth, SlaveWidth and SlaveDelay uses PulseGranularity units

struct VCECLB_PulseGeneratorEx {
  unsigned char PulseLimited;
  unsigned short PulseCount;
  unsigned short PulseGranularity;
  unsigned short MasterWidth;
  unsigned short MasterPeriod;
  unsigned short SlaveWidth;
  unsigned short SlaveDelay;
};

Members

PulseLimited
Do limit the number of the pulses to generate
PulseCount
If the number of the pulses is limited: Limit value, otherwise not used
PulseGranularity
Pulse granularity in 10 nanoseconds (nSecs)
MasterWidth
Width of the master pulse generator signal in granularity units
MasterPeriod
Period of the master pulse generator signal in granularity units
SlaveWidth
Width of the slave pulse generator signal in granularity units
SlaveDelay
Delay of the slave pulse generator signal from the master pulse in granularity units

Remarks:

MasterWidth should be less then MasterPeriod.


VCECLB_GrabStatEx

Image acquisition statistical information.
struct VCECLB_GrabStatEx {
  unsigned int FrameRate;
  unsigned int ClockRate;
  unsigned int Horiz;
  unsigned int Vert;
  unsigned int GrabRate;
  unsigned int GrabCount;
  unsigned int DropCount;
  unsigned int OverrunCount;
};

Members

FrameRate
Number of the frames received from the CameraLink interface during a 1 second period
ClockRate
The rate of the clocks received over the Camera Link interface.
Horiz
Number of the pixels per lines as determined by the card's CameraLink interface. Note that this does not account for single vs. dual tap mode.
Vert
Number of the lines per frame as determined by the card's CameraLink interface.
GrabRate
Number of the frames acquired within a 1 second period.
GrabCount
< Number of the frames that have acquired since the last time VCECLB_StartGrabEx() has been called.
DropCount
Number of dropped frames.
OverrunCount
Number of FIFO overruns.


VCECLB_RawPixelInfoEx

Raw pixel description structure.

If BayerPattern is false, the BayerStart parameter ignored.

The Gain and Offset parameters are used only with RGB input or if BayerPattern is true, otherwise they ignored

LookupTableLevels and LookupTableValues should either both be NULL or both set. For RGB image, lookup table ignored.

Size of lookup tables buffers should be equal to the number of possible values for specified BitDepth. I.e. for 10bit image lookup tables should have 1024 entries, for 12bit - 4096 entries, etc.

struct VCECLB_RawPixelInfoEx {
  void * _unused0;
  VCECLB_CameraDataEx cameraData;
  unsigned char BayerPattern;
  unsigned char BayerStart;
  signed char RedOffset;
  signed char GreenOffset;
  signed char BlueOffset;
  double RedGain;
  double GreenGain;
  double BlueGain;
  int * LookupTableLevels;
  int * LookupTableValues;
};

Members

_unused0
Reserved for future use. Should be NULL
cameraData
Frame grabber configuration settings
BayerPattern
Use Bayer or TrueSense Color Filter Array (CFA) de-mosaicking algorithm
  • 0 Monochrome
  • 1 Bayer CFA
  • 2 TRUESENSE Sparse CFA
BayerStart
Bayer or TRUESENSE Sparse Color Filter Array start pixel number
  • For Bayer CFA (see picture below):
    • 0 GR-BG, 1 RG-GB
    • 2 BG-GR, 3 GB-RG
  • For TRUESENSE Sparse CFA (see picture below):
    • 0 PB-BP, 1 BP-PG, 2 PG-GP, 3 GP-PB
    • 4 BP-PG, 5 PG-GP, 6 GP-PR, 7 PB-RP
    • 8 PG-GP, 9 GP-PR, 10 PR-RP, 11 RP-PG
    • 12 GP-PB, 13 PR-BP, 14 RP-PG, 15 PG-GP
RedOffset
Offset value for red component
GreenOffset
Offset value for green component
BlueOffset
Offset value for blue component
RedGain
Gain value for red component
GreenGain
Gain value for green component
BlueGain
Gain value for blue component
LookupTableLevels
Optional lookup table levels
LookupTableValues
Optional lookup table values

Remarks:

cameraData structure should be equal to structure, used in VCECLB_PrepareEx() function to configure frame grabber.
Bayer CFA | TRUESENSE Sparse CFA
If cameraData specifies RGB input (i.e. BitDepth set to 24, 30 or 36 bits), then de-mosaicking algorithm ignored.


VCECLB_ConfigurationW

Frame grabber configuration file.

Frame grabber configuration settings is provided via pixelInfo.cameraData field

struct VCECLB_ConfigurationW {
  wchar_t * lpszManufacturer;
  unsigned long cchManufacturer;
  wchar_t * lpszModel;
  unsigned long cchModel;
  wchar_t * lpszDescription;
  unsigned long cchDescription;
  wchar_t * lpszAlias;
  unsigned long cchAlias;
  VCECLB_RawPixelInfoEx pixelInfo;
  VCECLB_CCStrobesEx strobes;
  VCECLB_PulseGeneratorEx pulseGenerator;
  unsigned long baudRate;
};

Members

lpszManufacturer
Pointer to the buffer with camera manufacturer string
cchManufacturer
Length of the buffer with camera manufacturer in chars
lpszModel
Pointer to the buffer with camera model string
cchModel
Length o thef buffer with camera model in chars
lpszDescription
Pointer to the buffer with camera description string
cchDescription
Length of the buffer with camera model in chars
lpszAlias
Pointer to the buffer with camera alias string
cchAlias
Length of the buffer with camera alias in chars
pixelInfo
Raw pixel description
strobes
Camera control strobes configuration
pulseGenerator
Pulse generator configuration
baudRate
Camera communication baud rate

Remarks:

String buffers should be allocated by application. If supplied buffer is too small to hold the requested string, the string is truncated and followed by a null character.


VCECLB_ConfigurationA

Frame grabber configuration file.

Frame grabber configuration settings is provided via pixelInfo.cameraData field

struct VCECLB_ConfigurationA {
  char * lpszManufacturer;
  unsigned long cchManufacturer;
  char * lpszModel;
  unsigned long cchModel;
  char * lpszDescription;
  unsigned long cchDescription;
  char * lpszAlias;
  unsigned long cchAlias;
  VCECLB_RawPixelInfoEx pixelInfo;
  VCECLB_CCStrobesEx strobes;
  VCECLB_PulseGeneratorEx pulseGenerator;
  unsigned long baudRate;
};

Members

lpszManufacturer
Pointer to the the buffer with camera manufacturer string
cchManufacturer
Length of the buffer with camera manufacturer in chars
lpszModel
Pointer to the buffer with camera model string
cchModel
Length of the buffer with camera model in chars
lpszDescription
Pointer to the buffer with camera description string
cchDescription
Length of the buffer with camera model in chars
lpszAlias
Pointer to the buffer with camera alias string
cchAlias
Length of the buffer with camera alias in chars
pixelInfo
Raw pixel description
strobes
Camera control strobes configuration
pulseGenerator
Pulse generator configuration
baudRate
Camera communication baud rate

Remarks:

String buffers should be allocated by application. If supplied buffer is too small to hold the requested string, the string is truncated and followed by a null character.


FrameLink Express Functions

The following functions are used with FrameLink Express

  • FrameLink Express initialization functions
  • FrameLink Express UART functions
  • FrameLink Express Image acquisition functions
  • FrameLink Express camera control and pulse generator functions
  • FrameLink Express pixel unpacking and image saving functions
  • FrameLink Express miscellaneous functions
  • FrameLink Express device enumeration functions


FrameLink Express initialization functions

Function | Description
VCECLB_Init | Initializes FrameLink Express or FrameLink frame grabber.
VCECLB_Done | Closes frame grabber.
VCECLB_GetCapability | Get framegrabber capability.


VCECLB_Init

Initializes FrameLink Express or FrameLink frame grabber.

void *VCECLB_CALL VCECLB_Init(
  void
);

Return Values:

If the function succeeds, the return value is an open handle to the first available frame grabber,
If the function fails, the return value is NULL. To get extended error information, call VCECLB_CardLastError()

Sample code:

void * hGrabber = VCECLB_Init(); // Open frame grabber
if(hGrabber == NULL) // Frame grabber is not accessible
  ... // Handle error
// Do other stuff
VCECLB_Done(hGrabber); // Close frame frabber


VCECLB_Done

Closes frame grabber.

VCECLB_Error VCECLB_CALL VCECLB_Done(
  HANDLE hVCECLB
);

Parameters

hVCECLB
Handle to frame grabber

Return Values:

The return value is the error code.

Sample code:

For sample code see VCECLB_Init() function


VCECLB_GetCapability

Get framegrabber capability.

VCECLB_Error VCECLB_CALL VCECLB_GetCapability(
  HANDLE hVCECLB,
  VCECLB_Capability cap
);

Parameters

hVCECLB
Handle to frame grabber
cap
Capability flag

Return Values:

Function returns VCECLB_Err_Success if grabber supports the capability and VCECLB_Err_notSupported if capability is not supported


FrameLink Express UART functions

Function | Description
VCECLB_UART_InitEx | Acquires the access to UART operations on specified port.
VCECLB_UART_DoneEx | Releases access to UART operations on port.
VCECLB_UART_SetBREx | Sets the baud rate for UART operations.
VCECLB_UART_GetBREx | Retrieves the value of baud rate for UART operations.
VCECLB_UART_SetTimeoutsEx | Sets the time-out parameters for all read and write operations on a specified communications port.
VCECLB_UART_GetTimeoutsEx | Retrieves the time-out parameters for all read and write operations on a specified communications port.
VCECLB_UART_WriteEx | Writes the data to the communication port.
VCECLB_UART_ReadEx | Reads the data from the communication port.
VCECLB_UART_GetNumBytesAvailEx | Returns number of bytes available in driver input buffer for the communication port.
VCECLB_UART_FlushEx | Clears driver input buffer for communication port.
VCECLB_UART_CreateSerialPortEx | Creates virtual COM port and associates it with specified commincation port.
VCECLB_UART_DeleteSerialPortEx | Deletes virtual COM port associated with specified commincation port.


VCECLB_UART_InitEx

Acquires the access to UART operations on specified port.

VCECLB_Error VCECLB_CALL VCECLB_UART_InitEx(
  HANDLE hVCECLB,
  char port
);

Parameters

hVCECLB
Handle to frame grabber
port
Port number

Return Values:

The return value is the error code.

Sample code:

void * hGrabber; // Handle to frame grabber
char port; // Input port
VCECLB_Error err = VCECLB_UART_InitEx(hGrabber, port) // Acquire access to UART
if(err != VCECLB_Err_Success) // Port busy.
  ... // Handle error
// Do other stuff
VCECLB_UART_DoneEx(hGrabber, port); // Release access to UART


VCECLB_UART_DoneEx

Releases access to UART operations on port.

VCECLB_Error VCECLB_CALL VCECLB_UART_DoneEx(
  HANDLE hVCECLB,
  char port
);

Parameters

hVCECLB
Handle to frame grabber
port
Port number

Return Values:

The return value is the error code.

Sample code:

For an example, see the VCECLB_UART_InitEx() function


VCECLB_UART_SetBREx

Sets the baud rate for UART operations.

VCECLB_Error VCECLB_CALL VCECLB_UART_SetBREx(
  HANDLE hVCECLB,
  char port,
  unsigned long baudRate
);

Parameters

hVCECLB
Handle to frame grabber
port
Port number
baudRate
Baud rate value at which the communications device operates

Return Values:

The return value is the error code.

Sample code:

// Set baud rate to 9600 bps
VCECLB_UART_SetBREx(hGrabber, port, 9600);


VCECLB_UART_GetBREx

Retrieves the value of baud rate for UART operations.

VCECLB_Error VCECLB_CALL VCECLB_UART_GetBREx(
  HANDLE hVCECLB,
  char port,
  unsigned long * pBaudRate
);

Parameters

hVCECLB
Handle to frame grabber
port
Port number
pBaudRate
Pointer to the variable that recives the value of baud rate at which the communications device operates

Return Values:

The return value is the error code.

Sample code:

unsigned long baudRate;
// Get current baud rate value
VCECLB_UART_GetBREx(hGrabber, port, &baudRate);


VCECLB_UART_SetTimeoutsEx

Sets the time-out parameters for all read and write operations on a specified communications port.

VCECLB_Error VCECLB_CALL VCECLB_UART_SetTimeoutsEx(
  HANDLE hVCECLB,
  char port,
  LPCOMMTIMEOUTS lpCommTimeouts
);

Parameters

hVCECLB
Handle to frame grabber
port
Port number
lpCommTimeouts
Pointer to a COMMTIMEOUTS structure that contains the new time-out values.

Return Values:

The return value is the error code.

Remarks:

The COMMTIMEOUTS structure declared in Windows API Winbase.h; include Windows.h.
The parameters determine the behavior of VCECLB_UART_ReadEx() and VCECLB_UART_WriteEx() operations on the port.

typedef struct _COMMTIMEOUTS {
  DWORD ReadIntervalTimeout;
  DWORD ReadTotalTimeoutMultiplier;
  DWORD ReadTotalTimeoutConstant;
  DWORD WriteTotalTimeoutMultiplier;
  DWORD WriteTotalTimeoutConstant;
} COMMTIMEOUTS,  *LPCOMMTIMEOUTS;


VCECLB_UART_GetTimeoutsEx

Retrieves the time-out parameters for all read and write operations on a specified communications port.

VCECLB_Error VCECLB_CALL VCECLB_UART_GetTimeoutsEx(
  HANDLE hVCECLB,
  char port,
  LPCOMMTIMEOUTS lpCommTimeouts
);

Parameters

hVCECLB
Handle to frame grabber
port
Port number
lpCommTimeouts
Pointer to a COMMTIMEOUTS structure in which the time-out information is returned.

Return Values:

The return value is the error code.

Remarks:

For more information about time-out values for communications devices, see the VCECLB_UART_SetTimeoutsEx() function.


VCECLB_UART_WriteEx

Writes the data to the communication port.

VCECLB_Error VCECLB_CALL VCECLB_UART_WriteEx(
  HANDLE hVCECLB,
  char port,
  unsigned char * buffer,
  unsigned long * bufferSize,
  unsigned long serialTimeout
);

Parameters

hVCECLB
Handle to frame grabber
port
Port number
buffer
Pointer to the buffer containing the data to be written to the port.
bufferSize
Pointer to variable that specifies length of buffer and on successful output recieves number of bytes written.
serialTimeout
Maximum time-out value in milliseconds.

Return Values:

The return value is the error code.

Remarks:

If serialTimeout set to zero, time-out parameters set by VCECLB_UART_SetTimeoutsEx() used. Otherwise time-out parameters overrides by serialTimeout.
If time-out occurs and no data has been written, VCECLB_Err_UART_Timeout returns, otherwise return value is VCECLB_Err_Success.


VCECLB_UART_ReadEx

Reads the data from the communication port.

VCECLB_Error VCECLB_CALL VCECLB_UART_ReadEx(
  HANDLE hVCECLB,
  char port,
  unsigned char * buffer,
  unsigned long * bufferSize,
  unsigned long serialTimeout
);

Parameters

hVCECLB
Handle to frame grabber
port
Port number
buffer
Pointer to the buffer that receives the data read from the port.
bufferSize
Pointer to variable that specifies length of buffer and on successful output recieves number of bytes read.
serialTimeout
Maximum time-out value in milliseconds.

Return Values:

The return value is the error code.

Remarks:

If serialTimeout set to zero, time-out parameters set by VCECLB_UART_SetTimeoutsEx() used. Otherwise time-out parameters overrides by serialTimeout.
If time-out occurs and no data has been read, VCECLB_Err_UART_Timeout returns, otherwise return value is VCECLB_Err_Success.


VCECLB_UART_GetNumBytesAvailEx

Returns number of bytes available in driver input buffer for the communication port.

VCECLB_Error VCECLB_CALL VCECLB_UART_GetNumBytesAvailEx(
  HANDLE hVCECLB,
  char port,
  unsigned int * numBytes
);

Parameters

hVCECLB
Handle to frame grabber
port
Port number
numBytes
Pointer to variable that receivs number of bytes available in driver input buffer.

Return Values:

The return value is the error code.

Remarks:

The numBytes bytes can be read from communication port without blocking.


VCECLB_UART_FlushEx

Clears driver input buffer for communication port.

VCECLB_Error VCECLB_CALL VCECLB_UART_FlushEx(
  HANDLE hVCECLB,
  char port
);

Parameters

hVCECLB
Handle to frame grabber
port
Port number

Return Values:

The return value is the error code.

Remarks:

This function clears all data sent by camera to frame grabber, that has not been read yet.


VCECLB_UART_CreateSerialPortEx

Creates virtual COM port and associates it with specified commincation port.

VCECLB_Error VCECLB_CALL VCECLB_UART_CreateSerialPortEx(
  HANDLE hVCECLB,
  char port,
  unsigned long dwPortNumber
);

Parameters

hVCECLB
Handle to frame grabber
port
Port number
dwPortNumber
COM port to create

Return Values:

The return value is the error code.

Remarks:

This function creates virtual COM port (like COM1, COM2, etc) and associates it with specified frame grabber communication port. Virtual COM port may later be used with any terminal application, or using Windows API functions for Communication Ports.


VCECLB_UART_DeleteSerialPortEx

Deletes virtual COM port associated with specified commincation port.

VCECLB_Error VCECLB_CALL VCECLB_UART_DeleteSerialPortEx(
  HANDLE hVCECLB,
  char port
);

Parameters

hVCECLB
Handle to frame grabber
port
Port number

Return Values:

The return value is the error code.

Remarks:

This function removes virtual COM port (like COM1, COM2, etc) that was previously associated with frame grabber communication port using VCECLB_UART_CreateSerialPortEx() function.


FrameLink Express Image acquisition functions

Function | Description
GrabFrame_CallBackEx | Application-defined callback function that recieves information about acquired frame.
VCECLB_GetDMAAccessEx | Acquires the access to image acquisition on spcified port.
VCECLB_ReleaseDMAAccessEx | Releases access to image acquisition on port.
VCECLB_LearnFrameSizeEx | Analyzes input signal and returns number of pixels and lines per one tap.
VCECLB_GetCameraStatusEx | Retrieves camera online status.
VCECLB_SetBufferCountEx | Sets length of internal buffer queue, used to acquire data from framegrabber.
VCECLB_PrepareEx | Configures frame grabber with specified settings.
VCECLB_IsTapConfigPredefined | Checks if tap configuration is equal to one of predefined tap configuration.
VCECLB_GetPredefinedTapConfig | Fills VCECLB_TapConfig variable with values for predefined tap configuration.
VCECLB_StartGrabEx | Starts image acquisition on specified port.
VCECLB_StopGrabEx | Stops image acquisition on specified port.
VCECLB_GetGrabStatEx | Retrieves image acquisition statistical information.
VCECLB_SetDMATimeoutEx | Sets time-out value for image acquisition operation.
VCECLB_SnapEx | Snaps images to user specified buffers.
VCECLB_SetBuffers | Sets user-specified buffers to grab images.
VCECLB_GetLastBufferData |
VCECLB_ResetGrabberEx | Stops image acquisition operations.


GrabFrame_CallBackEx

Application-defined callback function that recieves information about acquired frame.

void GrabFrame_CallBackEx(
  void * lpUserData,
  VCECLB_FrameInfoEx * pFrameInfo
);

Parameters

lpUserData
User supplied data
pFrameInfo
Information about acquired frame

Sample code:

void __stdcall GrabFrame_CallBackEx(void* lpUserData, VCECLB_FrameInfoEx* pFrameInfo)
{
  // Process incoming frame
}
...
VCECLB_StartGrabEx(hDevice, nPort, 0, &GrabFrame_CallBackEx, NULL);
...


VCECLB_GetDMAAccessEx

Acquires the access to image acquisition on spcified port.

VCECLB_Error VCECLB_CALL VCECLB_GetDMAAccessEx(
  HANDLE hVCECLB,
  char port
);

Parameters

hVCECLB
Handle to frame grabber
port
Port number

Return Values:

The return value is the error code.


VCECLB_ReleaseDMAAccessEx

Releases access to image acquisition on port.

VCECLB_Error VCECLB_CALL VCECLB_ReleaseDMAAccessEx(
  HANDLE hVCECLB,
  char port
);

Parameters

hVCECLB
Handle to frame grabber
port
Port number

Return Values:

The return value is the error code.


VCECLB_LearnFrameSizeEx

Analyzes input signal and returns number of pixels and lines per one tap.

VCECLB_Error VCECLB_CALL VCECLB_LearnFrameSizeEx(
  HANDLE hVCECLB,
  char port,
  unsigned long * pPixels,
  unsigned long * pLines
);

Parameters

hVCECLB
Handle to frame grabber
port
Port number
pPixels
Pointer to variable to recieve number of pixels per tap
pLines
Pointer to variable to recieve number of lines per tap

Return Values:

The return value is the error code.


VCECLB_GetCameraStatusEx

Retrieves camera online status.

VCECLB_Error VCECLB_CALL VCECLB_GetCameraStatusEx(
  HANDLE hVCECLB,
  char port,
  unsigned char * pCameraOnline
);

Parameters

hVCECLB
Handle to frame grabber
port
Port number
pCameraOnline
Pointer to variable to recieve camera online status.

Return Values:

The return value is the error code.


VCECLB_SetBufferCountEx

Sets length of internal buffer queue, used to acquire data from framegrabber.

VCECLB_Error VCECLB_CALL VCECLB_SetBufferCountEx(
  HANDLE hVCECLB,
  char port,
  unsigned long bufferCount
);

Parameters

hVCECLB
Handle to frame grabber
port
Port number
bufferCount
New length of buffer queue

Return Values:

The return value is the error code.

Remarks:

Length of buffer queue should be greater than or equal to 3


VCECLB_PrepareEx

Configures frame grabber with specified settings.

VCECLB_Error VCECLB_CALL VCECLB_PrepareEx(
  HANDLE hVCECLB,
  char port,
  VCECLB_CameraDataEx * pCameraData
);

Parameters

hVCECLB
Handle to frame grabber
port
Port number
pCameraData
Pointer to variable that specifies frame grabber parameters

Return Values:

The return value is the error code.


VCECLB_IsTapConfigPredefined

Checks if tap configuration is equal to one of predefined tap configuration.

VCECLB_TapConfigPredefined VCECLB_CALL VCECLB_IsTapConfigPredefined(
  const VCECLB_TapConfig * config
);

Parameters

config
Pointer to variable that specifies tap configuration

Return Values:

The function returns VCECLB_TapConfig_Custom if tap configuration not recognized as predefined.
The function returns one of the VCECLB_TapConfigPredefined enumeration value, that represents predefined tap configuration


VCECLB_GetPredefinedTapConfig

Fills VCECLB_TapConfig variable with values for predefined tap configuration.

void VCECLB_CALL VCECLB_GetPredefinedTapConfig(
  VCECLB_TapConfigPredefined predef,
  VCECLB_TapConfig * config
);

Parameters

config
Pointer to variable to recieve tap configuration
predef
Predefined tap configuration value


VCECLB_StartGrabEx

Starts image acquisition on specified port.

VCECLB_Error VCECLB_CALL VCECLB_StartGrabEx(
  HANDLE hVCECLB,
  char port,
  int queueMode,
  VCECLB_GrabFrame_CallbackEx lpfnCallback,
  void * lpUserData
);

Parameters

hVCECLB
Handle to frame grabber
port
Port number
queueMode
  • 0 - Causes oldest frame in queue to be overwritten by new incoming frame, if no free frames available in the queue
  • 1 - Causes new incoming frames to be dropped, if no available free frames in the queue
lpfnCallback
Pointer to the application-defined function to be executed by the grabbing thread when new image acquired
lpUserData
Points to the application-supplied data. The data is passed to the callback function along with the image information.

Return Values:

The return value is the error code.

Remarks:

See GrabFrame_CallbackEx for more information about callback function.


VCECLB_StopGrabEx

Stops image acquisition on specified port.

VCECLB_Error VCECLB_CALL VCECLB_StopGrabEx(
  HANDLE hVCECLB,
  char port
);

Parameters

hVCECLB
Handle to frame grabber
port
Port number

Return Values:

The return value is the error code.


VCECLB_GetGrabStatEx

Retrieves image acquisition statistical information.

VCECLB_Error VCECLB_CALL VCECLB_GetGrabStatEx(
  HANDLE hVCECLB,
  char port,
  VCECLB_GrabStatEx * pGrabStat
);

Parameters

hVCECLB
Handle to frame grabber
port
Port number
pGrabStat
Pointer to variable to recieve grabbing statistic.

Return Values:

The return value is the error code.


VCECLB_SetDMATimeoutEx

Sets time-out value for image acquisition operation.

VCECLB_Error VCECLB_CALL VCECLB_SetDMATimeoutEx(
  HANDLE hVCECLB,
  char port,
  unsigned long timeout
);

Parameters

hVCECLB
Handle to frame grabber
port
Port number
timeout
Time-out value in milliseconds for image acquisition operation.

Return Values:

The return value is the error code.

Remarks:

This function specifies time-out value for VCECLB_SnapEx() function. Default time-out value is 500 milliseconds


VCECLB_SnapEx

Snaps images to user specified buffers.

VCECLB_Error VCECLB_CALL VCECLB_SnapEx(
  HANDLE hVCECLB,
  char port,
  void * lpBuffer,
  unsigned int dwBufferSize,
  void * lpTSBuf,
  unsigned int dwTSBufSize,
  unsigned int * pdwSnappedFrames,
  unsigned int * pdwAlignedFrameSize
);

Parameters

hVCECLB
Handle to frame grabber
port
Port number
lpBuffer
Pointer to buffer to store acquired images.
dwBufferSize
Size of buffer for images.
lpTSBuf
Pointer to buffer to store timestamp values for acquired images.
dwTSBufSize
Size of buffer for timestamps
pdwSnappedFrames
Pointer to variable to recieve number of snapped frames
pdwAlignedFrameSize
Pointer to variable to recieve length of each frame

Return Values:

The return value is the error code.


VCECLB_SetBuffers

Sets user-specified buffers to grab images.

VCECLB_Error VCECLB_CALL VCECLB_SetBuffers(
  HANDLE hVCECLB,
  char port,
  void ** lplpBuffers,
  UINT32 * lpBufSizes,
  UINT32 count,
  UINT32 * pdwAlignedFrameSize
);

Parameters

hVCECLB
Handle to frame grabber
port
Port number
lplpBuffer
Array of pointers to buffers to store acquired images.
lpBufSizes
Array of sizes of buffers
count
Length of array
pdwAlignedFrameSize
Pointer to variable to recieve length of each frame

Return Values:

The return value is the error code.

Remarks:

each buffer in array should starts from start of memory page (usualy 4096=0x1000) and should have size at least *pdwAlignedFrameSize


VCECLB_GetLastBufferData

VCECLB_Error VCECLB_CALL VCECLB_GetLastBufferData(
  HANDLE hVCECLB,
  char port,
  VCECLB_FrameInfoEx * pFrameInfo
);

Parameters

hVCECLB
Handle to frame grabber
port
Port number
pFrameInfo
pointer to structure to recieve buffer data

Return Values:

The return value is the error code.


VCECLB_ResetGrabberEx

Stops image acquisition operations.

VCECLB_Error VCECLB_CALL VCECLB_ResetGrabberEx(
  HANDLE hVCECLB,
  char port
);

Parameters

hVCECLB
Handle to frame grabber
port
Port number

Return Values:

The return value is the error code.


FrameLink Express camera control and pulse generator functions

Function | Description
VCECLB_GetCCStateEx | Retrieves camera control strobes states.
VCECLB_SetCCStateEx | Sets camera control strobes states.
VCECLB_GetCCPulseGeneratorEx | Retrieves camera control pulse generator parameters.
VCECLB_SetCCPulseGeneratorEx | Sets camera control pulse generator parameters.
VCECLB_StartPulseGeneratorEx | Starts/stops camera control pulse generator.


VCECLB_GetCCStateEx

Retrieves camera control strobes states.

VCECLB_Error VCECLB_CALL VCECLB_GetCCStateEx(
  HANDLE hVCECLB,
  char port,
  VCECLB_CCStrobesEx * pCCStrobes
);

Parameters

hVCECLB
Handle to frame grabber
port
Port number
pCCStrobes
Pointer to variable to recieve camera control strobes states

Return Values:

The return value is the error code.


VCECLB_SetCCStateEx

Sets camera control strobes states.

VCECLB_Error VCECLB_CALL VCECLB_SetCCStateEx(
  HANDLE hVCECLB,
  char port,
  const VCECLB_CCStrobesEx * pCCStrobes
);

Parameters

hVCECLB
Handle to frame grabber
port
Port number
pCCStrobes
Pointer to variable that specifies camera control strobes states

Return Values:

The return value is the error code.


VCECLB_GetCCPulseGeneratorEx

Retrieves camera control pulse generator parameters.

VCECLB_Error VCECLB_CALL VCECLB_GetCCPulseGeneratorEx(
  HANDLE hVCECLB,
  char port,
  VCECLB_PulseGeneratorEx * pPulseGenerator
);

Parameters

hVCECLB
Handle to frame grabber
port
Port number
pPulseGenerator
Pointer to variable to recieve camera control pulse generator parameters

Return Values:

The return value is the error code.


VCECLB_SetCCPulseGeneratorEx

Sets camera control pulse generator parameters.

VCECLB_Error VCECLB_CALL VCECLB_SetCCPulseGeneratorEx(
  HANDLE hVCECLB,
  char port,
  const VCECLB_PulseGeneratorEx * pPulseGenerator
);

Parameters

hVCECLB
Handle to frame grabber
port
Port number
pPulseGenerator
Pointer to variable that specifies camera control pulse generator parameters

Return Values:

The return value is the error code.


VCECLB_StartPulseGeneratorEx

Starts/stops camera control pulse generator.

VCECLB_Error VCECLB_CALL VCECLB_StartPulseGeneratorEx(
  HANDLE hVCECLB,
  char port,
  unsigned char bStart
);

Parameters

hVCECLB
Handle to frame grabber
port
Port number
bStart
Specifies whether to start or stop the pulse generator.
If this parameter is true, the pulse generator started.
If the parameter is false, the pulse generator stoped.

Return Values:

The return value is the error code.


FrameLink Express pixel unpacking and image saving functions

Function | Description
VCECLB_UnpackRawPixelsEx | Converts raw image data to specified image format.
VCECLB_GetFromGrabQueue |
VCECLB_SaveRawToBMPFileHandle | Saves raw data to bitmap file.
VCECLB_SaveRawToBMPFileA | Saves raw data to bitmap file.
VCECLB_SaveRawToBMPFileW | Saves raw data to bitmap file.
VCECLB_SaveRawToJPGFileA | Saves raw data to JPEG file.
VCECLB_SaveRawToJPGFileW | Saves raw data to JPEG file.
VCECLB_SaveRawToTIFFFileA | Saves raw data to TIFF file.
VCECLB_SaveRawToTIFFFileW | Saves raw data to TIFF file.
VCECLB_ConvertPixels2DIBEx | Convers raw data to DIB.
VCECLB_DrawDIB | Draws DIB to specified Device Context.
VCECLB_CopyDIB | Creates a copy of DIB.
VCECLB_ReleaseDIB | Releases memory used by DIB handle.
Define | Description
VCECLB_SaveRawToBMPFile | Saves raw data to bitmap file.
VCECLB_SaveRawToJPGFile | Saves raw data to JPEG file.
VCECLB_SaveRawToTIFFFile | Saves raw data to TIFF file.


VCECLB_UnpackRawPixelsEx

Converts raw image data to specified image format.

VCECLB_Error VCECLB_CALL VCECLB_UnpackRawPixelsEx(
  const VCECLB_RawPixelInfoEx * pPixelInfo,
  const void * pRawPixelsC,
  void * pPixels,
  INT_PTR * pStrideSize,
  unsigned char OutputFormat,
  unsigned long * pOutputBitDepth
);

Parameters

pPixelInfo
Pointer to variable that specifies raw data format
pRawPixelsC
Pointer to buffer with raw data
pPixels
Pointer to buffer to recieve unpacked image
pStrideSize
Pointer to variable that specifies or recieves unpacked image stride size
OutputFormat
Unpacked image format options.
This parameter may include combination of next values:
Output bit depth:
Value | Meaning
VCECLB_EX_FMT_8BIT | Produce 8bit output
VCECLB_EX_FMT_16BIT | Produce 16bit output, if input is not 8bit
VCECLB_EX_FMT_16BIT_NORMALIZE | Produce 16bit normalized output, if input is not 8bit
Output channels, for RGB or Bayer images
Value | Meaning
VCECLB_EX_FMT_3Channel | Produce 3 channels output (24bit or 48bit, depending on input and output)
VCECLB_EX_FMT_4Channel | Produce 4 channels output (32bit or 64bit, depending on input and output)
Output image direction
Value | Meaning
VCECLB_EX_FMT_TopDown | Produce top-down direction image
VCECLB_EX_FMT_BottomUp | Produce bottom-up direction image
pOutputBitDepth
Pointer to variable to recieve information about unpacked image bit depth

Return Values:

The return value is the error code.

Remarks:

Next rule applied to OutputFormat parameter: VCECLB_EX_FMT_8BIT, VCECLB_EX_FMT_16BIT and VCECLB_EX_FMT_16BIT_NORMALIZE are mutual exclusive.
In case of 8bit or 24bit input VCECLB_EX_FMT_16BIT and VCECLB_EX_FMT_16BIT_NORMALIZE ignored.
VCECLB_EX_FMT_3Channel and VCECLB_EX_FMT_4Channel are mutual exclusive.
In case of monochrome input (not RGB24, RGB30, or RGB36 and not bayer pattern) VCECLB_EX_FMT_3Channel and VCECLB_EX_FMT_4Channel ignored.
VCECLB_EX_FMT_TopDown and VCECLB_EX_FMT_BottomUp are mutual exclusive.


VCECLB_GetFromGrabQueue

VCECLB_Error VCECLB_CALL VCECLB_GetFromGrabQueue(
  HANDLE hVCECLB,
  char port,
  unsigned long TimeOut,
  void * pBuf,
  unsigned int * pdwBufferSize,
  unsigned int * pQueueLen
);


VCECLB_SaveRawToBMPFileHandle

Saves raw data to bitmap file.

VCECLB_Error VCECLB_CALL VCECLB_SaveRawToBMPFileHandle(
  const VCECLB_RawPixelInfoEx * pPixelInfo,
  const void * pRawPixelsC,
  void * hFile
);

Parameters

pPixelInfo
Pointer to variable that specifies raw data format
pRawPixelsC
Pointer to buffer with raw data
hFile
Handle to file opened with CreateFile Windows API function

Return Values:

The return value is the error code.


VCECLB_SaveRawToBMPFileA

Saves raw data to bitmap file.

VCECLB_Error VCECLB_CALL VCECLB_SaveRawToBMPFileA(
  const VCECLB_RawPixelInfoEx * pPixelInfo,
  const void * pRawPixelsC,
  const char * lpszFileName
);

Parameters

pPixelInfo
Pointer to variable that specifies raw data format
pRawPixelsC
Pointer to buffer with raw data
lpszFileName
A pointer to a null-terminated string that specifies the name of an file to create.

Return Values:

The return value is the error code.


VCECLB_SaveRawToBMPFileW

Saves raw data to bitmap file.

VCECLB_Error VCECLB_CALL VCECLB_SaveRawToBMPFileW(
  const VCECLB_RawPixelInfoEx * pPixelInfo,
  const void * pRawPixelsC,
  const wchar_t * lpszFileName
);

Parameters

pPixelInfo
Pointer to variable that specifies raw data format
pRawPixelsC
Pointer to buffer with raw data
lpszFileName
A pointer to a null-terminated string that specifies the name of an file to create.

Return Values:

The return value is the error code.


VCECLB_SaveRawToJPGFileA

Saves raw data to JPEG file.

VCECLB_Error VCECLB_CALL VCECLB_SaveRawToJPGFileA(
  const VCECLB_RawPixelInfoEx * pPixelInfo,
  const void * pRawPixelsC,
  const char * lpszFileName,
  unsigned char nQuality
);

Parameters

pPixelInfo
Pointer to variable that specifies raw data format
pRawPixelsC
Pointer to buffer with raw data
lpszFileName
A pointer to a null-terminated string that specifies the name of an file to create.
nQuality
JPEG compression quality (1-100)

Return Values:

The return value is the error code.


VCECLB_SaveRawToJPGFileW

Saves raw data to JPEG file.

VCECLB_Error VCECLB_CALL VCECLB_SaveRawToJPGFileW(
  const VCECLB_RawPixelInfoEx * pPixelInfo,
  const void * pRawPixelsC,
  const wchar_t * lpszFileName,
  unsigned char nQuality
);

Parameters

pPixelInfo
Pointer to variable that specifies raw data format
pRawPixelsC
Pointer to buffer with raw data
lpszFileName
A pointer to a null-terminated string that specifies the name of an file to create.
nQuality
JPEG compression quality (1-100)

Return Values:

The return value is the error code.


VCECLB_SaveRawToTIFFFileA

Saves raw data to TIFF file.

VCECLB_Error VCECLB_CALL VCECLB_SaveRawToTIFFFileA(
  const VCECLB_RawPixelInfoEx * pPixelInfo,
  const void * pRawPixelsC,
  const char * lpszFileName,
  unsigned char OutputFormat
);

Parameters

pPixelInfo
Pointer to variable that specifies raw data format
pRawPixelsC
Pointer to buffer with raw data
lpszFileName
A pointer to a null-terminated string that specifies the name of an file to create.
OutputFormat
Unpacked image format options

Return Values:

The return value is the error code.

Remarks:

For OutputFormat values see VCECLB_UnpackRawPixelsEx() function


VCECLB_SaveRawToTIFFFileW

Saves raw data to TIFF file.

VCECLB_Error VCECLB_CALL VCECLB_SaveRawToTIFFFileW(
  const VCECLB_RawPixelInfoEx * pPixelInfo,
  const void * pRawPixelsC,
  const wchar_t * lpszFileName,
  unsigned char OutputFormat
);

Parameters

pPixelInfo
Pointer to variable that specifies raw data format
pRawPixelsC
Pointer to buffer with raw data
lpszFileName
A pointer to a null-terminated string that specifies the name of an file to create.
OutputFormat
Unpacked image format options

Return Values:

The return value is the error code.

Remarks:

For OutputFormat values see VCECLB_UnpackRawPixelsEx() function


VCECLB_ConvertPixels2DIBEx

Convers raw data to DIB.

VCECLB_Error VCECLB_CALL VCECLB_ConvertPixels2DIBEx(
  const VCECLB_RawPixelInfoEx * pPixelInfo,
  const void * pRawPixelsC,
  void ** phDIB
);

Parameters

pPixelInfo
Pointer to variable that specifies raw data format
pRawPixelsC
Pointer to buffer with raw data
phDIB
Pointer to handle to recieve handle to DIB

Return Values:

The return value is the error code.


VCECLB_DrawDIB

Draws DIB to specified Device Context.

VCECLB_Error VCECLB_CALL VCECLB_DrawDIB(
  HDC hdc,
  HGLOBAL hdib,
  WORD xPos,
  WORD yPos,
  WORD xSize,
  WORD ySize
);

Parameters

hdc
Handle to device context
hdib
Handle to DIB
xPos
x-coord of destination upper-left corner
yPos
y-coord of destination upper-left corner
xSize
width of destination rectangle
ySize
height of destination rectangle

Return Values:

The return value is the error code.

Remarks:

If xSize and ySize set to zero - original size used.
If destination size is equal to original, SetDIBitsToDevice Windows API function used, otherwise StretchDIBits Windows API function used.


VCECLB_CopyDIB

Creates a copy of DIB.

VCECLB_Error VCECLB_CALL VCECLB_CopyDIB(
  HGLOBAL hDIB,
  HGLOBAL * phDIB
);

Parameters

hDIB
Original DIB handle
phDIB
Pointer to handle to recieve handle to DIB

Return Values:

The return value is the error code.


VCECLB_ReleaseDIB

Releases memory used by DIB handle.

VCECLB_Error VCECLB_CALL VCECLB_ReleaseDIB(
  HANDLE hVCECLB,
  HGLOBAL * phDIB
);

Parameters

hVCECLB
Handle to FrameGrabber. Optional, may be NULL.
phDIB
Pointer to DIB handle.

Return Values:

The return value is the error code.


VCECLB_SaveRawToBMPFile

Saves raw data to bitmap file.

#define VCECLB_SaveRawToBMPFile VCECLB_SaveRawToBMPFileA

See Also:

  • VCECLB_SaveRawToBMPFileW for UNICODE version of function
  • VCECLB_SaveRawToBMPFileA for Multibyte version of fuction


VCECLB_SaveRawToJPGFile

Saves raw data to JPEG file.

#define VCECLB_SaveRawToJPGFile VCECLB_SaveRawToJPGFileA

See Also:

  • VCECLB_SaveRawToJPGFileW for UNICODE version of function
  • VCECLB_SaveRawToJPGFileA for Multibyte version of fuction


VCECLB_SaveRawToTIFFFile

Saves raw data to TIFF file.

#define VCECLB_SaveRawToTIFFFile VCECLB_SaveRawToTIFFFileA

See Also:

  • VCECLB_SaveRawToTIFFFileW for UNICODE version of function
  • VCECLB_SaveRawToTIFFFileA for Multibyte version of fuction


FrameLink Express miscellaneous functions

Function | Description
VCECLB_CardLastError | Retrieves last error code.
VCECLB_SystemLastError | Retrieves last system error code.
VCECLB_DriverLastError | Retrieves last driver error code.
VCECLB_GetVersions | Retrieves version information from library, driver and frame grabber.
VCECLB_GetFPGAImageIDEx | Retrieves version information from library, driver and frame grabber.
VCECLB_GetPCIExpressBusInfo | Retrieves information about PCI Express bus.


VCECLB_CardLastError

Retrieves last error code.

VCECLB_Error VCECLB_CALL VCECLB_CardLastError(
  void
);

Return Values:

The return value is the error code of last operation.


VCECLB_SystemLastError

Retrieves last system error code.

unsigned long VCECLB_CALL VCECLB_SystemLastError(
  void
);

Return Values:

The return value is the system error code of last operation driver operation.


VCECLB_DriverLastError

Retrieves last driver error code.

unsigned long VCECLB_CALL VCECLB_DriverLastError(
  void
);

Return Values:

The return value is the driver error code of last operation driver operation.


VCECLB_GetVersions

Retrieves version information from library, driver and frame grabber.

VCECLB_Error VCECLB_CALL VCECLB_GetVersions(
  HANDLE hVCECLB,
  unsigned long * pdwLibVerHi,
  unsigned long * pdwLibVerLo,
  unsigned long * pdwDrvVerHi,
  unsigned long * pdwDrvVerLo,
  unsigned long * pdwFirmVer
);

Parameters

hVCECLB
Handle to frame grabber
pdwLibVerHi
Pointer to variable to recieve Major and Middle version numbers of library
pdwLibVerLo
Pointer to variable to recieve Minor and Build version numbers of library
pdwDrvVerHi
Pointer to variable to recieve Major and Middle version numbers of driver
pdwDrvVerLo
Pointer to variable to recieve Minor and Build version numbers of driver
pdwFirmVer
Pointer to variable to recieve version numbers of frame grabber

Return Values:

The return value is the error code.


VCECLB_GetFPGAImageIDEx

Retrieves version information from library, driver and frame grabber.

VCECLB_Error VCECLB_CALL VCECLB_GetFPGAImageIDEx(
  HANDLE hVCECLB,
  unsigned long * pdwImageID
);

Parameters

hVCECLB
Handle to frame grabber
pdwImageID
Pointer to variable to recieve frame grabber image identificator

Return Values:

The return value is the error code.


VCECLB_GetPCIExpressBusInfo

Retrieves information about PCI Express bus.

VCECLB_Error VCECLB_CALL VCECLB_GetPCIExpressBusInfo(
  HANDLE hVCECLB,
  unsigned long * pLinkWidth,
  unsigned long * pLinkSpeed,
  unsigned long * pMaxPayloadSizeSupported,
  unsigned long * pMaxPayloadSize
);

Parameters

hVCECLB
Handle to frame grabber
pLinkWidth
Pointer to variable to recieve PCI Express link width
pLinkSpeed
Pointer to variable to recieve PCI Express link speed
pMaxPayloadSizeSupported
Pointer to variable to recieve PCI Express Max Payload Size Supported
pMaxPayloadSize
Pointer to variable to recieve PCI Express Max Payload Size

Return Values:

The return value is the error code.


FrameLink Express device enumeration functions

Function | Description
VCECLB_EnumInit | Starts enumerating of installed frame grabbers.
VCECLB_EnumClose | Closes enumerator handle previosly opened by VCECLB_EnumInit() function.
VCECLB_EnumNext | Returns next frame grabber information description.
VCECLB_EnumSize | Returns number of frame grabbers detected by device enumerator.
VCECLB_InitByHandle | Initializes FrameLink Express or FrameLink frame grabber using specified device descrition.
VCECLB_SetDeviceAliasA | Saves device alias in system registry using device data structure.
VCECLB_SetDeviceAliasW | Saves device alias in system registry using device data structure.
VCECLB_SetDeviceAlias2A | Saves device alias in system registry using device handle.
VCECLB_SetDeviceAlias2W | Saves device alias in system registry using device handle.
VCECLB_GetDeviceAliasA | Retrieves device alias from system registry by device data structure.
VCECLB_GetDeviceAliasW | Retrieves device alias from system registry by device data structure.
VCECLB_GetDeviceAlias2A | Retrieves device alias from system registry by device handle.
VCECLB_GetDeviceAlias2W | Retrieves device alias from system registry by device handle.
VCECLB_GetDeviceTypeEx | Returns frame grabber type identificator by handle to frame grabber or by device description, acquired by VCECLB_EnumNext() function.
VCECLB_GetDeviceType2Ex | Returns frame grabber type identificator by handle to frame grabber or by device description, acquired by VCECLB_EnumNext() function.
VCECLB_LoadConfigW | Loads configuration from specified FrameLink or FrameLink Express camera file.
VCECLB_LoadConfigA | Loads configuration from specified FrameLink or FrameLink Express camera file.
VCECLB_SaveConfigW | Saves configuration to specified FrameLink Express camera file.
VCECLB_SaveConfigA | Saves configuration to specified FrameLink Express camera file.
Define | Description
VCECLB_SetDeviceAlias |
VCECLB_SetDeviceAlias2 |
VCECLB_GetDeviceAlias |
VCECLB_GetDeviceAlias2 |
VCECLB_LoadConfig | Loads configuration from specified FrameLink or FrameLink Express camera file.
VCECLB_SaveConfig | Saves configuration to specified FrameLink Express camera file.


VCECLB_EnumInit

Starts enumerating of installed frame grabbers.

HANDLE VCECLB_CALL VCECLB_EnumInit(
  void
);

Return Values:

The return value is the handle to enumerator.

Remarks:

After the search enumerator is established, use the VCECLB_EnumNext() enumerate the frame grabbers.
When enumerator handle is not needed, close it by using VCECLB_EnumClose() function

Sample code:

// Initilize frame grabber description structure
VCECLB_EnumData enumData;
enumData.cbSize = sizeof(VCECLB_EnumData);

// Open enumerator handle
void * hDevEnum = VCECLB_EnumInit();

//Enumerate through device
while(VCECLB_EnumNext(hDevEnum, &enumData) == VCECLB_Err_Success)
{
  void * hDevice = VCECLB_InitByHandle(enumData.pDeviceData, 0);
        // Do other stuff
}

// Close enumerator
VCECLB_EnumClose(hDevEnum);


VCECLB_EnumClose

Closes enumerator handle previosly opened by VCECLB_EnumInit() function.

VCECLB_Error VCECLB_CALL VCECLB_EnumClose(
  HANDLE hDevEnum
);

Parameters

hDevEnum
Handle to enumerator

Return Values:

The return value is the error code.

Sample code:

See VCECLB_EnumInit() for usage example.


VCECLB_EnumNext

Returns next frame grabber information description.

VCECLB_Error VCECLB_CALL VCECLB_EnumNext(
  void * hDevEnum,
  VCECLB_EnumData * pEnumData
);

Parameters

hDevEnum
Handle to enumerator
pEnumData
Pointer to variable to recieve enumeration data

Return Values:

VCECLB_Err_Success, if the function succeeds or VCECLB_Err_noDevicePresent if no more device present.

Sample code:

See VCECLB_EnumInit() for usage example.


VCECLB_EnumSize

Returns number of frame grabbers detected by device enumerator.

int VCECLB_CALL VCECLB_EnumSize(
  void * hDevEnum
);

Parameters

hDevEnum
Handle to enumerator

Return Values:

Returns number of devices detected


VCECLB_InitByHandle

Initializes FrameLink Express or FrameLink frame grabber using specified device descrition.

void *VCECLB_CALL VCECLB_InitByHandle(
  VCECLB_DeviceData * pDeviceData,
  int bSkipCheck
);

Parameters

pDeviceData
Initialized device data
bSkipCheck
Flag to skip the automatic device add/removal event check.
  • Set FALSE to enable the automatic device add/removal event check
  • Set TRUE to skip the automatic device add/removal event check

Return Values:

If the function succeeds, the return value is an open handle to the first available frame grabber,
If the function fails, the return value is NULL. To get extended error information, call VCECLB_CardLastError()

Sample code:

See VCECLB_EnumInit() for usage example.


VCECLB_SetDeviceAliasA

Saves device alias in system registry using device data structure.

VCECLB_Error VCECLB_CALL VCECLB_SetDeviceAliasA(
  VCECLB_DeviceData * pDeviceData,
  LPCSTR strDeviceAlias,
  bool global
);

Parameters

pDeviceData
Initialized device data
strDeviceAlias
String to be saved in system registry or NULL to delete alias
global
Flag to specify where to store card alias. In case of 'true' System Administrator (priveleged) access required

Return Values:

VCECLB_Err_Success, if the function succeeds


VCECLB_SetDeviceAliasW

Saves device alias in system registry using device data structure.

VCECLB_Error VCECLB_CALL VCECLB_SetDeviceAliasW(
  VCECLB_DeviceData * pDeviceData,
  LPCWSTR strDeviceAlias,
  bool global
);

Parameters

pDeviceData
Initialized device data
strDeviceAlias
String to be saved in system registry or NULL to delete alias
global
Flag to specify where to store card alias. In case of 'true' System Administrator (priveleged) access required

Return Values:

VCECLB_Err_Success, if the function succeeds


VCECLB_SetDeviceAlias2A

Saves device alias in system registry using device handle.

VCECLB_Error VCECLB_CALL VCECLB_SetDeviceAlias2A(
  HANDLE hVCECLB,
  LPCSTR strDeviceAlias,
  bool global
);

Parameters

hVCECLB
Handle to open framegrabber
strDeviceAlias
String to be saved in system registry or NULL to delete alias
global
Flag to specify where to store card alias. In case of 'true' System Administrator (priveleged) access required

Return Values:

VCECLB_Err_Success, if the function succeeds


VCECLB_SetDeviceAlias2W

Saves device alias in system registry using device handle.

VCECLB_Error VCECLB_CALL VCECLB_SetDeviceAlias2W(
  HANDLE hVCECLB,
  LPCWSTR strDeviceAlias,
  bool global
);

Parameters

hVCECLB
Handle to open framegrabber
strDeviceAlias
String to be saved in system registry or NULL to delete alias
global
Flag to specify where to store card alias. In case of 'true' System Administrator (priveleged) access required

Return Values:

VCECLB_Err_Success, if the function succeeds


VCECLB_GetDeviceAliasA

Retrieves device alias from system registry by device data structure.

VCECLB_Error VCECLB_CALL VCECLB_GetDeviceAliasA(
  VCECLB_DeviceData * pDeviceData,
  LPSTR strDeviceAlias,
  DWORD * pLen
);

Parameters

pDeviceData
Initialized device data
strDeviceData
Pointer to buffer for returned device alias
pLen
Pointer to variable that specifies length of buffer in chars and on successful output recieves number of chars returned. Includes the terminating null character.

Return Values:

VCECLB_Err_Success, if the function succeeds


VCECLB_GetDeviceAliasW

Retrieves device alias from system registry by device data structure.

VCECLB_Error VCECLB_CALL VCECLB_GetDeviceAliasW(
  VCECLB_DeviceData * pDeviceData,
  LPWSTR strDeviceAlias,
  DWORD * pLen
);

Parameters

pDeviceData
Initialized device data
strDeviceData
Pointer to buffer for returned device alias
pLen
Pointer to variable that specifies length of buffer in chars and on successful output recieves number of chars returned. Includes the terminating null character.

Return Values:

VCECLB_Err_Success, if the function succeeds


VCECLB_GetDeviceAlias2A

Retrieves device alias from system registry by device handle.

VCECLB_Error VCECLB_CALL VCECLB_GetDeviceAlias2A(
  HANDLE hVCECLB,
  LPSTR strDeviceAlias,
  DWORD * pLen
);

Parameters

hVCECLB
Handle to open framegrabber
strDeviceData
Pointer to buffer for returned device alias
pLen
Pointer to variable that specifies length of buffer in chars and on successful output recieves number of chars returned. Includes the terminating null character.

Return Values:

VCECLB_Err_Success, if the function succeeds


VCECLB_GetDeviceAlias2W

Retrieves device alias from system registry by device handle.

VCECLB_Error VCECLB_CALL VCECLB_GetDeviceAlias2W(
  HANDLE hVCECLB,
  LPWSTR strDeviceAlias,
  DWORD * pLen
);

Parameters

hVCECLB
Handle to open framegrabber
strDeviceData
Pointer to buffer for returned device alias
pLen
Pointer to variable that specifies length of buffer in chars and on successful output recieves number of chars returned. Includes the terminating null character.

Return Values:

VCECLB_Err_Success, if the function succeeds


VCECLB_GetDeviceTypeEx

Returns frame grabber type identificator by handle to frame grabber or by device description, acquired by VCECLB_EnumNext() function.

VCECLB_DeviceType VCECLB_CALL VCECLB_GetDeviceTypeEx(
  VCECLB_DeviceData * pDeviceData
);

Parameters

pDeviceData
Device description

Return Values:

Frame grabber type identificator.


VCECLB_GetDeviceType2Ex

Returns frame grabber type identificator by handle to frame grabber or by device description, acquired by VCECLB_EnumNext() function.

VCECLB_DeviceType VCECLB_CALL VCECLB_GetDeviceType2Ex(
  HANDLE hVCECLB
);

Parameters

hVCECLB
Handle to frame grabber

Return Values:

Frame grabber type identificator.


VCECLB_LoadConfigW

Loads configuration from specified FrameLink or FrameLink Express camera file.

VCECLB_Error VCECLB_CALL VCECLB_LoadConfigW(
  const wchar_t * fileName,
  VCECLB_ConfigurationW * pConfig
);

Parameters

fileName
Path to configuration file to load.
pConfig
Pointer to variable to recieve configuration information.

Return Values:

The return value is the error code.


VCECLB_LoadConfigA

Loads configuration from specified FrameLink or FrameLink Express camera file.

VCECLB_Error VCECLB_CALL VCECLB_LoadConfigA(
  const char * fileName,
  VCECLB_ConfigurationA * pConfig
);

Parameters

fileName
Path to configuration file to load.
pConfig
Pointer to variable to recieve configuration information.

Return Values:

The return value is the error code.


VCECLB_SaveConfigW

Saves configuration to specified FrameLink Express camera file.

VCECLB_Error VCECLB_CALL VCECLB_SaveConfigW(
  const wchar_t * fileName,
  VCECLB_ConfigurationW * pConfig
);

Parameters

fileName
Path to configuration file to load.
pConfig
Pointer to variable that specifies configuration information.

Return Values:

The return value is the error code.


VCECLB_SaveConfigA

Saves configuration to specified FrameLink Express camera file.

VCECLB_Error VCECLB_CALL VCECLB_SaveConfigA(
  const char * fileName,
  VCECLB_ConfigurationA * pConfig
);

Parameters

fileName
Path to configuration file to load.
pConfig
Pointer to variable that specifies configuration information.

Return Values:

The return value is the error code.


VCECLB_SetDeviceAlias

#define VCECLB_SetDeviceAlias VCECLB_SetDeviceAliasA


VCECLB_SetDeviceAlias2

#define VCECLB_SetDeviceAlias2 VCECLB_SetDeviceAlias2A


VCECLB_GetDeviceAlias

#define VCECLB_GetDeviceAlias VCECLB_GetDeviceAliasA


VCECLB_GetDeviceAlias2

#define VCECLB_GetDeviceAlias2 VCECLB_GetDeviceAlias2A


VCECLB_LoadConfig

Loads configuration from specified FrameLink or FrameLink Express camera file.

#define VCECLB_LoadConfig VCECLB_LoadConfigA

See Also:

  • VCECLB_LoadConfigW for UNICODE version of function
  • VCECLB_LoadConfigA for Multibyte version of fuction


VCECLB_SaveConfig

Saves configuration to specified FrameLink Express camera file.

#define VCECLB_SaveConfig VCECLB_SaveConfigA

See Also:

  • VCECLB_SaveConfigW for UNICODE version of function
  • VCECLB_SaveConfigA for Multibyte version of fuction


FrameLink Express Programmable Logic Controller (PLC)

The following functions, structures and enums are used with FrameLink Express Programmable Logic Controller

  • FrameLink Express PLC Enumerations
  • FrameLink Express PLC Structures
  • FrameLink Express PLC Functions


FrameLink Express PLC Enumerations

The following enumeration are used with FrameLink Express Programmable Logic Controller

Enum | Description
VCECLB_PLC_Edge | Values for Detect fields.
VCECLB_PLC_Polarity | Input or output signal polarity.
VCECLB_PLC_Select | Input signal selection.
VCECLB_PLC_Input_DeglitchMode | Deglitch mode of input signal.
VCECLB_PLC_PulseGen_Mode | Pulse generator mode.
VCECLB_PLC_MasterSlave_SlaveSelect | Define Slave block source signal.
VCECLB_PLC_Command | Commands to send to PLC.
VCECLB_PLC_Method | List of pre-defined methods.


VCECLB_PLC_Edge

Values for Detect fields.

Defines edge or level of event detection. Some blocks has only limited set of event detection values. See corresponding block description for more information

enum VCECLB_PLC_Edge {
  VCECLB_PLC_Edge_Rising = = 0,
  VCECLB_PLC_Edge_Falling = = 1,
  VCECLB_PLC_Edge_Level0 = = 2,
  VCECLB_PLC_Edge_Level1 = = 3
};

Enum values:

VCECLB_PLC_Edge_Rising
Detect on rising edge of input signal
VCECLB_PLC_Edge_Falling
Detect on falling edge of input signal
VCECLB_PLC_Edge_Level0
Detect while input signal in Logical-0 level
VCECLB_PLC_Edge_Level1
Detect while input signal in Logical-1 level


VCECLB_PLC_Polarity

Input or output signal polarity.
enum VCECLB_PLC_Polarity {
  VCECLB_PLC_Polarity_Positive = = 0,
  VCECLB_PLC_Polarity_Negative = = 1
};

Enum values:

VCECLB_PLC_Polarity_Positive
Signal in normal (positive) polarity
VCECLB_PLC_Polarity_Negative
Signal in inverted (negative) polarity


VCECLB_PLC_Select

Input signal selection.

Defines set of values for Select fields. Some blocks has only limited set of input signal selection values. See corresponding block description for more information

Some inputs can be taken from 'Other Channel'. For first input channel, it means the corresponding block from second channel, and vice-versa

enum VCECLB_PLC_Select {
  VCECLB_PLC_Select_Software = = 0,
  VCECLB_PLC_Select_Input1,
  VCECLB_PLC_Select_Input2,
  VCECLB_PLC_Select_Input3,
  VCECLB_PLC_Select_Input4,
  VCECLB_PLC_Select_PulseGen,
  VCECLB_PLC_Select_Master,
  VCECLB_PLC_Select_Slave,
  VCECLB_PLC_Select_MasterOrSlave,
  VCECLB_PLC_Select_OC_PulseGen,
  VCECLB_PLC_Select_OC_Master,
  VCECLB_PLC_Select_OC_Slave,
  VCECLB_PLC_Select_OC_MasterOrSlave,
  VCECLB_PLC_Select_Strobe
};

Enum values:

VCECLB_PLC_Select_Software
Software command
VCECLB_PLC_Select_Input1
In1 signal
VCECLB_PLC_Select_Input2
In2 signal
VCECLB_PLC_Select_Input3
In3 strobe
VCECLB_PLC_Select_Input4
In4 strobe
VCECLB_PLC_Select_PulseGen
Input from Pulse generator block
VCECLB_PLC_Select_Master
Input from Master block
VCECLB_PLC_Select_Slave
Input from Slave block
VCECLB_PLC_Select_MasterOrSlave
Input is result of Logical-Or operation on Master and Slave block output
VCECLB_PLC_Select_OC_PulseGen
Input from pulse generator block of another channel
VCECLB_PLC_Select_OC_Master
Input from Master block of another channel
VCECLB_PLC_Select_OC_Slave
Input from Slave block of another channel
VCECLB_PLC_Select_OC_MasterOrSlave
Input is result of Logical-Or operation on Master and Slave block output of another channel
VCECLB_PLC_Select_Strobe
Input from Strobe block


VCECLB_PLC_Input_DeglitchMode

Deglitch mode of input signal.
enum VCECLB_PLC_Input_DeglitchMode {
  VCECLB_PLC_Input_DeglitchMode_Disabled = = 0,
  VCECLB_PLC_Input_DeglitchMode_Debounce = = 1,
  VCECLB_PLC_Input_DeglitchMode_Filter = = 2
};

Enum values:

VCECLB_PLC_Input_DeglitchMode_Disabled
No deglitch pre-processing
VCECLB_PLC_Input_DeglitchMode_Debounce
Debounce deglitch logic
VCECLB_PLC_Input_DeglitchMode_Filter
Filter deglitch logic


VCECLB_PLC_PulseGen_Mode

Pulse generator mode.
enum VCECLB_PLC_PulseGen_Mode {
  VCECLB_PLC_PulseGen_Mode_Continuous = = 0,
  VCECLB_PLC_PulseGen_Mode_SendN = = 1
};

Enum values:

VCECLB_PLC_PulseGen_Mode_Continuous
Continuous mode
VCECLB_PLC_PulseGen_Mode_SendN


VCECLB_PLC_MasterSlave_SlaveSelect

Define Slave block source signal.
enum VCECLB_PLC_MasterSlave_SlaveSelect {
  VCECLB_PLC_MasterSlave_SlaveSelect_Trigger = = 0,
  VCECLB_PLC_MasterSlave_SlaveSelect_Master
};

Enum values:

VCECLB_PLC_MasterSlave_SlaveSelect_Trigger
Slave source is equal to master source
VCECLB_PLC_MasterSlave_SlaveSelect_Master
Slave source is master output


VCECLB_PLC_Command

Commands to send to PLC.

This commands works only if corresponding block's Select field set to Software

enum VCECLB_PLC_Command {
  VCECLB_PLC_Cmd_PulseGen_Start = = 0,
  VCECLB_PLC_Cmd_PulseGen_Stop,
  VCECLB_PLC_Cmd_Master,
  VCECLB_PLC_Cmd_Arm,
  VCECLB_PLC_Cmd_Strobe
};

Enum values:

VCECLB_PLC_Cmd_PulseGen_Start
Start Pulse Generator
VCECLB_PLC_Cmd_PulseGen_Stop
Stop Pulse Generator
VCECLB_PLC_Cmd_Master
Generate single Master and Slave signal
VCECLB_PLC_Cmd_Arm
Starts Arm Grab function
VCECLB_PLC_Cmd_Strobe
Starts Strobe function


VCECLB_PLC_Method

List of pre-defined methods.

Select predefined method to load. See User Manual for more information about each method and default values

enum VCECLB_PLC_Method {
  VCECLB_PLC_Method1 = =3,
  VCECLB_PLC_Method2 = =4,
  VCECLB_PLC_Method3 = =5,
  VCECLB_PLC_Method4 = =6,
  VCECLB_PLC_Method5 = =2,
  VCECLB_PLC_Method6 = =0,
  VCECLB_PLC_Method7 = =1,
  VCECLB_PLC_Method8 = =7,
  VCECLB_PLC_Method9 = =8,
  VCECLB_PLC_Method10 = =9,
  VCECLB_PLC_Method11 = =10,
  VCECLB_PLC_Method12 = =11,
  VCECLB_PLC_Method13 = =12,
  VCECLB_PLC_Method14 = =13,
  VCECLB_PLC_Method15 = =14,
  VCECLB_PLC_Method16 = =15
};

Enum values:

VCECLB_PLC_Method1
This method produces a free-running asynchronous periodic integration pulse to the camera. The width of the integration pulse represents the exposure time.
VCECLB_PLC_Method2
This method produces two free-running periodic consecutive integration pulses to the camera. The time interval between the start of the two pulses represents the exposure time.
VCECLB_PLC_Method3
This method produces a free-running periodic integration pulse on one output followed by a VD pulse on another output. The width of the integration pulse represents the exposure time.
VCECLB_PLC_Method4
This method produces a free-running periodic integration pulse on one output followed by a VD pulse on another output. The time interval between the start of the two pulses represents the exposure time.
VCECLB_PLC_Method5
This method produces a predefined number of asynchronous periodic integration pulses to the camera. The start of the pulses is controlled by an external input.
VCECLB_PLC_Method6
This method produces an asynchronous periodic integration pulse to the camera. The start is controlled by the rising edge of an external input and the stop by it's falling edge.
VCECLB_PLC_Method7
This method produces an asynchronous periodic integration pulse to the camera. The start of the pulses is controlled by one external input while another external input controls when the pulses stop.
VCECLB_PLC_Method8
This method produces an asynchronous integration pulse to the camera. The width of the pulse represents the exposure time and is controlled by an external signal.
VCECLB_PLC_Method9
This method produces an asynchronous integration pulse to the camera. The start of the pulse is controlled by an external input. The width of the pulse represents the exposure time.
VCECLB_PLC_Method10
This method produces an asynchronous integration pulse to the camera. The start of the pulse is controlled by an external input and is delayed. The width of the pulse represents the exposure time.
VCECLB_PLC_Method11
This method produces two consecutive integration pulses to the camera. The start of the pulses is controlled by an external input. The time interval between the start of the two pulses represents the exposure time.
VCECLB_PLC_Method12
This method produces an integration pulse on one output followed by a VD pulse on another output. The start of the pulses is controlled by an external input. The width of the integration pulse represents the exposure time.
VCECLB_PLC_Method13
This method produces an integration pulse on one output followed by a VD pulse on another output. The time interval between the start of the two pulses represents the exposure time.
VCECLB_PLC_Method14
This method produces an asynchronous reset/integration pulse to the camera. The start of the pulse is controlled by an external input. The frame grabber will ignore all frames delivered by the camera except for the one following the external input. The frame grabber will be arm'ed to acquire the start of the first frame delivered after the external input is presen
VCECLB_PLC_Method15
This method instructs the frame grabber to ignore all frames delivered by the camera except for a pre-defined number of frames following an external input. The frame grabber will be arm'ed to acquire the start of the first frame delivered after the external input is present. It will continue to acquire frames until the pre-defined number of frames have been acquired.
VCECLB_PLC_Method16
This method instructs the frame grabber to ignore all frames delivered by the camera except for the frames that are enveloped by an external input. The frame grabber will be arm'ed to acquire the start of the first frame delivered after the external input is present. It will continue to acquire frames until the external input is negated.


FrameLink Express PLC Structures

The following structures are used with FrameLink Express Programmable Logic Controller

Structure | Description
VCECLB_PLC_Time | Structure to represent timing values in PLC.
VCECLB_PLC_Input | Input signal definition.
VCECLB_PLC_PulseGen_Control | Pulse generator start/stop control.
VCECLB_PLC_PulseGen | Pulse Generator block definition.
VCECLB_PLC_MasterSlave | Master/Slave block definition.
VCECLB_PLC_ArmGrab | Arm grab block definition.
VCECLB_PLC_Strobe | Strobe block definition.
VCECLB_PLC_CC_OUT | CC and OUT strobes definition.
VCECLB_PLC | Programmable Logic Controller definition.
Define | Description
VCECLB_PLC_TIME_GRANULARITY_USEC | Granularity value for 1 uSec.
VCECLB_PLC_TIME_GRANULARITY_MSEC | Granularity value for 1 mSec.
VCECLB_PLC_TIME_GRANULARITY_SEC | Granularity value for 1 second.


VCECLB_PLC_TIME_GRANULARITY_USEC

Granularity value for 1 uSec.
#define VCECLB_PLC_TIME_GRANULARITY_USEC 100


VCECLB_PLC_TIME_GRANULARITY_MSEC

Granularity value for 1 mSec.
#define VCECLB_PLC_TIME_GRANULARITY_MSEC (1000*VCECLB_PLC_TIME_GRANULARITY_USEC)


VCECLB_PLC_TIME_GRANULARITY_SEC

Granularity value for 1 second.
#define VCECLB_PLC_TIME_GRANULARITY_SEC (1000*VCECLB_PLC_TIME_GRANULARITY_MSEC)


VCECLB_PLC_Time

Structure to represent timing values in PLC.
struct VCECLB_PLC_Time {
  ULONG Granularity;
  ULONG Value;
};

Members

Granularity

Time value granularity in 10 nanoseconds

Predefined values:

  • VCECLB_PLC_TIME_GRANULARITY_USEC - Granularity value for 1 microsecond
  • VCECLB_PLC_TIME_GRANULARITY_MSEC - Granularity value for 1 millisecond
  • VCECLB_PLC_TIME_GRANULARITY_SEC - Granularity value for 1 second

Value
Time value in units of granularity


VCECLB_PLC_Input

Input signal definition.
struct VCECLB_PLC_Input {
  VCECLB_PLC_Polarity Polarity;
  VCECLB_PLC_Input_DeglitchMode DeglitchMode;
  UCHAR DeglitchDelay;
};

Members

Polarity
Sets the polarity of the Input signal. A 'positive' polarity indicates the signal is active high ( Logic-1 ), while a 'negative' polarity indicates the signal is active low ( Logic-0 ).Input signal polarity
DeglitchMode
Determines if the input signal is to be pre-processed in order to remove any bouncing or glitches.
DeglitchDelay
Determines how much of a delay, in increments of 100 uSeconds, to apply to the Debounce or Filter logic.


VCECLB_PLC_PulseGen_Control

Pulse generator start/stop control.
struct VCECLB_PLC_PulseGen_Control {
  VCECLB_PLC_Select Select;
  VCECLB_PLC_Edge Edge;
};

Members

Select
Selects teh source that will control the Pulse Generator Possible values:
  • VCECLB_PLC_Select_Software
  • VCECLB_PLC_Select_Input1
  • VCECLB_PLC_Select_Input2
  • VCECLB_PLC_Select_Input3
  • VCECLB_PLC_Select_Input4
Edge

Determine which edge of the signal, selected by Select field, will control the Pulse Generator

Possible values:

  • VCECLB_PLC_Edge_Rising
  • VCECLB_PLC_Edge_Falling


VCECLB_PLC_PulseGen

Pulse Generator block definition.
struct VCECLB_PLC_PulseGen {
  int Enable;
  VCECLB_PLC_PulseGen_Mode Mode;
  VCECLB_PLC_Time Period;
  ULONG Count;
  VCECLB_PLC_PulseGen_Control Start;
  VCECLB_PLC_PulseGen_Control Stop;
};

Members

Enable
Enables Pulse Generator
Mode
Determines whether the Pulse Generator will send a continuous stream of pulses or will send only 'N' pulses, where 'N' is defined by the Count field.
Period
Defines pulse generator period
Count
Number of pulses to generate if Mode is set to VCECLB_PLC_PulseGen_Mode_SendN
Start
Determines signal parameters to start the Pulse Generator
Stop
Determines signal parameters to stop the Pulse Generator


VCECLB_PLC_MasterSlave

Master/Slave block definition.
struct VCECLB_PLC_MasterSlave {
  int Enable;
  VCECLB_PLC_Select Select;
  VCECLB_PLC_Edge Detect;
  VCECLB_PLC_Time MasterDelay;
  VCECLB_PLC_Time MasterDuration;
  VCECLB_PLC_MasterSlave_SlaveSelect SlaveSelect;
  VCECLB_PLC_Edge SlaveDetect;
  VCECLB_PLC_Time SlaveDelay;
  VCECLB_PLC_Time SlaveDuration;
};

Members

Enable
Enables Master/Slave block
Select

Selects the source of the Master/Slave pulse generator.

Possible values:

  • VCECLB_PLC_Select_Software
  • VCECLB_PLC_Select_Input1
  • VCECLB_PLC_Select_Input2
  • VCECLB_PLC_Select_Input3
  • VCECLB_PLC_Select_Input4
  • VCECLB_PLC_Select_PulseGen

Detect

Determines which edge of the signal, selected by the TrgSelect variable, will be routed to the Master/Slave pulses.

Possible values:

  • VCECLB_PLC_Edge_Rising
  • VCECLB_PLC_Edge_Falling

MasterDelay
Delay of master pulse
MasterDuration
Duration (width) of master pulse
SlaveSelect
Selects the source of the Slave Pulse signal.
SlaveDetect

Determines which edge of the input signal,selected by the SlvSelect variable, will be routed to the SlvPulse signal.

Possible values:

  • VCECLB_PLC_Edge_Rising
  • VCECLB_PLC_Edge_Falling

SlaveDelay
Delay of slave pulse
SlaveDuration
Duration (width) of slave pulse


VCECLB_PLC_ArmGrab

Arm grab block definition.
struct VCECLB_PLC_ArmGrab {
  int Enable;
  VCECLB_PLC_Select Select;
  VCECLB_PLC_Edge Detect;
  VCECLB_PLC_Time Delay;
  int CountEnable;
  ULONG FrameCount;
};

Members

Enable
Enables Arm Grab block
Select

Selects the source to be used by the Arm Grabbing function.

Possible values:

  • VCECLB_PLC_Select_Software
  • VCECLB_PLC_Select_Input1
  • VCECLB_PLC_Select_Input2
  • VCECLB_PLC_Select_Input3
  • VCECLB_PLC_Select_Input4
  • VCECLB_PLC_Select_Master
  • VCECLB_PLC_Select_Slave Note: the PulseGen input is not listed here!

Detect
Determines which edge of the input signal, selected by the ArmSelect variable, will be used by the Arm Grabbing function.
Delay
Defines function delay
CountEnable
When non-zero, instructs the PLC to reset the ArmGrab signal after a programmed number of frames been acquired. The number of frames is determined by the FrameCount field.
FrameCount
The number of frames to acquire, if the CountEnable variable is non-zero.


VCECLB_PLC_Strobe

Strobe block definition.
struct VCECLB_PLC_Strobe {
  int Enable;
  VCECLB_PLC_Select Select;
  VCECLB_PLC_Edge Detect;
  VCECLB_PLC_Time Delay;
  VCECLB_PLC_Time Duration;
};

Members

Enable
Enables Strobe block
Select

Selects the source to be used by the Strobe function.

Possible values:

  • VCECLB_PLC_Select_Software
  • VCECLB_PLC_Select_Input1
  • VCECLB_PLC_Select_Input2
  • VCECLB_PLC_Select_Input3
  • VCECLB_PLC_Select_Input4
  • VCECLB_PLC_Select_Master
  • VCECLB_PLC_Select_Slave Note: the PulseGen input is not listed here!

Detect

Determines which edge of the input signal, selected by the ArmSelect variable, will be used by the Arm Grabbing function.

Possible values:

  • VCECLB_PLC_Edge_Rising
  • VCECLB_PLC_Edge_Falling

Delay
Defines function delay
Duration
Defince strobe signal duration


VCECLB_PLC_CC_OUT

CC and OUT strobes definition.
struct VCECLB_PLC_CC_OUT {
  VCECLB_PLC_Select Select;
  VCECLB_PLC_Polarity Polarity;
  UCHAR Control;
};

Members

Select

Selects the source to route to output strobe

Possible values: All but PulseGenerator values

Polarity
Sets the polarity of the output signal. A 'positive' polarity indicates the signal is active high ( Logic-1 ), while a 'negative' polarity indicates the signal is active low ( Logic-0 ).
Control
Sets the state (0 or 1) of the output signal. This signal can then be mapped to the output by selecting the Software option in the Select field.


VCECLB_PLC

Programmable Logic Controller definition.
struct VCECLB_PLC {
  int Enable;
  VCECLB_PLC_Input Input[4];
  VCECLB_PLC_PulseGen PulseGen;
  VCECLB_PLC_MasterSlave MasterSlave;
  VCECLB_PLC_ArmGrab ArmGrab;
  VCECLB_PLC_Strobe Strobe;
  VCECLB_PLC_CC_OUT CC[4];
  VCECLB_PLC_CC_OUT Out[4];
};

Members

Enable
When set, instructs the FPGA to enable the entire PLC circuit.
Input
Definition of input[1:4] strobes
PulseGen
Definition of Pulse Generator block
MasterSlave
Definition of Master/Slave block
ArmGrab
Definition of Arm Grabbing block
Strobe
Definition of Strobe block
CC
Definition of CC[1:4] output block
Out
Definition of Out[1:4] strobes


FrameLink Express PLC Functions

The following functions are used with FrameLink Express Programmable Logic Controller

Function | Description
VCECLB_PLC_Set | Sets Programmable Logic Controller parameters.
VCECLB_PLC_Get | Retrieves current Programmable Logic Controller parameters.
VCECLB_PLC_SendCommand | Sends software command to Programmable Logic Controller.
VCECLB_PLC_GetPredefinedMethod | Loads values for predefined Programmable Logic Controller methods.
VCECLB_PLC_GetStatus | Sends software command to Programmable Logic Controller.
Define | Description
PLC_STATUS_PG_RUNNING |


VCECLB_PLC_Set

Sets Programmable Logic Controller parameters.

VCECLB_Error VCECLB_CALL VCECLB_PLC_Set(
  HANDLE hVCECLB,
  char port,
  const VCECLB_PLC * pPLC,
  UINT64 unused
);

Parameters

hVCECLB
Handle to frame grabber
port
Port number
pPLC
Pointer to Programmable Logic Controller definition structure
unused
Unused parameter, should be set to zero

Return Values:

The return value is the error code.


VCECLB_PLC_Get

Retrieves current Programmable Logic Controller parameters.

VCECLB_Error VCECLB_CALL VCECLB_PLC_Get(
  HANDLE hVCECLB,
  char port,
  VCECLB_PLC * pPLC
);

Parameters

hVCECLB
Handle to frame grabber
port
Port number
pPLC
Pointer to Programmable Logic Controller definition structure

Return Values:

The return value is the error code.


VCECLB_PLC_SendCommand

Sends software command to Programmable Logic Controller.

VCECLB_Error VCECLB_CALL VCECLB_PLC_SendCommand(
  HANDLE hVCECLB,
  char port,
  VCECLB_PLC_Command command
);

Parameters

hVCECLB
Handle to frame grabber
port
Port number
command
Command to send

Return Values:

The return value is the error code.


VCECLB_PLC_GetPredefinedMethod

Loads values for predefined Programmable Logic Controller methods.

This function fills structure with default values and links between blocks for specified method. For more information about method and default values see User Manual

VCECLB_Error VCECLB_CALL VCECLB_PLC_GetPredefinedMethod(
  VCECLB_PLC_Method method,
  VCECLB_PLC * pPLC
);

Parameters

method
Method to load
pPLC
Pointer to Programmable Logic Controller definition structure

Return Values:

The return value is the error code.


VCECLB_PLC_GetStatus

Sends software command to Programmable Logic Controller.

VCECLB_Error VCECLB_CALL VCECLB_PLC_GetStatus(
  HANDLE hVCECLB,
  char port,
  unsigned __int64 * io_status
);

Parameters

hVCECLB
Handle to frame grabber
port
Port number
io]
status Status to read

Return Values:

The return value is the error code.


PLC_STATUS_PG_RUNNING

#define PLC_STATUS_PG_RUNNING 0x00000001


FrameLink Express Power over CameraLink (PoCL)

The following functions, structures and enums are used with FrameLink Express Power over CameraLink

Structure | Description
VCECLB_PoCL_State | State of PoCL.
Function | Description
VCECLB_PoCL_Enable | Enable or disable Power over CameraLink on specific port.
VCECLB_PoCL_IsEnable | Check if Power over CameraLink is enabled on specific port.
VCECLB_PoCL_GetState | Retrieves current state of Power over CameraLink controller.
Define | Description
VCECLB_PoCL_Enable_OFF |
VCECLB_PoCL_Enable_PORT_1 |
VCECLB_PoCL_Enable_PORT_2 |
VCECLB_PoCL_Enable_PORT_1_2 |


VCECLB_PoCL_Enable

Enable or disable Power over CameraLink on specific port.

VCECLB_Error VCECLB_CALL VCECLB_PoCL_Enable(
  HANDLE hVCECLB,
  char port,
  UCHAR enable
);

Parameters

hVCECLB
Handle to frame grabber
port
Port number
enable
Non-zero value to enable PoCL, zero to disable PoCL

Return Values:

The return value is the error code.


VCECLB_PoCL_IsEnable

Check if Power over CameraLink is enabled on specific port.

VCECLB_Error VCECLB_CALL VCECLB_PoCL_IsEnable(
  HANDLE hVCECLB,
  char port,
  UCHAR * pEnable
);

Parameters

hVCECLB
Handle to frame grabber
port
Port number
pEnable
Pointer to variable to recieve curremt PoCL state

Return Values:

The return value is the error code.


VCECLB_PoCL_GetState

Retrieves current state of Power over CameraLink controller.

VCECLB_Error VCECLB_CALL VCECLB_PoCL_GetState(
  HANDLE hVCECLB,
  char port,
  VCECLB_PoCL_State * pState
);

Parameters

hVCECLB
Handle to frame grabber
port
Port number
pState
Pointer to structure to recieve current the state of PoCL

Return Values:

The return value is the error code.


VCECLB_PoCL_Enable_OFF

#define VCECLB_PoCL_Enable_OFF 0x0


VCECLB_PoCL_Enable_PORT_1

#define VCECLB_PoCL_Enable_PORT_1 0x1


VCECLB_PoCL_Enable_PORT_2

#define VCECLB_PoCL_Enable_PORT_2 0x2


VCECLB_PoCL_Enable_PORT_1_2

#define VCECLB_PoCL_Enable_PORT_1_2 0x3


VCECLB_PoCL_State

State of PoCL.
struct VCECLB_PoCL_State {
  UCHAR SafePower;
  UCHAR StdVsense;
  UCHAR POCL_Vsense;
  UCHAR POCL_VsenseLow;
  UCHAR POCL_VsenseHigh;
  UCHAR POCL_FuseTrip;
};

Members

SafePower
Status of SafePower state machine
StdVsense
1 - Vsense < 100 mV
POCL_Vsense
1 - 400mV < Vsense < 600 mV
POCL_VsenseLow
1 - Vsense > 400 mV
POCL_VsenseHigh
1 - Vsense > 600 mV
POCL_FuseTrip
  • 0 - fuse is not tripped
    • 1 - fuse is tripped


FrameLink Express SDK Help Manual

VCECLB_H

#define VCECLB_H