LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

AI Acquire Waveform confusion

Hi

I wonder if anyone could clear up a little confusion which I am
currrently suffering 🙂

I was once told to keep away from the using AI Acquire Waveform.vi
because on each call it runs AI Config.vi which can slow up your
acquisition. I was told that you should set up the acquisition using
AI Config.vi and AI Start.vi, and the only vi which ought to be called
on each iteration should be AI Read.vi.

However, on taking a look at AI Acquire Waveform Scan.vi (which is
inside AI Acquire Waveform.vi), it states in the VI info that.......
"If you place this VI in a loop to do more than one acquisition from
the same group of channels, wire the iteration terminal of the loop
to the VI iteration input. On iteration 0, the VI calls AI Config to
configure the channel group and hardware and to allocate a buffer for
the data. On each iteration, the VI calls AI Start and AI Read. AI
Start sets the scan rate and trigger conditions and then starts the
acquisition."

This would imply that AI Config.vi *is* only called once (on the first
iteration) and on subsequent iterations only AI Start and AI Read are
called. It says to wire the iteration terminal of the while loop
(presumably the while loop in the main calling vi) to the "VI
iteration input". So I created a connector to pass the iteration
number of the main while loop through to the iteration input of the AI
Acquire Waveform Scan.vi, hoping that it would result in the AI
Config.vi being called only once, yet when I do this I get an error
number 10401,

Warning 10401 occurred at an unidentified location.

Possible reasons:

NI-DAQ LV: The specified device is not a National Instruments
product, the driver does not support the device (for example, the
driver was released before the device was supported), or the device
has not been configured using the Measurement & Automation Explorer.

I am assuming that I have totally misunderstood what the statement
regarding wiring the iteration value to the AI Acquire Waveform
Scan.vi meant. Could anybody please shed some light????

Thanks
Jon Atkinson
0 Kudos
Message 1 of 4
(3,335 Views)
In my opinion the main questin you must answer is which type of application you intend to run in your program.

It's true that within AI Acquire Waveform Scan.vi the configuration of the device is executed only in the first iteration, but every time you call this vi, the AI Start and AI Read are executed, that is, a new acquisition is made (and completed) and data are stored in the waveform data output terminal, and may overwrite old data unless you have stored them someway or collect all waveforms in an array. Remember that AI Acquire Waveform Scan.vi waits until timeout or data acquired before returning.

So coming back to my question: are you planning to execute a (relatively) long acquisition in the background and simply want to read data while they are acq
uired or you intend to acquire at each iteration a new set od data?

If you are running the second option, your solution is correct (and your problem is probably due to some error in wiring the iteration terminal, maybe wrongly lead to the device terminal). Remember to store or accumulate waveforms out of AI Acquire Waveform Scan.vi, or you will retain only the last one acquired.

If you are in the first option, you must put in your diagram AI Config, AI Start, then a while loop with AI Read (configured to read a small amunt of data until acquisition completed) and then AI Clear (outside the loop).

Hope to have helped you a little.
Roberto


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 4
(3,334 Views)
I want to define 2 digit single precision in block digram is there any way to do it. i used sgl conversion function but it uses 6 digit precision how can i refine it to 2 digit.
0 Kudos
Message 3 of 4
(3,237 Views)
Last question has also been started in a new thread. Please continue HERE.
0 Kudos
Message 4 of 4
(3,233 Views)