National Instruments 321645c-01 Welding System User Manual


 
Chapter 2 Function Reference GPCTR_Set_Application
©
National Instruments Corporation 2-233 NI-DAQ FRM for PC Compatibles
With the default 20 MHz timebase, combined with the counter width (24 bits), you can
generate trains consisting of pulses with delay and length between 100 ns and 0.8 s. For the
6602 devices, you can generate pulses with a delay and length between 100 ns and 214 s long.
Assume that you want to generate a pulse train with the low period 150 ns long and the high
period 200 ns long. You need to set
ND_COUNT_1 to 150 ns/50 ns = 3 and ND_COUNT_2 to
200 ns/50 ns = 4. This corresponds to a 20 MHz: (3 + 4) = 2.86 MHz signal
with (3/7)/(4/7) = 43/57 duty cycle. Figure 2-22 shows the scenario of a counter used for
ND_PULSE_TRAIN_GNR after the following programming sequence:
GPCTR_Control(deviceNumber, gpctrNum, ND_RESET)
GPCTR_Set_Application(deviceNumber, gpctrNum, ND_PULSE_TRAIN_GNR)
GPCTR_Change_Parameter(deviceNumber, gpctrNum, ND_COUNT_1, 3)
GPCTR_Change_Parameter(deviceNumber, gpctrNum, ND_COUNT_2, 4)
Select_Signal(deviceNumber, gpctrNumOut, gpctrNumOut, ND_LOW_TO_HIGH)
GPCTR_Control(deviceNumber, gpctrNum, ND_PROGRAM)
In Figure 2-22, the following behavior is present:
Source is the signal present at the counter source input.
Output is the signal present at the counter output.
Figure 2-22.
Pulse Train 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_PULSE_TRAIN_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 the
ND_INTERNAL_20_MHZ timebase.
Source
Count_1 = 3
Count_2 = 4
Count_1 = 3 Count_2 = 4
Output