Four or three outputs (coils) are available for programming in the ladder programming for the Arduino. The coil, the negated coil and the setting and resetting of a coil.
The outputs are inserted in the program here. Before setting and resetting, I used a rising edge as an input and later switched the switch to a push button in the simulation.
The coil and the negated coil
The coil always has the SAME state as the input. The negated coil always assumes the OPPOSITE state of the input. You can see it in the simulation below. The input 0.0 is on, so the output 0.0 is also on. Input 0.1 is off, so the output is off in the opposite direction.
The switching value table for the coil then looks like this:
Setting and resetting the coil
The setting and resetting of the coil is required where a state is to be saved regardless of the input. For example, buttons can be queried that should start a machine or that a machine should remain in operation until a process or a process step has ended. That's why I also used a rising edge and a button in the simulation.
If the button (as shown in the screenshot) is pressed and released again, the (set coil) remains ON regardless of the input. Now it doesn't matter how often button 0.2 is pressed and released again, the coil stays on.
In order to have the "set" again, i.e. to switch output 0.2 off again, the reset coil needs a rising edge. If input 0.3 is pressed, output 0.2 is switched off and only switched on again by pressing button 0.2 again.
The reset always has priority, it can be changed in the software. Good to see in the simulation. Set and reset are both HIGH so they both have voltage but the output is OFF because the reset is "Dominat", that is, it has priority. It makes sense in the PLC control that OFF always applies from ON, because when switching off, as a rule, fewer breakages and fewer people are injured than when switching on.
Die Schaltwerttabelle sieht beim setzen und rücksetzen der Spule dann so aus:
|Coil||Coil state on edge change||set entrance||Reset input|