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: 

How can I retain the most recent values written to an array after the program is closed?

I have an array of counters inside a While loop. These counters keep track of inspection results (number good, bad and so on.) When I close and reopen the program these counters revert back to zero (the default values.) I would like them to retain the last value unless I press a button to zero each.

 

It seems like this should be pretty straightforward but I can’t figure it out. What am I missing?

0 Kudos
Message 1 of 3
(2,067 Views)

Save the values that you want to save to a file and read that file when you open the software to initilize the controls.

Tim
GHSP
0 Kudos
Message 2 of 3
(2,065 Views)

I second Tim's suggestion.

 

The reason is that you want the data to be stored for later retrieval when there is a power outage or if the PC is turned OFF. 

Anything that deals with volatile memory just won't do.

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