SirCharles1,
it all depends on how the program was written and what the intent was. by that i mean you simply can't reset code back to its initial state without knowing the machine.
i know of a machine that had its program set to initial conditions by the OEM and they had a power failure. when the power was restored, the machine tore itself apart trying to reset to home. $250k in damage.
Now to your question.
allen bradley plc's typically have a first scan bit that is set when the power is turned on or you go from program to run mode.
this is how i reset most of my code. Note i said most.
i reset rto timers,counters, latched bits, control words, and so on. CAUTION, you must know the machine, its operation, sequence, homing logic - everything.
I am stressing this because of experience and not wanting you to get someone injured. not trying to slam you in any way, just wanting you to be careful.
regards,
james