National Instruments 321645c-01 Welding System User Manual


 
Chapter 2 Function Reference GPCTR_Set_Application
NI-DAQ FRM for PC Compatibles 2-232
©
National Instruments Corporation
Figure 2-21.
Retriggerable Pulse Generation
Use the GPCTR_Control function with action = ND_RESET to stop the pulse generation.
Typically, you will find modifying the following parameters through the
GPCTR_Change_Parameter function useful when the counter application is
ND_RETRIG_PULSE_GNR. You can change the following:
ND_COUNT_1 and ND_COUNT_2 to any value between 2 and 2
24
– 1. The defaults are
given for illustrative purposes only.
ND_SOURCE to ND_INTERNAL_100_KHZ. With this timebase, you can generate pulses
with delay and length between 20 µs and 160 s. The timing resolution will be lower than
if you are using
ND_INTERNAL_20_MHZ timebase.
ND_GATE to any legal value listed in the GPCTR_Change_Parameter function
description.
ND_GATE_POLARITY to ND_NEGATIVE. A high-to-low transition of the gate signal
initiates the pulse generation timing.
You can use the
GPCTR_Change_Parameter function after calling
GPCTR_Set_Application and before calling GPCTR_Control with
action =
ND_PROGRAM or ND_PREPARE.
To provide your timebase, you can connect your timebase source to one of the PFI pins on the
I/O connector and change
ND_SOURCE and ND_SOURCE_POLARITY to the appropriate values.
You also can configure the other general-purpose counter for
ND_RETRIG_PULSE_GNR, and
set
ND_SOURCE of this counter to ND_OTHER_GPCTR_TC to generate pulses with delays and
intervals longer than 160 s.
application =
ND_PULSE_TRAIN_GNR
In this application, the counter is used for generation of a pulse train. By default, you get this
by using the 20 MHz internal timebase (
ND_INTERNAL_20_MHZ), so the resolution of timing
is 50 ns. By default, the counter repeatedly counts down from
ND_COUNT_1 = 5 million to 0
for the delay time and then down from
ND_COUNT_2 = 10 million to 0 for the pulse generation
time to generate a train of 0.5 s pulses separated by 0.25 s of delay. Pulse train generation
starts as soon as you arm the counter. You must reset the counter to stop the pulse train.
Source
Gate
Output
Count_1=3
Count_2=4
Count_1=3
Count_2=4
Count_1=3
Count_2=4