LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

What is the best way to stack DAQ aquired data in labview?

I'm developing an application to work with an M-series daq card and labview 8.5 to output a signal and then record on 8 differential inputs for a short period of time (~10 ms). I need to stack my data, however, because the incoming signal will be very, very small, even after amplification. So basically i'm running a slightly modified version of the multifunction Synch AI-AO.vi (included with the install of daqmx). What is the best way for me to rerun this vi a set number of times and add new data directly to the old data (not cat-ing or anything, like |sample 1 of run 1| + |sample 1 of run 2| = stacked stample 1).

 

A slightly modified version of the mutlifunction synch AI-AO.vi is attached.

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

HI,

 

when you kow how to concat arrays then you should know how to add them?

Use a simple, standard add function...

Best regards,
GerdW


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

Sorry, I should have been more specific. I'm still kind of new to labview and I'm still caught off guard at how easy it makes some things.

 

Right now I'm writing my all my data with the Write to Measurement File vi. If I want labview to add these files together should I just keep my vi how it is, but instead of the express write to measure file vi, write it to a spreadsheet

Then read that data back into an array

Read a storage file into an array

Add the two arrays

Write the new array to a spreadsheet file into the storage file

 

If I'm acquiring my data as a waveform will this method work? Is there a smarter way to do this?

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

Could you avoid the multiple file writes and reads by writing the waveforms to an array? Is it possible to do the equivallent of n=n+x, where n would be the storage array and x would be the new data? and then write that array to a file?

 

Do the waveforms need to be written into an array or is it possible to add waveforms? From what I've read it doesn't seem like adding waveforms is built in.

0 Kudos
Message 4 of 6
(3,483 Views)

Hi LSU,

 

see attachment on how to "stack" several measurements. I simply add the waveforms and use a shift register to keep the last iterations value.

 

Writing to files in each iteration is extremly CPU consuming - especially with express vis. Using for loops for just one iteration is "senseless". You could enable the conditional terminal of the for loop to realize your stop feature.

 

For your message 4:

Have you ever tried all the things you asked for? Sometimes it's easiest to just try&error Smiley Wink

And for the "n=n+x" question: It really helps to take the free online courses offered by NI!

Message Edited by GerdW on 11-11-2009 06:27 PM
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 6
(3,482 Views)
Thanks for the advice Gerd. I'll take a look at those online classes. I didn't realize they were even offered :). For the time being, I'm just going to append the repeated samples to the same file.
0 Kudos
Message 6 of 6
(3,457 Views)