LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Create test restart file

I have a long term test that I would like to have automatically save the current step and time data to a file. I would like to do this in case the test is stopped or power is lost so I can restart the test with the same conditions it stopped with. My concern is my timer value. I am currently saving my timer value to a .tdms file using a create/replace so it only has the one value in it. It is continually updating this file. I am concenred about a memory leak or that this isn't they best way to do it. Any thoughts or ideas?
0 Kudos
Message 1 of 7
(2,693 Views)

chandler wrote:
I have a long term test that I would like to have automatically save the current step and time data to a file. I would like to do this in case the test is stopped or power is lost so I can restart the test with the same conditions it stopped with. My concern is my timer value. I am currently saving my timer value to a .tdms file using a create/replace so it only has the one value in it. It is continually updating this file. I am concenred about a memory leak or that this isn't they best way to do it. Any thoughts or ideas?

Saveing the current state to a TDMS file and initializing from the same file sounds like a very viable plan to me.  I have used the same procedure in the past.  I ccan't think of a reason this (file access) would cause a memory leak.  Are you seeing odd behavior? 


"Should be" isn't "Is" -Jay
0 Kudos
Message 2 of 7
(2,674 Views)
TDMS should be just fine. how do you say you will face memory leak?
0 Kudos
Message 3 of 7
(2,668 Views)
Make sure you flush the file to disk after each use or a power failure could cause you to miss data and/or have a corrupt file.  Newer versions of TDMS will probably have more issues with this, since they cache more for performance reasons.  You will need to balance your flush frequency with any performance needs you may have.
Message 4 of 7
(2,646 Views)

Why using a TDMS?

Since here we're saving a single value at a (I suppose) slow rare,

a plain ASCII file wouldn't be the same?

Thanks in advance,

Marco

0 Kudos
Message 5 of 7
(2,627 Views)

Saving a time value to a text file always incurs several problems:

 

  1. What format do you use?  Default time formats vary widely around the world.
  2. How much resolution do you save?  This includes year, month, day, time, seconds, and fractional seconds.
  3. How do you save the time zone?  Do you save an offset from Greenwich Mean Time (GMT) or state the country, time zone, and whether or not daylight savings time is being used?
  4. It takes time to convert to a text format (and read from a text format).
All of these problems go away if you save a LabVIEW timestamp in native binary format, as TDMS does.  LabVIEW timestamps can handle nearly the lifetime of the universe at 5×10-20s resolution, so resolution is usually not a problem.  They are referenced to GMT (provided your computer is set up correctly), so time zone is not an issue.  They can be displayed with virtually any format the user desires when read back.

 

Message 6 of 7
(2,606 Views)

I am saving in relative time H:M:S. I have tried the tdms and saving to a binary file and neither seem to cause a memory leak. I have also decided that I only need to save this time once a min instead of every second. What is a min over a 45 day test!

 

Thanks for all the input

0 Kudos
Message 7 of 7
(2,596 Views)