08-26-2019 02:39 AM - edited 08-26-2019 03:03 AM
I want to acquire 4-20mA from flow meters continuously and show as "live values" and average the live values for a particular period decided by the press of a button. Every time I press the start/stop averaging buttons, the mean value should update to the new mean value.
I did the program using queue and 2 loops and averaging works fine. But once I stop averaging, start averaging won't work again unless I rerun the whole program.
Can someone look into the vi.
Solved! Go to Solution.
08-26-2019 02:53 AM
Hi Ayoob,
unfortunately you attached your VI in LV2019. Using an older LabVIEW version might get you more audience. (I would like LV2017…)
Basic concept:
08-26-2019 03:05 AM
Thanks GerdW
Updated the file to LV2016. Can you check now.
08-26-2019 03:32 AM
08-26-2019 04:31 AM - edited 08-26-2019 05:24 AM
I would always compute the mean, show both in a chart with legend and the operator can select what he wants to see.
(Hint: Make the mean the first channel, looks better 😉 )
09-04-2019 01:11 AM
Thanks GerdW,
I was trying to show the number of samples averaged (or tie of averaging). I implemented it using 2 feedback node. It works.
09-04-2019 01:41 AM - edited 09-04-2019 01:44 AM
Hi Ayoob,
again you attached your VI just for LV2019…
I implemented it using 2 feedback node.
Wow, that looks complicated!
Why not simply use ArraySize (or MatrixSize) to read the number of samples and add them up using a (read: "one") shift register?
09-04-2019 03:20 AM
Hi GerdW,
Sorry i forget to change the version.
I knew there will be a better way, but still i tried to find a solution of my own. I tried the array/matrix method also but did not use shift register. I will try that.
09-04-2019 03:54 AM
10-13-2019 07:10 AM
Hi GerdW,
Im facing a problem using this method. It looks like the mean I am getting is a moving average. But what I need is a single average of all values between pressing start and stop the same like what happens in the attached program. Is there any solution for that. I tried many ways but data flow makes the program freeze at different places.
Attached is the first version I made. averaging in this version is good, but in this one when I press the stop button the live reading also stops.