HomeSupportVision LibrariesNational Instruments LabVIEW → XIMEA LabVIEW Demo Application Manual

XIMEA LabVIEW Demo Application Manual

XIMEA Virtual Instruments (VIs).

OpenDevice


Parameters:

device id index of the device
hDevice handle to device

C Prototype:
int OpenDevice(UINT32 device_id, UINT32 * hDevice);
Description:
This function initializes the device and returns a device handle.

CloseDevice


Parameters:

hDevice handle to device

C Prototype:
int CloseDevice(UINT32 hDevice);
Description:
This function uninitializes the specified device, closes its handle and releases allocated resources.

SetMode

This VI was replaced in V2_10 of XIMEA API Software Package with VI - SetDownsampling.

GetNumberDevices


Parameters:

pNumberDevices number of connected devices

C Protopype:
int GetNumberDevices(UINT32 * pNumberDevices);
Description:
This function returns the number of devices connected to PC.

StartAcquisition


Parameters:

hDevice handle to device

C Prototype:
int StartAcquisition(UINT32 hDevice);
Description:
This function starts the data acquisition on the devices specified by the handle.

StopAcquisition


Parameters:

hDevice handle to device

C Prototype:
int StopAcquisition(UINT32 hDevice);
Description:
This function stops the work cycle and data acquisition on the device.

GetImage


Parameters:

hDevice handle to device
timeout maximum time to wait new image in milliseconds
ImageData pointer to image array
buffer_size size of image array(in bytes)

C Prototype:
int GetImage(UINT32 hDevice, UINT32 timeout, void * ImageData, UINT32 buffer_size);
Description:
This function acquires image and copies it to ImageData array.

SetDownsampling


Parameters:

hDevice handle to device
ds downsampling factor

C Prototype:
int SetDownsampling(UINT32 hDevice, UINT32 ds);
Description:
This function sets downsampling factor (binning or skipping).

Example: When sensor gives 1024x640 pixels, then with downsampling factor 2 the result image will have 512x320 pixels.

SetExposure


Parameters:
hDevice handle to device
exposure integration time (in microseconds)

C Prototype:
int SetExposure(UINT32 hDevice, UINT32 exposure);
Description:
This function sets integration time.

SetGain


Parameters:

hDevice handle to device
gain gain (in dB)

C Prototype:
int SetGain(UINT32 hDevice, double gain);
Description:
This function sets gain.

SetROI


Parameters:

hDevice handle to device
x0 x (horizontal) coordinate of the top-left origin of ROI, used for image clipping
y0 y (vertical) coordinate of the top-left origin of ROI, used for image clipping
cx width of the ROI image area
cy height of the ROI image area

C Prototype:
int SetROI(UINT32 hDevice, UINT32 x0, UINT32 y0, UITN32 cx, UINT32 cy);
Description:
This function sets position and size of region of interest.

GetImageAttributes


Parameters:

hDevice handle to device
width current mode width
height current mode height

C Prototype:
int GetImageAttributes(UINT32 hDevice, UINT32 width, UINT32 height);
Description:
This function returns current mode width and height.

GetGainInfo


Parameters:

hDevice handle to device
fLow lower bound gain value in dB
fHigh upper bound gain value in dB

C Prototype:
int GetGainInfo(UINT32 hDevice, double fLow, double fHigh);
Description:
This function retrieves the gain information of the device.

SetTrigger


Parameters:

hDevice handle to device
mode trigger mode (0=free run, 1=hardware trigger “positive edge”, 2=hardware trigger ‘negative edge”, 3=software trigger)

C Prototype:
int SetTrigger(UINT32 hDevice, UINT32 mode);
Description:
This function sets the trigger mode.

PingTrigger


Parameters:

hDevice handle to device

C Prototype:
int PingTrigger(UINT32 hDevice);
Description:
This function performs a software trigger event.

DoBadPixelCorrection


Parameters:
hDevice handle to device
bpl on/off bad pixel correction

