How to Write Correct Ladder Logic Program

Ladder Logic Program

Many of the beginners do confuse about writing correct ladder logic diagram. If they are not guided with the correct set of rules, it is very difficult to understand. Even after completing many industry ready PLC SCADA training courses, beginners in PLC programming find no clue whether there program is correct or not.Here we are describing basics of ladder programming for beginners.

Ladder Diagram Rules

  1. In a ladder diagram power flows from justify to right.
  2. Do not draw Input or Out put alone in the rung.
  3. Input and output can be shown by XIC (Normally Closed) or XIO(Normally Open)  contacts and output by (OLE) coil.
  4. Any Input or Output without address is wrong.
  5. Input can be connected in series as well as in parallel depends upon the logic demands.
  6. Output can not be connected in series, it can only be connected in parallel. In some software like TIA portal if we connect output in series it shows the energized coils in series but it is wrong according to IEC6113-3 standards for PLC programming.
  7. In a ladder we can repeat the Input any number of times but Output can not be repeated.
  8. Two rungs can not be interconnected.
  9. In case of latching it is better to use a memory bit rather than using output directly.
  10. Use of memory bit in your ladder program makes your program more logical and flexible.
  11. Using too many rungs unnecessarily is avoided in PLC program. Think of a logical solution for better choices of ladder diagram.
  12. Getting result is not that much important in PLC ladder diagram, it is getting optimal result with logically correct ladder diagram.
  13. In simulation many ladder diagrams run correctly but in the field they fail. The reason for this type of problem is concept clarity of ladder logic development.

In industry people do not care for a solution, they do care for optimal solution. So practice some of these questions and enjoy ladder Programming.

1) – Car Parking

I-1 – Car wants to ENTER – Sensor

I-2 – Car ENTRY OVER Sensor

I-3 – Car wants to EXIT -Sensor

I-4 – Car EXIT OVER Sensor

I-5 – Parking Space for Car I-6 – Parking Space for Car I-9 – Parking Space for Car I-10- Parking Space for Car

Q-1 – Parking FULL indication

Q-2 – Parking SPACE available indication

Q-3 – ENTRY GATE OPEN / CLOSE indication

Q-4 – EXIT GATE OPEN / CLOSE indication

When a car comes at the Entry Gate, ONLY IF there is SPACE available for Parking, the Entry Gate should open. ONLY when the Car  passes  from Entry  Over  Sensor  I2,  the Entry  Gate  should close.

When a car wants to EXIT from the Parking area, it will come at

the EXIT GATE.   When Input I3 senses a Car, EXIT Gate will open.  ONLY when the Car passes from I4 i.e. Exit Over Sensor, the EXIT Gate should close.

When Space is available for parking the Car/s at either I5 / I6 / I9 / I10, SPACE indication Q2 should be ON and FULL indication Q1 should be OFF.

When the Parking area is fully occupied FULL indication Q1 should be ON and SPACE indication should be OFF.

[1-B] Write above program using Memory

2) – Bottling Plant

I11- Start Conveyor

I1- Milk Filling position sensor

I2- Milk filled till expected level sensor

I3- Capping position sensor

I4- Capping plunger limit switch sensor. I5- Labeling Position sensor

I6- Label detection sensor

Q1- Conveyor

Q2- Milk Filler valve

Q3- Capping Piston

Q4- Labeling Piston

Start the conveyor with I-11.

When Bottle is sensed by I1, i.e. I1 becomes ON,

Stop the conveyor & Start (Open) Milk Filler valve.

When I2 becomes ON, Stop the Valve & Start Conveyor.

When Bottle is sensed by I3, i.e. I3 becomes ON, Stop the conveyor & Start Capping Piston.

When I4 is ON i.e. a Cap is detected on the Bottle, Stop Capping Piston & Start Conveyor.

When Bottle is sensed by I5, i.e. I5 becomes ON, Stop the conveyor & Start Labeling Piston

When I6 becomes ON i.e. a Label is detected

Stop the Labeling piston & Start Conveyor.

[2-B] Write above program using Timers for Q1, Q2, and Q3

& Q4 Count the number of Bottles being filled.

To know more about basics of PLC please visit

Leave a Reply

Your email address will not be published. Required fields are marked *