// start the data acquisition
XI_RETURN xiStartAcquisition(IN HANDLE hDevice);
// acquire image and return image information
XI_RETURN xiGetImage(IN HANDLE hDevice, IN DWORD TimeOut, INOUT XI_IMG * img);
// stop the data acquisition
XI_RETURN xiStopAcquisition(IN HANDLE hDevice);
// close interface
XI_RETURN xiCloseDevice(IN HANDLE hDevice);
xiAPI parameters description
For a complete list of available parameters, please visit the xiAPI online manual at
http://www.ximea.com/support/wiki/apis/XiAPI_Manual
All functions in xiAPI return status values in form of the XI_RETURN structure which is defined in xiApi.h. If a parameter is not supported by
a certain camera, the return value will represent a respective error code (e.g. 106 - Parameter not supported).
Note:
Since xiAPI is a unified programming interface for all of XIMEA‘s cameras, not all of the described parameters apply for every camera
and sensor model.
xiAPI examples
Connect device
This example shows the enumeration of available devices. If any device was found the first device (with index 0) is opened.
HANDLE xiH = NULL;
// Get number of camera devices
DWORD dwNumberOfDevices = 0;
xiGetNumberDevices(&dwNumberOfDevices);
if (!dwNumberOfDevices)
{
printf("No camera found\n");
}
else
{
// Retrieving a handle to the camera device
xiOpenDevice(0, &xiH);
}
Parameterize device
This example shows how an exposure time is set. Next, the maximum possible downsampling rate is retrieved and the result is set as new
downsampling rate.
// Setting "exposure" parameter (10ms)
int time_us = 10000;
xiSetParam(xiH, XI_PRM_EXPOSURE, &time_us, sizeof(time_us), xiTypeInteger);
// Getting maxium possible downsampling rate
int dspl_max = 1;
xiGetParamInt(xiH, XI_PRM_DOWNSAMPLING XI_PRM_INFO_MAX, &dspl_max);
// Setting maxium possible downsampling rate
xiSetParamInt(xiH, XI_PRM_DOWNSAMPLING, dspl_max);
XIMEA Technical Manual, Version: v230927
75