National Instruments 321645c-01 Welding System User Manual


 
Chapter 2 Function Reference CTR_Pulse
©
National Instruments Corporation 2-101 NI-DAQ FRM for PC Compatibles
8: SOURCE3 used as timebase if 1 ctr 5 or SOURCE 8 used as timebase
if 6 ctr 10.
9: SOURCE4 used as timebase if 1 ctr 5 or SOURCE 9 used as timebase
if 6 ctr 10.
10: SOURCE5 used as timebase if 1 ctr 5 or SOURCE 10 used as timebase
if 6 ctr 10.
11: GATE 1 used as timebase if 1 ctr 5 or GATE6 used as timebase if
6 ctr 10.
12: GATE 2 used as timebase if 1 ctr 5 or GATE7 used as timebase if
6 ctr 10.
13: GATE 3 used as timebase if 1 ctr 5 or GATE8 used as timebase if
6 ctr 10.
14: GATE 4 used as timebase if 1 ctr 5 or GATE9 used as timebase if
6 ctr 10.
15: GATE 5 used as timebase if 1 ctr 5 or GATE10 used as timebase if
6 ctr 10.
Set timebase to 0 to concatenate counters. Set timebase to 1 through 5 for the counter to use
one of the five available internal signals. Set timebase to 6 through 15 (except 10 for the
PC-TIO-10) to provide an external clock to the counter.
delay is the delay before NI-DAQ generates the pulse. delay can be between 3 and 65,535.
Use the following formula to determine the actual time period that delay represents:
delay
*
(timebase resolution)
pulseWidth is the width of the pulse NI-DAQ generates. pulseWidth can be between 0 and
65,535. Use the following formula to determine the actual time that pulseWidth represents:
pulseWidth
*
(timebase resolution)
for 1 pulseWidth 65,535. pulseWidth = 0 is a special case of pulse generation and
actually generates a pulse of infinite duration (see the timing diagrams in Figures 2-9
and 2-10).
Using This Function
CTR_Pulse sets up the counter to generate a pulse of the duration specified by pulseWidth,
after a time delay of the duration specified by delay. If you specify no gating,
CTR_Pulse
starts the counter; otherwise, counter operation is controlled by the gate input. The selected
timebase determines the timing of pulse generation as shown in Figure 2-9.
You can generate successive pulses by calling
CTR_Restart or CTR_Pulse again. Be sure
that the delay period of the previous pulse has elapsed before calling
CTR_Restart or
CTR_Pulse. A successive call waits until the previous pulse is completed before generating
the next pulse. In the case where pulseWidth = 0 and TC toggle output is used, the output
polarity toggles after every call to
CTR_Restart.