xiMU - Technical Manual Version 2.10
64
figure 4-13, synchronized acquisition - schematic
xiAPI Example:
HANDLE handle1,handle2;
// open both cameras
xiOpenDevice(0, &handle1);
xiOpenDevice(1, &handle2);
// set trigger mode on camera1 - as master
xiSetParamInt(handle1, XI_PRM_TRG_SOURCE, XI_TRG_SOFTWARE);
xiSetParamInt(handle1, XI_PRM_GPO_SELECTOR, 1);
xiSetParamInt(handle1, XI_PRM_GPO_MODE, XI_GPO_FRAME_ACTIVE);
// set trigger mode on camera2 - as slave
xiSetParamInt(handle2, XI_PRM_TRG_SOURCE, XI_TRG_EDGE_FALLING);
xiSetParamInt(handle2, XI_PRM_GPI_SELECTOR, 1);
xiSetParamInt(handle2, XI_PRM_GPI_MODE, XI_GPI_TRIGGER);
// start
xiStartAcquisition(handle1);
xiStartAcquisition(handle2);
Sleep(1234);
// wait for right moment to trigger the exposure
// trigger acquisition on Master camera
xiSetParamInt(handle1, XI_PRM_TRG_SOFTWARE, 0);
// get image from both cameras
xiGetImage(handle1, 100, &image1);
xiGetImage(handle2, 100, &image2);
// process images here
xiCloseDevice(handle1);
xiCloseDevice(handle2);
Timing diagram shows the Trigger event, Camera1 and Camera2 Status, Exposure Active Signal from Camera1:
figure 4-14, synchronized acquisition
–
timing diagram
Digital Input
Trigger
Digital Output
Exposure Active
Software Trigger
Camera 1
PC with
application
Camera 2
Set
Ready
Exposure
Data readout
Ready
Ready
Exposure
Data readout
Ready
Exp.Active
Camera 1 Status
Camera 2 Status
Camera 1
Exposure Active Signal
Application set
XI_PRM_TRG_SOFTWARE