From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
07-13-2020 01:30 PM
Hello,
I have an input at 10 Hz, continuous datas from a sensor via the DAQ assistant
I want to make a loop where every second the mean of the 10 last values is returned
By example :
1st second : 1 2 1 2 2 1 2 1 1 2
2 is returned
2nd second : 1 2 1 2 3 2 3 3 3 3
3 is returned
etc
is it doable ? Any idea of an existing .vi ?
07-13-2020 01:37 PM
Why do you put the tedious limitation of the DAQ assistant as a requirement? Use DAQmx and read 10 values every iteration of the loop. Average these 10 values. Perhaps there is a way with DAQ assistant, but I don't use DAQ assistant so I'm not sure.
07-13-2020 01:57 PM
To be clear : I don't want to do that IN the DAQ but working on the output
07-13-2020 02:03 PM
@Oxbow88 wrote:
To be clear : I don't want to do that IN the DAQ but working on the output
Yes. The suggestion was to have the DAQ assistant give you the X samples in a single call and then you just average the data you were given.
07-13-2020 03:30 PM
@Oxbow88 wrote:By example :
1st second : 1 2 1 2 2 1 2 1 1 2
2 is returned
2nd second : 1 2 1 2 3 2 3 3 3 3
3 is returned
Just to be clear, in your example you are returning the MODE of the data set (value that occurs the most), not the MEAN (average of the values). So what exactly is it that you want returned?
Saying "Thanks that fixed it" or "Thanks that answers my question" and not giving a Kudo or Marked Solution, is like telling your waiter they did a great job and not leaving a tip. Please, tip your waiters.
07-13-2020 05:05 PM
It was the mean but rounded to the nearest integer
So, any idea of a code or function to do that ?
Like I said I cannot use the DAQ assistant for some reasons
that would be awesome
07-14-2020 12:35 AM
07-14-2020 05:45 AM
@Oxbow88 wrote:
It was the mean but rounded to the nearest integer
So, any idea of a code or function to do that ?
Like I said I cannot use the DAQ assistant for some reasons
that would be awesome
I took a look at the DAQ Assistant and you should be able to do it with that (though I highly advise converting to DAQmx functions and getting away from that dreadful dynamic data wire). Post some code and you're likely to get more help on showing you where you've gone wrong.
07-14-2020 10:43 AM
This is a duplicate of this thread!
https://forums.ni.com/t5/LabVIEW/How-to-slow-a-continuous-DAQ-acquiered-signal/m-p/4067031