LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Speed saving to file from acquisition - multiple sample rate

Hello everybody!

 

I've made a simple Labview program in appendix. The idea is to acquire 2 different type of signals (temperature & voltage) at 2 different frequencies thanks to the new compaq DAQ 9178.

My program is working properly, but when I write the current time between 2 loops, I see a very big time difference, compared to the time that it takes to acquire the specified number of samples: for ex. 100Hz and 100 samples ==> 1sec and 2sec observed in text file...

I did 2 separated loops to they can work in parallel, and this time difference is a lot bigger in the loop where I've specified the local variable for the stop button (maybe it is linked)...

 

Does anybody have an advice of how to speed up the writing process to have less time gap between loops (so that I don't loose time information)

 

Thanks a lot

 

Delphine

0 Kudos
Message 1 of 2
(2,185 Views)

Delphine,

 

Typically what is done is to separate the data acquisition and the file save tasks and put them in parallel loops.  Since you already have two loops for your DAQ tasks, you would need a third loop to do the saving.  Transfer the data between the DAQ loops and the file lop with queues (one for each DAQ task).  The file loop can run at a different rate from the DAQ loops, so long as all the data gets saved before the queues overflow.

 

Look at the Producer/Consumer Design Patterns which come with LV for examples.

 

Lynn 

0 Kudos
Message 2 of 2
(2,176 Views)