LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I write snap shot of my data to measurement file every 5 seconds

Solved!
Go to solution

Hi There

 

I'm trying take a snapshot of my data stream once every 5 seconds and write it to a .LVM file. I'm having trouble with the "Write to Measurement File" VI. The rate at which it writes data to the file appears to be dictated by the "Samples to Read" parameter in the DAQ assistant. I've tried placing the "Write to Measurement File" VI inside a case structure and initiating the case structure with an "Elapsed Time" VI. This only results in a 5 second delay before the "Write to Measurement File" VI initiates. Once the "Write to Measurement File" VI is initiated it begins writing at 20 x per second. Is there a way to change this or dictate the rate at which the "Write to Measurement File" VI exicutes

 

My reason for slowing down the write rate are, 1) Reduce disk space taken up by my data file. 2) Reduce CPU usage and hard disk access cycles.

 

The reason I can't increase the "Samples to Read" value in the DAQ assitant (to match my data writing requirement) is that my VI will begin to miss events and triggers.

 

I'm sure I can't be the only person who needs high frequency data acquisition and low frequency writing of the processed data to disk? I can't however see a straight forward way of achiving this.

 

The hardware I am using is a NI USB 6008 DAQ, acquiring analogue voltage data at 100hz.   

 

Thanks in advance for your help

 

Cheers

 

Kim

0 Kudos
Message 1 of 3
(2,375 Views)
The case structure and the elapsed time function should work. Did you configure it to reset when the time target is reached? You should get a single true and then the output will be false until the time has elapsed again. The write to file would not be running 20 times a second. Post your code if you still have problems.
0 Kudos
Message 2 of 3
(2,364 Views)
Solution
Accepted by topic author KWEL-Kim

Dohhh!

 

The re-set function wasn't set in the elapsed time VI!

 

Many thanks!

 

Cheers

 

Kim

0 Kudos
Message 3 of 3
(2,357 Views)