Lou Apo said:That isn't needed, ram values always are 0 at startup, they don't get saved when power goes off.
rossw said:Values are set to 0 on startup, sure, but they are not set to zero on program reload (not sure about RAM, but VAR are not).
So if you have a program running, make a change, upload that - it will load and start running but with whatever WAS in the registers.
If you want your code to always behave the same, you may need to clear them to ensure consistent behavior.
Lou Apo said:Ram values are set to 0 with each reboot and with saving plc code.
..
I didn't say anything about VAR.
Lou Apo said:In fact, a good way to run a startup subroutine is as follows
Start
tsteq ram1 0
call sub startup
all the rest of your code
..