LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

continuously average dynamic Data using myrio

Solved!
Go to solution

Hi all

I am using myrion to take readings for temperature and 3 other parameters every 5 seconds with timed loop. How can I take average every 5 second? 

I tried  to use the statistics functon to get the arithmetic mean, but it seems i am getting only the value of last sample written into the file!!

Thanke

0 Kudos
Message 1 of 6
(3,471 Views)

Hi Yasee,

 

How can I take average every 5 second? 

Average of what???

 

it seems i am getting only the value of last sample written into the file!!

What have you tried? Mind to attach your VI?

What's the relation with your "file"? I thought you want to average sample read from the myRIO hardware???

 

You really need to learn to ask better question! 😄

 

To answer your question at the current state of information provided by you: As your "timed loop" is iterating at 5s interval you can calculate your averages inside of this loop. This way they will be calculated also with the 5s interval! 😉

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 6
(3,460 Views)

Hi

I am looking to average the readings for the flow rate and the pressure and get one value every 5 seconds to write it in a file.

you could take look at the vi

excuse me English is not my first language

thanks

0 Kudos
Message 3 of 6
(3,436 Views)

here is a another VI runs using NI-9211  to take temperature from 8 thermocouples

I want to take the average for the temperatures every 5 second and write it to a file.

0 Kudos
Message 4 of 6
(3,434 Views)
Solution
Accepted by topic author YaseeB

Hi Yasee,

 

why do people think using (mostly/mainly) ExpressVIs will make their life easier?

 

All you need is THINK DATAFLOW!

In both your VIs your are reading just one (in numbers: 1) sample (per channel) per iteration. This one sample is fed into an ExpressVI to calculate an average from it. What exactly is the average of a single/scalar value?

 

Recommendations/suggestions:

- Learn DATAFLOW and get rid of ExpressVIs. This way you will actually learn LabVIEW and understand which data is "flowing" which way…

- use the Pt-by-Pt-Mean function for your analog input. Set the size input as needed…

- for your 8 thermocouples: join those 8 channels into one DDT wire, then convert to a 1D array. Split this array into 8 scalar values (using IndexArray) and use PtByPtMean 8 times… 🙂 (This is not the best solution, but will do what you want to do…)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 6
(3,429 Views)
Solution
Accepted by topic author YaseeB

You are only averaging the last point. Try something like "mean ptbypt" for each of the sensors and adjust the history size according to your requirements.

0 Kudos
Message 6 of 6
(3,409 Views)