Using Acquire N Scans.vi 
Author Message
 Using Acquire N Scans.vi

Hi, can anyone help?

I'm using Acquire N Scans.vi and would like to calculate the mean
value for the N scans. The AI Read output is of the 'waveform' data
type but may be changed to 'scaled array', 'binary array' or 'scaled &
binary array' by right clicking on the icon. Is it necessary to change
the data type? I notice that if I change the type to scaled array,
then I get a broken wire when I try to connect it to the mean.vi. Ive
also noticed that if I select waveform for the data type then the mean
(displayed in an indicator) is different (lower) from the mean of the
values appearing in the 1D waveform data array on the front panel of
the VI. Can you explain this?

My other question is if I press run, how can I display the mean value
versus time in an XY graph so that by pressing the start/run button
repeatedly I can monitor how the voltage is changing with time (in
real-time)?  At the moment I've got the mean.vi X input wired to the
waveform data terminal and the mean output wired to a cluster bundle
(with two elements). The other element of the cluster bundle is the
'Get/Date Time in Seconds' function. The output from the cluster is
wired to a build array and this in turn wired to a XY graph. I would
be very grateful for any help.

Thanks,

Adrian



Sun, 14 Dec 2003 06:23:34 GMT  
 Using Acquire N Scans.vi
I think the problem you are having is that the output from the AI
Read.VI is actually a 1-D array of waveforms.  If you were scanning
multiple channels at one time, each channel would have its own
waveform.  So scanning two channels would result in a 1-D array of
waveforms with 2 elements in it.  However, even if you only scan one
channel, the VI will still out put an array.  So to get a single
waveform, you can index the array. Incidentally, if you change the
output to a scaled array, you'll notice that the output is a 2-D array
of SGL, so you would still have to index it to get a 1-D array.  It
really does not matter whether or not you use a scaled array or
waveform types unless you want to keep the time data included in the
waveform.  When you wire a waveform type to the Mean.VI it will coerse
it into a 1-D array.  The reason you were getting strange results out
of the Mean.VI before is that labview will allow you to wire a 1-D
array of waveforms to a 1-D numeric array, but it does not coerse it
the way you would expect.  LabVIEW will coerse it by taking the last
value in each waveform of the array and make it an element in the
numeric array.  So if you wired an array of waveforms that only had
one element and coersed it into a 1-D numeric array at the Mean.VI,
your average would end up being the last value in your waveform.  Hope
that all makes sense, I know its a little confusing.  Just index the
array after the AI Read and I'm sure things will work for you.

If you just want to monitor the mean value versus time, you might have
an easier time using a waveform chart.  A chart will keep a history of
values so that you can wire one value to it at a time inside of a
loop.



Mon, 15 Dec 2003 01:03:33 GMT  
 Using Acquire N Scans.vi
Aaron, thanks - indexing the array did the trick. The mean I obtained
was much closer to the one I calculated. However before assuming
everything is alright, could I please confirm with you that I should
wire the waveform data from AI Read to the input array terminal of
Index Array, a constant of zero to the index terminal of Index Array
and the mean.vi to the element/subarray terminal of the same function?
I've never used the Index Array function before.

Thanks for your help.

Adrian



Mon, 15 Dec 2003 03:07:30 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Can you slow the scan rate of VI Logger scans per minute

2. Error 10800 using continuous scan vi limiting sample size to 512

3. Acquire N-Scans with pretriggering

4. Acquire N Scans ExtScanClk D-Trig

5. IP number change on fortress.uccb.ns.ca AKA w3.uccb.ns.ca

6. Help with Acquire N- Multi-Analog Software Trig.vi Example

7. accessing data after acquiring from a digital change detection .vi file

8. how to use AI acquire waveform.vi for continuous acquisition

9. can VI Logger playback data while acquiring?

10. Problem with AI acquire waveforms.vi

11. Using control reference with a Sub-vi over a TCP VI Server connection

12. Using control reference with a Sub-vi over a TCP VI Server connection

 

 
Powered by phpBB® Forum Software