4-2
|
ni.com
Chapter 4
Counter Output
Time
To specify the pulses in terms of time, use the DAQmx Create Channel (CO Pulse-Generation
Time) VI or function. Figure 4-2 shows how to specify the pulses in terms of time.
Figure 4-2.
Specifying Pulses
In the first waveform, the signal begins in a low IdleState. The pulse generation begins by calling
the Start Task VI or function. After waiting for InitialDelay seconds, the output goes high for
HighTime seconds and then low for LowTime seconds. The output then goes high and low again
until the desired number of pulses have been generated.
The second waveform shows an example where the IdleState is high.
Ticks
A tick is one period of the Counter Timebase. By default, the timebase is 100 MHz, so
a tick is 10 ns. To specify the pulses in terms of ticks, use the DAQmx Create Channel
(CO Pulse-Generation Ticks) VI or function.
Frequency and Duty Cycle
To specify the pulses in terms of frequency and duty cycle, use the DAQmx Create Channel
(CO Pulse-Generation Frequency) VI or function.
Channel Settings
By default, the counter outputs the pulses on a default PFI terminal. Refer to Chapter 5,
, for more information.
You can change the output terminal by using the CO.Pulse.Term DAQmx Channel property.
Timing Settings
To specify the number of samples to generate (that is, the number of pulses), use the DAQmx
Timing (Implicit) VI or function. Set the Sample Mode input to Finite Samples or
Hardware Timed Single Point.
S
t
a
rt T
as
k
Idle
S
t
a
te = Low
Initi
a
l Del
a
y
High
Time
Low Time
High
Time
Low Time
S
t
a
rt T
as
k
Idle
S
t
a
te = High
Initi
a
l Del
a
y
Low Time
High
Time
Low Time
High
Time