IDeviceControl Interface

<< Click to Display Table of Contents >>

Navigation:  CVB with GenICam > SDK > Supported Interfaces - GenICam Driver >

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 the CV Grabber Control or the Driver-DLL using :

DCStrCommand and DCBinaryCommand function of the Driver-Dll  or

CV Grabber Control - SendStringCommand or SendBinaryCommand method.

Refer Common Vision Blox Manual Image Manager documentation for details.

 

Avaialble command values : The complete list can be found in the specific %CVB%Lib\iDC_*.h header file.
For example, the %CVB%Lib\iDC_GenICam.h for GenICam devices.

 

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.

 

DC_BUFFER_INFO_DELIVERED_TRAILER_HEIGHT
This parameter is for variable image height. It can be used for LineScan cameras to know how many lines are valid in the buffer.

 

Command ID can be tested also over the Grabber Properties window in CVB Viewer or VC Sizable Display example in %CVB%Tutorial\Image Manager\VC.

 

IDeviceControl

 

A description of the command types can be found in the Common Vision Blox Manual.

To test the feature please use the CVB Image Manager Tutorial : VB Grabber OCX or one of the following examples :

 

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;

}

 

VC++ Example Code: read the variable Image Height for Line Scan Cameras

#include <IDC_GenICam.h>

 

{

cvbuint64_t imageHeight = 0;

size_t size = sizeof(cvbuint64_t);

cvbres_t result = DCBinaryCommand(m_Img, 
DeviceCtrlCmd(DC_BUFFER_INFO_DELIVERED_TRAILER_HEIGHT, DC_GET),
NULL,0, 
&imageHeight,size);

}