Keeping Variable When Restarting Program

is it possible to store variable values on the fly so that when i restart the program the variable remains the same.
example would be a counter. so when i restart the program it continues counting from where i left off.
if it cant be done automatically would it be possible run a program and save the variable on a folder then recall that variable from the folder on program restart?

I think you’re talking about “installation variables.” They persist between runs/power cycles.

Take a look and see if that works for you.

thanks for the reply,
so i tried the installation variable route.
lets say for example i make an installations variable called nCount. then i declare that variable as 0 in the installation variable menu.
then during the program it counts how many runs by adding nCount:=nCount+1.
when i stop the program the installation variable reverts back to the original 0 that it was declared.
i would like to say run the program 5 times then stop the robot and when i restart it will start off with 5 already in the variable.
hope that wasnt too much to understand.

Installation variables do not revert back to their values declared when created. Those variables keep their value through restarts and program changes. :slight_smile:
Are you maybe also “declaring” the variable (setting it to 0) in an Assignment in your Before Start or something? Or somewhere else in your program?

1 Like