Download LabVIEW Measurements Manual

Transcript
Chapter 12
Generating Voltage
To gain more control over an analog output application, use the Traditional
NI-DAQ Intermediate VIs as shown in Figure 12-3.
Figure 12-3. Circular Buffered Waveform Generation Using
Traditional NI-DAQ Intermediate VIs
With the Traditional NI-DAQ Intermediate VIs, you can set up an alternate
update clock source, such as an external clock or a clock signal coming
from another device, and you can monitor the update rate the VI actually
uses. The AO Config VI configures the channels you specify for analog
output. The AO Write VI places the data in a buffer. The AO Start VI begins
the actual generation at the update rate. The AO Write VI in the While
Loop writes new data to the buffer until you click the Stop button. The AO
Clear VI clears the analog channels.
Refer to examples\daq\anlogout\anlogout.llb for an example of
the Function Generator VI. The Function Generator VI changes the output
waveform on-the-fly and responds to changing signal types (sine or
square), amplitude, offset, update rate, and phase settings on the front
panel.
Using NI-DAQmx VIs to Generate Voltage
You can use NI-DAQmx VIs to generate voltage.
The block diagram in Figure 12-4 uses NI-DAQmx VIs to generate a sine
wave on an analog output channel. The Sine Waveform VI generates a sine
wave with a frequency of 10 Hz and an amplitude of 1 V. The DAQmx
Write VI writes the sine wave data to the specified physical channel. The
DAQmx Timing VI provides the timing information necessary for voltage
generation. The DAQmx Wait Until Done VI waits for the sine wave
generation to complete. Without the DAQmx Wait Until Done VI, the
voltage generation might prematurely stop, which could lead to data loss.
LabVIEW Measurements Manual
12-6
ni.com