Chapter 2 Function Reference — WFM_ClockRate
©
National Instruments Corporation 2-409 NI-DAQ FRM for PC Compatibles
(if it is not busy in a data acquisition or a counting operation) to produce a clock of 100 kHz,
which is used by the counter producing the update interval.
Also suppose that interval equals 25. This value indicates that counter 2 must count 25 rising
edges of its input clock signal before issuing a request to produce a new voltage at the analog
output channels.
The actual update rate in seconds is then 25
*
10 µs = 250 µs. Thus, a new voltage is produced
at the output channels every 250 µs.
The frequency of a waveform is related to the update rate and the number of points in the
buffer (indicated in an earlier call to
WFM_Load) as follows, where the buffer contains one
cycle of the waveform:
frequency = update rate
/
points in the buffer
You can make repeated calls to
WFM_ClockRate to change the update rate of a waveform in
progress. You cannot change the internal timebase already being used by the device, only the
interval, and the following conditions must be met:
• whichclock is 0.
• You are not using FIFO pulsed waveform generation.
• The timebase has the value it had when you called this function before starting the
waveform generation.
• At least one update was performed using the previously selected update interval to
change the interval immediately; that is, when mode = 0.
If any of these conditions is not met, NI-DAQ returns updateRateChangeError.
To perform FIFO pulse waveform generation on an E Series device, you must use the same
timebase for update and delay clock. You must specify the delay time as the product of four
numbers:
delay time = timebase period * delay interval * delay interval prescalar 1 * delay interval
prescalar 2.
In this formula,
• Timebase period is a single period corresponding to the selected timebase
(for example, 50 ns when the 20 MHz clock is used)
• Delay interval corresponds to the interval argument in this function when
whichclock =1.
• Delay interval prescalar 1 corresponds to the interval argument you use in this function
when whichclock = 2. If you do not call this function with whichclock = 2, this interval
is 1.