LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Write backup files as reading takes place in case of computer failure

Solved!
Go to solution

Hello,

 

My application involves occasionally doing tests outdoors.  We have a rugged PC and DAQ equipment.  I'm in the northeast where the last few weeks were cold and we had to do a test outdoors.  Long story short, in the middle of the test the computer shut down (most likely because it was too cold for the computer according to its spec sheet) and I lost all of the sensor data.  The coomputer works fine BTW when I brought it back indoors.

 

The reason the data was lost was because the program never finished executing and thus the function that writes the data file did get a chance to run.  Now, the DAQ card we used is very old and obsolete.  I'm in the process of upgrading the hardware with NI components (PCI-6221) and an SCC-2345 box with load cell modules for two load cells.  Along with that I am writing a LabVIEW application that improves upon the old, obsolete program.

 

I want the application to continuously write a spreadsheet file with all the sensor information as the test is occuring in case the computer fails midtest.  That way, I at least have some data saved.  I was explaining all this to another engineer here and he says that it can't be done that way at high sampling rates (I want to run the program at 1kHz for 60 seconds).  His reason was that writing to a file will screw up the waveforms we are measuring because file has to be opened, the data gets written, and then closed again for each row of data points.  He contends that the computer resources will be tied up as it tries to write the file while the program is acquiring data and keeping that data in a memory buffer.

 

So my question is: what's the recommended architecture to write a backup file as a test is occuring with a high sampling rate (1kHz to 10kHz) in case the computer shuts down or some other failure occurs?  Also, what are the performance limitations when writing data to a file within the same loop as the "read" VI?

 

Thanks.

0 Kudos
Message 1 of 3
(2,145 Views)
Solution
Accepted by topic author MVG1

Rates of 1-10 kHz are actually pretty slow. You can use a producer/consumer architecture to save text files and there is just no reason to continuously open and close the files. With DAQmx, you can directly stream to disk at much higher rates.

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

Thanks for the reply.  I started looking into the DAQmx functions and it looks like it will serve my purposes as well as using the producer/consumer architecture.  Thanks. Smiley Happy

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