Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

calculation with samples aquired from DAQmx device

Hello,

I have a question about how to do calculations involving not only most recent sample but also previous samples in a data acquisition system. For example, I need to be able to get value of Y(n)+Y(n-1). The device used is a DAQmx device: DAQpad6015. It is very much appreciated if anyone can give me any advice. Thank you.
0 Kudos
Message 1 of 5
(3,032 Views)
While loops and For-Next Loops allow you to add shift registers to them. You can use them to remember a previous value the next time through the loop.

I attached a quick example.
Randall Pursley
0 Kudos
Message 2 of 5
(3,027 Views)
Thank you very much, this is really a breakthrough for me. One more question, if I need to perform the averaging of the past 100 values or the fft of this window lenth, will it be still feasible to use the shift register method? or there is any other way to do it? Thank you.
0 Kudos
Message 3 of 5
(3,020 Views)
Append collected data to an array.
And, when the array becomes of tghe right size, do the math
0 Kudos
Message 4 of 5
(3,006 Views)
Here is an example of a circular array. Once if fills up it drop the oldest value and adds the latest.
Randall Pursley
0 Kudos
Message 5 of 5
(2,998 Views)