LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQ data into array

Hello! I've seen a lot of examples regarding inserting the data acquired with a DAQ board into an array. However none of them seems to be exactly what I need.

 

I'm working with a NI USB-6008 and my goal is to acquire 1000samples/sec and to write the data acquired in each second in the same row.

 

When I finish collecting 30 seconds worth of data I would have 30 rows and 1000 columns. But I can't find a way to make this work.

 

I basically want to do a moving average so my final goal is to sum every voltage in each column, divide it by 30 and get a vector with the average of the 30 columns, resulting in a single row and 1000 columns.

 

After this, in order to have a moving average, the 1st row needs to be eliminated and the 31st second needs to be recorded in the 30th row so I can average it again.

 

I've already tried the meanptbypt but that only gives me 1 value, and as I've said, I need the average of each column in order to get a vector, so I don't think that's the solution to my problem.

 

I've read all the info about arrays because that is the main thing I need to figure out, how to organize the DAQ data in the array, after that I think I can figure out the rest. 

 

Thank you in advance, please keep in mind that I've only started working with labVIEW so I'm sorry this is trivial for some of you. My VI is attached.

0 Kudos
Message 1 of 5
(467 Views)

What is your end goal? just log moving average data?

 

BTW, the issue is not the DAQ data, but your inexperience in handling arrays and manipulating them.

 

Side note - DO NOT use EXPRESS VIs - they will work but not long enough, they are like training wheels in a bicycle

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.
0 Kudos
Message 2 of 5
(443 Views)

Anyway, here is a modified version based on your description.

 

Moving average for DAQMoving average for DAQ

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.
0 Kudos
Message 3 of 5
(440 Views)

Hi! My end goal is to subtract this moving average to an EEG signal I'm going to acquire with the DAQ board, it's one of the ways to remove the noise to an EEG signal. So I need to acquire 30sec before I do the average of all the columns to get the vector I'm going to subtract to the 31st second of my raw data.

 

And then keep doing this for as long as I need to acquire data, which might be like 10min or something like that.

 

For my 32nd second I will subtract the average of the seconds 2 to 31 of the raw data. It's quite difficult to explain using only words, I'll attach a drawing if you want to get a more clear idea of what I need to do.

 

I'm afraid I don't know what an EXPRESS VI is...

0 Kudos
Message 4 of 5
(403 Views)

Thank you! But it seems like this also doesn't give me a vector for the average that I can then subtract to my 31st second of raw data. I feel that it's my fault that I might not have explained it clearly enough, but I hope that with my previous reply to your comment it gets a bit more clear what I need to do.

0 Kudos
Message 5 of 5
(399 Views)