Ladder Logic: Concepts and International Standards
What is Ladder Logic?
Ladder Logic (LD) is a graphical programming language for PLCs inspired by relay diagrams. It represents control logic using “rungs” that evaluate conditions from left to right to drive outputs.
Main Standard
International Electrotechnical Commission – IEC 61131-3
The international standard governing PLC programming languages is:
IEC 61131-3 – Programmable Controllers – Programming Languages
It defines:
- Programming languages (LD, FBD, ST, SFC, IL*)
- Program structure
- Data types
- Best practices
*Instruction List (IL) is obsolete in modern versions.
Basic Ladder Elements
1. Contacts (Logical Inputs)
| Type | Symbol | Function |
|---|---|---|
| Normally Open | –] [– | True when signal = 1 |
| Normally Closed | –]/[– | True when signal = 0 |
2. Coils (Outputs)
| Type | Symbol | Function |
|---|---|---|
| Coil (OTE) | ( ) | Energizes output |
| Latch (SET) | (L) | Holds state |
| Unlatch (RESET) | (U) | Releases state |
3. Execution Flow
- Left → Right
- Top → Bottom
- Each rung is evaluated every scan cycle
- No true parallel execution
PLC Scan Cycle
- Read Inputs
- Execute Logic
- Update Outputs
- Repeat
This cycle occurs in milliseconds.
Key Concepts
1. AND / OR Logic
- AND (Series) → A AND B
- OR (Parallel) → A OR B
2. Internal Memory
- Internal bits (flags)
- Registers (integers, real values)
- Used for intermediate logic
3. Timers
| Type | Function |
|---|---|
| TON | On-delay |
| TOF | Off-delay |
| RTO | Retentive timer |
4. Counters
| Type | Function |
|---|---|
| CTU | Count up |
| CTD | Count down |
5. One-Shot (Edge Detection)
Detects transitions:
- 0 → 1 = single pulse
Typical use:
- Push buttons
- Passing sensors
Industrial Best Practices
1. Logic Separation
Inputs → Processing → Outputs
2. Use Clear Naming
Examples:
- Motor_Run
- Level_High
- Alarm_Fault
Avoid:
- B3:0/1
3. Avoid Redundant Logic
- Do not duplicate conditions
- Centralize decisions
4. State-Based Control
Use:
- State bits
- Numeric variables (state machines)
5. Safety Interlocks
Example:
- Motor AND NOT Overload
6. Fault Handling
- Timeouts
- Sensor inconsistencies
- Alarms
Safety (Important)
IEC recommends:
- Do not rely only on software
- Use safety hardware (E-Stop, safety relays)
- Validate critical conditions
Program Structure
According to IEC:
- Program
- Function Block
- Function
Typical organization:
Main
├── Inputs
├── Logic
├── Outputs
└── Alarms
Diagnostics and Maintenance
Best practices:
- Comment every rung
- Use descriptive variables
- Maintain visible states
- Implement clear alarms
Modern Evolution
Although Ladder remains widely used:
- It is often combined with Structured Text (ST)
- Modular architectures are common
- Integration with HMI/SCADA systems
Conclusion
Ladder Logic remains a standard in industrial automation due to:
✔ Ease of interpretation
✔ Direct relationship with electrical systems
✔ Compliance with IEC standards
✔ High reliability in industrial environments