xiB & xiB-64 - Technical Manual Version 1.06
88
5.7.4.
xiAPI Parameters Description
For a complete list of available parameter, please visit the xiAPI online manual at
http://www.ximea.com/support/wiki/apis/XiAPI_Manual
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.
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).
5.7.5.
xiAPI Examples
5.7.5.1.
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);
}
5.7.5.2.
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);