Hi,
in most cases g54,g55...etc are saved when Mach closes down.
When Mach is closed down it executes the ScreenUnload script. That script will save all the usual stuff like g54,g55 etc. If you want to save other items that's where you put the code.
Any data you save will be stored in the .ini file.
When Mach is restarted at the first run of the PLC script (which occurs after Mach loads and runs) you can retrieve the data from the .ini file and restore whatever DROs or variables within Mach.
I asked this question, because sometimes the electricity goes out.
This is your problem, if the power goes out then Mach just crashes, the ScreenUnload script will never get to run....and so none of the current data will be saved. Thats just bad luck
and nothing you can do about it. You need an uninterruptable power supply for your PC. If the power goes out then the power supply will know about it and shut down Mach gracefully,
ie run the ScreenUnload script.
Craig