IDeviceControl Interface

<< Click to Display Table of Contents >>

Navigation:  Image Manager > CVB Technology > Acquisition device drivers and CVB Programming Interfaces >

IDeviceControl Interface

 

IDeviceControl Interface: controlling hardware settings

 
The IDeviceControl interface offers the possibility to set or change hardware (i.e. camera) parameters directly over CVB.

 

The IDeviceControl Interface can be accessed through DCStrCommand and DCBinaryCommand function of the CVB Driver Library or over CV Grabber ActiveX Control - SendStringCommand or SendBinaryCommand method.

 

The complete list of available command values can be found in the driver specific iDC_*.h header file.

Refer always to the CVB Driver User Guide for your image acquisition device to check the list of supported interfaces. It contains all IDeviceControl definitions for the VIN driver for use with DCStrCommand and DCBinaryCommand functions of the Image Manager as well as the SendBinaryCommand and SendStringCommand methods of the grabber ocx.

 

Often used command strings are listed here :   

 

DC_BUFFER_INFO_TIMESTAMP 

This is the time stamp received from the acquisition hardware saved to the acquired buffer in the memory.

 

DC_BUFFER_INFO_IMAGEID 

This is the image id received from the acquisition hardware saved to the acquired buffer in the memory.

 

DC_BUFFER_INFO_NUM_PACKETS_MISSING 

This is the number of missing packets from the image transfer of a GigE Vision camera related to the acquired image of the currently used buffer.

 

Command ID can be tested over the Grabber Properties window in CVB Viewer or over CVB Image Manager Tutorials VC Sizeable Display example, VBGrabber.NET or one of the following code examples.

 

For GenICam vin driver use the iDC_GenICam.h in %CVB%Lib\C

Send command DC_BUFFER_INFO_DELIVERED_WIDTH = 0x00001200, Command Answer results 1400, this is the delivered image width value of the connected GenICam device.

GrabberControl

 

VC++ Example Code: retrieve ImageID (from the VC++ GenICam Simple Demo)

long outSize = sizeof(__int64);

__int64 outParam = 0;

 

// Send command  DC_BUFFER_INFO_IMAGEID   = 0x00000900

if (m_cvGrabber.SendBinaryCommand(DeviceCtrlCmd(0x00000900, DC_GET), NULL,0, reinterpret_cast<long*>(&outParam), &outSize))

{

  // Print obtained value

  cout << " ImgID: " << outParam;

}

 

VC++ Example Code: retrieve lost packets from last frame

bool LastBufferCorrupt(IMG hDriver)

{

  cvbuint64_t packetsMissing = 0;

  size_t size = sizeof(cvbuint64_t);

  cvbres_t result = DCBinaryCommand(hDriver,DeviceCtrlCmd(DC_BUFFER_INFO_NUM_PACKETS_MISSING, DC_GET),NULL,0,&packetsMissing, size);

  return result >= 0 && packetsMissing > 0;

}

 

DCBinaryCommand function sends the binary command directly to the CVB driver.
It has to be called twice when working with output buffer size (first call with iInBufSize NULL and second call with resulted iOutBufSize as iInBufSize)

 

If you use the CV Grabber Control, the SendStringCommand method is similar to the DCStrCommand function of the Driver Dll.

IDeviceControl Commands

Beside accessing all different parameters by the GenApi interface some other commands are supported to give extra information.

 

DC_DEVICE_PORT_NODEMAP

returns the node map handle of the camera xml. This handle is returned when the configuration generates a valid GenApi xml file.
If no valid xml file could be found a NULL pointer is returned.
A custom xml can be used by defining it in the ini file.

 

DC_DEVICE_NODEMAP

returns the Nodemap handle to the DMA/Board xml.
This handle is returned when the configuration generates a valid GenApi xml file.
If no valid xml file could be found a NULL pointer is returned.
A custom xml can be used by defining it in the ini file.

 

These commands return special single values:

 

DC_BUFFER_INFO_TIMESTAMP

this command returns the time stamp of the last frame buffer acquired in µs.

 

DC_BUFFER_INFO_IMAGEID 

frame ID is the number of the acquired image frame increased in steps of 1. Starts with 1.