A Ladder Diagram is one of the simplest methods used to program a PLC.
It is a graphical programming language that evolved from electrical relay circuits.
Each program statement is represented with a line, called the rung, that has all relevant inputs to the left and the output to the right.
The output device of a rung is energized if electric power can conceptually flow from the left side of the rung to the right side. Input devices are assumed to block the flow of power if they are not activated.
During the execution of a ladder diagram, the PLC reads the states of all inputs, then determines the states of all outputs starting from the rung at the top side, going down to the last rung, and finally updates the state of the output devices.
During the development of a PLC program, we must use specific names to identify the inputs, outputs, memory flags, timers, and counters.
PLC manufacturers use a variety of approaches in naming the inputs, outputs and other resources.
A typical naming convention is to identify inputs with the letter “I” and outputs with the letter “O”, followed by a 1-digit number that identifies the slot number and a 2-digit number that identifies the position of the input or output in the slot.
For example:
Some manufactures number the inputs or outputs starting from 00, while others use the number 01 to identify the first input or output. It is also common to use numbers like 400 e.t.c.
The state of output can be also used as an input in a ladder diagram. In such a case the PLC uses the state of the specific output device that is stored in the output image memory.
If the input device is ON or Closed, then the corresponding bit in the data memory (input image) is set to true, thus allowing (conceptually) the energy to flow from its left side to its right-hand side.
Otherwise, it is set to false, thus blocking the energy.
If the input device is OFF or Open, then the corresponding bit in the data memory (input image) is set to true, thus allowing (conceptually) the energy to flow from its left side to its right-hand side.
Otherwise, it is set to false, thus blocking the energy.
The condition of the right link is ON for one ladder rung evaluation when a change from OFF to ON at the specified input is sensed.
The condition of the right link is ON for one ladder rung evaluation when a change from ON to OFF at the specified input is sensed.
If the condition of the left link of the OTE is ON then the corresponding bit in the output data memory is set. The device wired to this output is also energized.
If the condition of the left link of the OTE is OFF then the corresponding bit in the output data memory is set. The device wired to this output is also energized.
If the condition of the left link of the OTL is momentary ON then the corresponding bit in the output data memory is set, and remains set even if the condition switches to the OFF state. The output will remain set until the condition of the left link of the OTU is momentary ON.
The output is ON if any of the two inputs is ON.
The output is ON if both of the two inputs are ON.
The output is ON if any of the two inputs is OFF.
The output is ON if both of the two inputs are OFF.
The output is ON if any of the two inputs is ON, but not both.
The output is ON if both of the two inputs are either OFF or ON.
Timer Instructions are output instructions used to time intervals for which their rung conditions are true (TON), or false (TOF).
These are software timers. Their resolution and accuracy depend on a tick timer maintained by the microprocessor.
The TON instruction begins to count when its input rung conditions are true. The accumulated value is reset when the input rung conditions become false.
The TOF instruction begins to count when its input rung makes a true-to-false transition, and continues counting for as long as the input rung remains false. The accumulated value is reset when the input rung conditions become false.
The RTO instruction begins to count when its input rung conditions are true. The accumulated value is retained when the input rung conditions become false, and continues counting after the input rung conditions become true.
Counter Instructions are output instructions used to count false-to-true rung transitions. These transitions are usually caused by events occurring at an input.
These counters can be UP (incrementing) or DOWN (decrementing).
The maximum count value is 9999*. After a maximum count is reached, the counters reset and start counting from zero.
The CTU instruction increments its accumulated value on each false-to-true transition at its input, starting from 0.
The CTD instruction decrements its accumulated value on each false-to-true transition at its input, starting from 0.
The RES instruction resets timing and counting instructions.
When the RES instruction is enabled it resets the following:
Counters:
If you liked this article, then please subscribe to our YouTube Channel for PLC and SCADA video tutorials.
You can also follow us on Facebook and Twitter to receive daily updates.
Read Next: