LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Boxcar Averaging from DAQmx Analog Voltages

Solved!
Go to solution

I've searched through VIs, I can't seem to find anything that will automatically boxcar average numbers fed into it. I am trying to create a feature of my software that will allow dynamic configuration of boxcar averaging certain inputs. I would like to avoid hardcoding arrays that are filled/rotated etc etc. Any help is appreciated

 

Thanks

0 Kudos
Message 1 of 4
(3,717 Views)
Nevermind I just coded my own. This brings me to another question. If I make a VI that stores values into its own local variable, if I call the VI from 2 serarate locations are there multiple "instances" of the VI spawned in memory so each boxcar subvi has its own set of local variables?
0 Kudos
Message 2 of 4
(3,714 Views)
Solution
Accepted by bkb

If you are using a Functional Global to store the values and call that VI in from two different VIs, you will be accessing the same data. You could use two shift registers in the Functional Global and use a selector to place / extract data to / from the appropriate shift register. Only one VI call access a common VI at a time, so one of the calling VIs will be 'blocked' until the first caller is done. This usually doesn't work well in high speed DAQ applications.

 

You could consider using  named queues instead of the functional global. You might be interested in this thread on the LAVA forums that discusses Boxcar implimentations. You would create a queue for each data stream, and can perform functions like 'preview' queue to get all the elements without actually removing them from the queue. If you are using LabVIEW 8.6, there is a new feature called Lossy Queues. You set an upper limit to the size of the queue and use 'lossy enqueue' to add items to the end of the queue. If the queue fills, then the oldest data item will be lost.

Message Edited by Phillip Brooks on 10-07-2008 07:10 PM

Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T
If you don't hate time zones, you're not a real programmer.

"You are what you don't automate"
Inplaceness is synonymous with insidiousness

Message 3 of 4
(3,693 Views)

After the LAVA site rebuild, the thread is now located at this URL:

 

http://lavag.org/topic/5002-boxcar-running-average-for-1d-array/


Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T
If you don't hate time zones, you're not a real programmer.

"You are what you don't automate"
Inplaceness is synonymous with insidiousness

0 Kudos
Message 4 of 4
(3,419 Views)