C Prototype:
int DoBadPixelCorrection(UINT32 hDevice, int bpl);
Description:
This function performs bad pixel correction.

TakeWhiteBalance


Parameters:

hDevice handle to device
Kr red coefficient
Kg green coefficient
Kb blue coefficient

C Prototype:
int TakeWhiteBalance(UINT32 hDevice, double * Kr, double * Kg, double * Kb);
Description:
This function calculates white balance coefficients.

SetCooling


Parameters:

hDevice handle to device
temperature temperature
bOn On/Off cooling

C Prototype:
int SetCooling(UINT32 hDevice, float temp, UINT32 bOn);
Description:
Allows the user to cool device to specific tagt temperature.

SetDataFormat


Parameters:

hDevice handle to device
format output data format(0=mono8,1=mono16,
2=RGB32).

C Prototype:
int SetDataFormat(UINT32 hDevice, UINT32 format);
Description:
Sets output data format.

SetGPIO


Parameters:

hDevice handle to device
gpio #gpio
state gpio state
gpi1 = trigger, gpi2 = external event, gpi3 = off, gpi4 = off
gpo1 = 0, gpo2 = 1, gpo3 = 1, gpo4 = strobe out (0 - gpo zero, 1 – gpo one, 2 – gpi external event, 3 – gpo strobe out, 4 – gpi trigger, 5 – gpo strobe out inv., 6 – gpo integration time, 7 – gpo integration time inv., 8 – gpi off)

C Prototype:
int SetGPIO(UINT32 hDevice, UINT32 gpio, UINT32 state);
Description:
Sets GPIO state.

SetLED


Parameters:

hDevice handle to device
gpio #led
state led functionality
led1 = busy, led2 = heartbeat
(0-HB,1-trigger,2-ext_event,3-data streaming,4-integration,5-busy,6-link ok,7-off,8-on)

C Prototype:
int SetLED(UINT32 hDevice, UINT32 gpio, UINT32 state);
Description:
Sets LED functionality.

EnableHDR


Parameters:

hDevice handle to device
hdr enables HDR feature

C Prototype:
int EnableHDR(UINT32 hDevice, UINT32 hdr);
Description:
Enables/Disables HDR feature.

EnableLUT


Parameters:

hDevice handle to device
lut enables LUT feature

C Prototype:
int EnableLUT(UINT32 hDevice, UINT32 lut);
Description:
Enables/Disables LUT feature.

SetLUT


Parameters:

hDevice handle to device
input input LUT parameter(max 4095)
output output(max 256)

C Prototype:
int SetLUT(UINT32 hDevice, UINT32 input, UINT32 output);
Description:
Sets LUT values (12bit or 10bit LUt to 8 bit).

Error codes

0 Function call succeeded
1 Invalid handle
2 Register read error
3 Register write error
4 Freeing resiurces error
5 Freeing channel error
6 Freeing bandwith error
7 Read block error
8 Write block error
9 No image
10 Timeout
11 Invalid arguments supplied
12 Not supported
13 Attach buffers error
14 Overlapped result
15 Memory allocation error
16 DLL context is NULL
17 DLL context is non zero
18 DLL context exists
19 Too many devices connected
20 Camera context error
21 Unknown hardware
22 Invalid TM file
23 Invalid TM tag
24 Incomplete TM
25 Bus reset error
26 Not implemented
27 Shading too bright
28 Shading too dark
29 Gain is too low
30 Invalid bad pixel list
31 Bad pixel list realloc error
32 Invalid pixel list
33 Invalid Flash File System
34 Invalid profile
35 Invalid calibration
36 Invalid buffer
38 Invalid data
39 Timing generator is busy
40 Wrong operation open/write/read/close
41 Acquisition already started
42 Old version of device driver installed to the system.
43 To get error code please call GetLastError function.
44 Data can't be processed
45 Error occured and acquisition has been stoped or didn't start.
46 Acquisition has been stoped with error.