From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Saving values from one run to the next

 

I am working on a large project that is a long term test (years) certain events must occur at certain time intervals after other events.

 

How do I save the current state everything was in if three months into the test the program needs to be restarted, computer rebooted, crashes, power outage, etc...?

 

 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 1 of 4
(2,391 Views)

Hi RTSLVU,

 

the concept is the same for long term tests as for short runs:

- before exiting the program (or at regular intervals) save the current state to a file

- when starting the next time you read the file and use its information

 

The file format is doesnt' really matter, but LabView offers functions to read/write ini files (aka Config files), XML files and plain ASCII files. It's up to you!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 4
(2,387 Views)

GerdW wrote:

Hi RTSLVU,

 

the concept is the same for long term tests as for short runs:

- before exiting the program (or at regular intervals) save the current state to a file

- when starting the next time you read the file and use its information

 

The file format is doesnt' really matter, but LabView offers functions to read/write ini files (aka Config files), XML files and plain ASCII files. It's up to you!


 

Yeah, that's kind of what I fuggured...

 

This is my first time developing a program of this scale, I have never had to really worry about such things before.

 

Here is my first attempt at reading from a config file Smiley Sad

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 3 of 4
(2,382 Views)

Hi RTSLVU,

 

There is a set of examples that come with LabVIEW that write to and read from a configuration file. You can find them in the Example Finder under Fundamentals » File Input and Output. The Write Configuration Settings File.vi example saves the values of your controls on the front panel to a configuration file and the Read Configuration Settings File.vi reads that config file.

0 Kudos
Message 4 of 4
(2,336 Views)