Programming instructions
Chapter 6 One-Stop Single-Point Acquisition
©
National Instruments Corporation 6-5 LabVIEW Data Acquisition Basics Manual
The advantage to using the intermediate-level VIs is that you do not have
to configure the channels every time you want to acquire data as you do
when using the Easy VIs. To call the AI Config VI only once, put it outside
of the While Loop in your program. The AI Config VI configures channels,
selects a high/low limit, and generates a
taskID
. Then, the AI Config VI
passes the
taskID
and error cluster into the While Loop, where LabVIEW
calls the AI Single Scan VI to retrieve a scan. The program then passes the
returned data to the My Single-Scan Processing VI. With this VI, you can
program whatever processing needs your application calls for, such as
looking for a limit to be exceeded. The VI then passes the data through
the build array function to a waveform chart for display on the front panel.
The Wait Until Next ms Multiple (metronome) function controls the
loop timing. You enter a scan rate, the application converts the value into
milliseconds and passes the converted value to the Wait Until Next ms
Multiple function. The loop then executes at the rate of scanning. The loop
ends when you press the stop button or an when error occurs. Once the loop
finishes, the Simple Error Handler VI displays any errors that occurred on
the screen.
Figure 6-6.
The Cont Acq&Chart (Immediate) VI Block Diagram
The previous examples use software-timed acquisition. With this type of
acquisition, the CPU system clock controls the rate at which you acquire
data. Your system clock can be interrupted by user interaction, so if you do
not need a precise acquisition rate, use software-timed analog input.










