The subject of toggling a bit with a single push-button has been discussed "at length" in many previous posts.
What many of the solutions suffer from is that the state of the bit may
not be maintained during a power-cycle or mode-change of the PLC. Various manufacturers use different methods to achieve this.
In the Allen-Bradley world, all "non-retentive" (output) bits in a program are cleared during a "pre-scan", so any solution using OTE's to drive the toggled bit will surely fail to maintain its "on" state during a power-cycle.
Now some may argue that toggled bits
should not be maintained on after a power-cycle, but my argument is that the PLC system
should not be making that decision, it is up to the programmer to decide which toggled bits should stay on, and which should be reset.
By far the simplest method of achieving this, and it doesn't need any fancy logic, is to use a COUNTER, driven directly by the push-button, the necessary one-shot of the push-button is inherent in the way the counter works. A counter is not reset at power-on, its data is "retentive".
Bit 0 of the counter's accumulator value is the toggled bit, since the counter alternately goes odd/even. The programmer can then decide whether he wants to retain the toggled bit through a power-cycle, or any other reason (E.Stop, etc.). If he wants it retained, he does nothing, if he wants it reset, he programs a RES instruction to reset the counter whenever he wants it reset.
Using a counter means the same "toggle" logic is used throughout the program, regardless of whether retention is either required, or not.