Ladder Logic Programming Instructions – Part 2
Set / Reset Coils
The Set/Reset pattern, also known as the Latch/Unlatch pattern or simply “Latch Bit” is for remembering some on/off state of the machine that has to survive a power outage:
Set and Reset Functions: Set (S): This instruction forces a specific output bit (memory bit) to be ON (1). This is typically used to activate an output or to store a certain condition.
Reset (R): This instruction forces a specific output bit (memory bit) to be OFF (0). It is used to deactivate an output or reset a stored condition.

Thereby you can set an output in one place in your ladder logic. You can then reset the coil in a totally different place in your ladder logic.
How to work:

- I0.0 (Start Button): When this input is ON, it will set the output Q0.0 to ON.
- I0.1 (Stop Button): When this input is ON, it will reset the output Q0.0 to OFF.
- Q0.0 (Output): This output bit will be latched (set to ON) when the start button is pressed and will remain ON until the stop button is pressed, which resets it.
- Uses: Set: To store a state or condition that should remain active even after the triggering condition goes away (latched state).
- Reset: To return to a neutral state or reset a condition after the Set function has been activated.
One Shots for Signal Edges
Normally you would expect the operator to press the start and stop buttons only once – and for a short time. But the operator can hold the buttons pressed for longer time or the button can simply be stuck when pressed
If the stop button for one of the motors somehow gets stuck, you will not be able to start the motor. In fact, this is a problem often encountered when you have momentary push buttons as inputs on the PLC.
But don’t worry. There is a solution to this problem. Luckily for us there are ladder logic instructions that can solve this problem. They are called one shot.Positive Edge
This is the instruction used to detect the positive edge or signal change stat of “0” to “1”. When it detects a change in the input signal from “0” to “1”, it will allow the power to flow only that much of the time that signal is changing its stat from “0” to “1”. After that, it will stop the power to flow.

Positive Edge Contact and Coil
The positive edge sensing contact looks a lot like the examine if closed instruction. In fact, it has the same symbol except this one has a P in the white space:
Positive Transition Coil
For Positive Transition Coils, aka (Rising-Edge) One-Shots or P-Coils, if all input conditions are TRUE, no functions have faulted out, and power flow has reached the coil at the end of the rung, it becomes TRUE for only a single scan of the OCS. Once the scan returns to this location in the program logic, the output will become FALSE,
The Positive Transition Coil should always be addressed to some intermediate, internal variable for use elsewhere in program logic. Addressing it to a physical output would only result in the output being active for a couple of milliseconds, if at all. In Debug mode, the TRUE state will likely never display due to the single scan the output is on and the much slower nature of Debug mode
Negative Edge
This instruction detects the change in the signal stat from “1” to “0”. It will allow the power to flow when it detects a negative change in the input signal like “1” to “0” and allow the power only this much of time. After that, it will stop the power to flow.

Negative Edge Contact and Coil
You will find the negative edge detection both as a contact and as a coil instruction. Again, they are called one-shots because they are only active in the same scan time as the transition from 1 to 0 happens.
Negative Transition Coil
For Negative Transition Coils, aka (Falling-Edge) One-Shots or N-Coils, all input conditions must become TRUE in order for power flow to reach the output. However, the output will not become active until those conditions are again FALSE, at which point the Negative Transition Coil will become TRUE for only a single scan of the OCS.
The Negative Transition Coil should always be addressed to some intermediate, internal variable for use elsewhere in program logic. Addressing it to a physical output would only result in the output being active for a couple of milliseconds, if at all. In Debug mode, the TRUE state will likely never display due to the single scan the output is on and the much slower nature of Debug mode.