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 to simply save the last data ?

Hi,

I would like to simply remember the last data before the PC was turned OFF.

In the attached example, I need to hit the Exit (Stop) Button to remember the last data,

but the application is more rugged that PC is sometimes instantly powered OFF (without going

to the normal shut down procedure).

I would appreciate for any advise.

Thanks a lot.

Regards,

jtc

0 Kudos
Message 1 of 4
(2,750 Views)

Your VI does not save anything and all is lost if the computer shuts down. All yor data is kept in volatile memory.

 

You need to write to disk at regular intervals, because once the PC shuts down, it is too late for any programmatic action. Then, next time the program starts, read the save location and continue where you left of.

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

Hi Sir,

 

Thank you for your kind reply. I guess i dont have other option but to write on the PC disk and read

that saved data when the PC/LabVIEW runs again.

Do you have any simple vi that i can work on ? I just need to save the last numerical value everytime

the PC is shutdown. Also, how can i prevent that file on getting heavy (accumulated data over time) ?

Thanks a lot.

0 Kudos
Message 3 of 4
(2,710 Views)

You would use a binary file and always write  your DBL value at position 0. The file will never be more than 8 bytes. You might want to alternate between two files, because one might get corrupted if the PC shuts down during writing.

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