The following pseudocode demonstrates using a Rising Edge counter event to track the number of rising edges signals received on Line 0. A second counter is enabled to track the number of Exposure Start events that occurred to indicate the number of images captured.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | // Connect to camera
// Get device node map
// Use Counter0 to count rising edges received on Line0
CounterSelector = Counter0;
CounterEventSource = Line0;
CounterEventActivation = RisingEdge;
CounterTriggerSource = AcquisitionStart; // Start this counter at the camera's AcquisitionStart
CounterDuration = 1;
CounterValue = 1; // Start at CounterValue = CounterDuration (e.x. increment the counter until we reset it)
// Use Counter1 to count ExposureStart events occurring on camera
CounterSelector = Counter1;
CounterEventSource = ExposureStart;
CounterEventActivation = RisingEdge;
CounterTriggerSource = AcquisitionStart; // Start this counter at the camera's AcquisitionStart
CounterDuration = 1;
CounterValue = 1; // Start at CounterValue = CounterDuration (e.x. increment the counter until we reset it)
// Enable Rising Edge trigger on Line0
TriggerSelector = FrameStart;
TriggerSource = Line0;
TriggerActivation = RisingEdge;
TriggerMode = On;
AcquisitionStart();
// Acquire images by sending pulses to Line0
AcquisitionStop();
// To read rising edge pulses received:
// CounterSelector = Counter0
// Read CounterValue
// To read images captured:
// CounterSelector = Counter1
// Read CounterValue
// CounterValue for Counter0 should equal CounterValue for Counter1. If not we missed a trigger signal.
|