LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I do time-averaging and/or filtering of a Fieldpoint AI-110 voltage signal?

I have some 0 to 10V pressure transducers connected to a AI-110 FP module. In my Labview app I have some themometer-type gauges to display the instantanous pressures recieved from the appropriate FP channels. I have two 0 to 1 psi transducers that send abonomially low voltage signals about once every three seconds and this causes my pressure indicator to jump around dramtically. How can I either time-average my input signals (over a period of say 2 seconds... I don't know the freq of the signals Labview reads from the FP) or filter out those wild voltage drops so I can get a more consistant and accurate pressure reading on my indicator?
0 Kudos
Message 1 of 4
(2,857 Views)
Hi Aubrey,

The way to do this depends on the number of samples that you measure during the averaging time (say 2 seconds). If you sample with a slow rate (say 2 times a second), then the easiest is to use a Shift Register in the loop and average the last 4 measurements.

If you have to average much larger amounts of data, then you should use an array to keep the last 100 measurements.

Please see my attached "Average.vi" and "Average.jpg" (if you don't have LabVIEW 7.1) for an explanation.

Best Regards,
Philip C.
National Instruments
- Philip Courtois, Thinkbot Solutions

Thinkbot Solutions
Download All
0 Kudos
Message 2 of 4
(2,857 Views)
I created a shift register in a sub-VI to take input from my FP channels and average the last four values from each of the channels I'm reading. My problem is that I want this averaging to occur simultaneously with the execution of the rest of the VI, since the app is constantly recieveing and displaying the current pressure data. Instead the parent VI just waits for the sub-VI to finish the loop before processing the returned pressure variables and the program comes to a standstill. So how can I make the averaging VI with the shift-register loop run simultaneously with the rest of its parent VI? I don't know much about real-time programming.

Note: I don't have easy access to the main application while loop since my averaging sub-vi is two levels d
own from my top-level application VI. It goes:

Control.vi (mainly user interface components) >InputOutput.vi (most of the data IO and calcutions) > averaging.vi
0 Kudos
Message 3 of 4
(2,857 Views)
Hi Aubrey,

To prevent the subVI from stalling your parent VI, the normal solution is to put it inside it's own seperate loop outside any main loop in the parent VI. Two loops next to each other that are not connected, will run in parallel independantly of each other.

You can also implement a functionality like the one from the attached "Average4.vi". Using a subVI like this to calculate the average of the last 4 values, you can just give it the latest measurement, and it will return an average of the last four measurements.

Best regards,
Philip C.
National Instruments
- Philip Courtois, Thinkbot Solutions

Thinkbot Solutions
0 Kudos
Message 4 of 4
(2,857 Views)