User manual

Chapter 3 Software Overview
© National Instruments Corporation 3-83 NI-DAQ User Manual for PC Compatibles
Another major category of counter functions is pulse generation. With the
NI-DAQ counter functions, you can call
CTR_Pulse
to generate a pulse
or
CTR_Square
to generate a train of pulses (a square wave). To generate
a pulse or a square wave, see Figure 3-29 for details on the function flow.
When
CTR_Square
is used with special gating (gateMode = 8), you can
achieve gate-controlled pulse generation. When the gate input is high,
NI-DAQ uses period1 to generate the pulses. When the gate input is
low, NI-DAQ uses period2 to generate the pulses. If the output mode is
TC Toggled, the result is two 50 percent duty square waves of different
frequencies. If the output mode is TC Pulse, the result is two pulse trains
of different frequencies.
Figure 3-29. Pulse Generation
CTR_Config
CTR_Pulse
CTR_Rate
CTR_Reset
Generate a new pulse or a
new pulse train?
Single pulse generation?
NoYes
Generate a pulse
Convert frequency
to timebase and
period intervals.
No
Yes
Terminate pulse generation.
CTR_Square
Start pulse train
generation.
Configure the pulse counter.