230
20.4.2.2 Programming the pulse width modulation
You will need two timers and you have to set a trigger.
• Timer1 defines the interval between two triggers.
• Timer2 generates the trigger pulse at the end of Timer1.
The following sample shows a trigger
• which is generated every second and
• the pulse width is 10 ms:
#include <mvIMPACT_CPP/mvIMPACT_acquire.h>
#include <mvIMPACT_CPP/mvIMPACT_acquire_GenICam.h>
...
// Master: Set timers to trig image: Start after queue is filled
GenICam::CounterAndTimerControl catcMaster(pDev);
catcMaster.timerSelector.writeS(
catcMaster.timerDelay.write( 0. );
catcMaster.timerDuration.write( 1000000. );
catcMaster.timerTriggerSource.writeS(
catcMaster.timerSelector.writeS(
catcMaster.timerDelay.write( 0. );
catcMaster.timerDuration.write( 10000. );
catcMaster.timerTriggerSource.writeS(
See also
Counter And Timer Control (p. 113)
Note
Make sure the Timer1 interval must be larger than the processing time. Otherwise, the images are lost.
Now, the two timers will work like the following figure illustrates, which means
• Timer1 is the trigger event and
• Timer2 the trigger pulse width:
The timers are defined, now you have to set the digital output, e.g. "Line 0":
// Set Digital I/O
GenICam::DigitalIOControl io(pDev);
io.lineSelector.writeS(
io.lineSource.writeS(
See also
Digital I/O Control (p. 120)
This signal has to be connected with the digital inputs of the application.
"Timer1"
);
"Timer1End"
"Timer2"
);
"Timer1End"
Figure 1: Timers
"Line0"
);
"Timer2Active"
);
);
);
CONTENTS
MATRIX VISION GmbH
Need help?
Do you have a question about the mvBlueFOX3 and is the answer not in the manual?