PLC Programming Course – Chapter 08: IEC 61131-3 Programming Languages
IEC 61131-3 Programming Languages
Understand the international PLC programming standard and learn Ladder Diagram, Function Block Diagram, Structured Text, Sequential Function Chart and legacy Instruction List. Explore programming concepts with practical industrial examples.
1. Introduction
Programmable Logic Controllers (PLCs) are widely used in industrial automation systems to control machines, production lines, motors, pumps, conveyors and process equipment.
PLCs can be programmed using different programming languages. To create a common programming framework for industrial control systems, the International Electrotechnical Commission (IEC) developed the IEC 61131-3 standard.
IEC 61131-3 defines programming language elements and software structuring concepts used in PLC applications. It helps engineers understand and organize control programs across different automation platforms.
In this chapter, we will understand the major PLC programming languages, their characteristics, applications and practical examples used in industrial automation.
2. What is IEC 61131-3?
IEC 61131-3 is an international standard that specifies programming language syntax and semantics for programmable controllers. It provides a common framework for developing and structuring PLC control programs.
What Does IEC 61131-3 Cover?
Programming Languages
Defines the syntax and programming concepts of PLC languages such as LD, FBD and ST.
Program Organization
Describes software elements used to organize PLC application programs.
Data Types
Defines data types and variable-related programming concepts.
Function Blocks
Provides concepts for reusable program units and control functions.
Why Was IEC 61131-3 Developed?
Different PLC manufacturers historically used different programming methods and software environments. A standardized programming framework helps engineers work with consistent programming concepts and improves program organization.
3. Why is IEC 61131-3 Important?
IEC 61131-3 is important because it provides a recognized framework for developing structured and maintainable PLC programs.
Common Programming Framework
Provides common language concepts for programmable controller applications.
Better Program Structure
Helps organize large control programs into manageable software units.
Code Reusability
Functions and function blocks support reusable programming logic.
Maintenance Support
Structured programs are easier to understand, troubleshoot and maintain.
Multiple Programming Methods
Supports different programming approaches for different control applications.
Engineering Collaboration
Common concepts help automation engineers communicate more effectively.
4. Overview of PLC Programming Languages
IEC 61131-3 is commonly associated with five programming language types or approaches. Four are widely used in modern PLC programming, while Instruction List is a legacy language removed from the third edition of the standard.
LD – Ladder Diagram
A graphical language based on relay control logic and electrical ladder diagrams.
FBD – Function Block Diagram
A graphical language that connects function blocks to represent control logic.
ST – Structured Text
A high-level textual language used for calculations, conditions and complex logic.
SFC – Sequential Function Chart
A graphical method for representing sequential operations using steps and transitions.
IL – Instruction List
A low-level textual language retained in older PLC systems but removed from the third edition of IEC 61131-3.
5. Ladder Diagram (LD)
Ladder Diagram is a graphical PLC programming language based on electrical relay control circuits. It is one of the most familiar programming methods for industrial technicians and electricians.
Basic Ladder Diagram Elements
| Element | Symbol / Representation | Function |
|---|---|---|
| Normally Open Contact | –| |– | Logical condition that is true when its associated Boolean variable is TRUE. |
| Normally Closed Contact | –|/|– | Logical condition that is true when its associated Boolean variable is FALSE. |
| Output Coil | –( )– | Assigns a Boolean result to an output or internal variable. |
| Set Coil | –(S)– | Sets a Boolean variable according to the instruction behavior. |
| Reset Coil | –(R)– | Resets a Boolean variable according to the instruction behavior. |
Example: Motor Start and Stop Logic
A basic motor control program can use a Start push button, Stop push button and motor output. The control logic is commonly implemented with a holding or seal-in contact.
STOP START
----|/|----------| |----------------( MOTOR )
|
|
MOTOR
--| |--
This is a simplified teaching representation. Actual PLC logic depends on input wiring, stop circuit design, safety requirements and the selected PLC platform.
Advantages of Ladder Diagram
Easy to Understand
Its relay-style representation is familiar to many electrical technicians.
Easy Troubleshooting
Online monitoring can show the state of contacts and logic conditions.
Industrial Applications
Widely used for machine control, interlocks and motor logic.
Visual Logic
Control conditions can be followed through graphical rungs.
Applications of Ladder Diagram
- Motor Start/Stop Control
- Conveyor Control Systems
- Pump Control Logic
- Machine Interlocking
- Industrial Alarm Logic
6. Function Block Diagram (FBD)
Function Block Diagram is a graphical PLC programming language in which control logic is represented by connecting function blocks. Each block performs a specific operation.
Common Function Blocks
| Function Block | Purpose | Example Application |
|---|---|---|
| AND | TRUE when all inputs are TRUE. | Multiple permissive conditions |
| OR | TRUE when at least one input is TRUE. | Multiple start commands |
| NOT | Inverts a Boolean input. | Logic inversion |
| TON | On-delay timer. | Delayed motor starting |
| TOF | Off-delay timer. | Delayed output switching off |
| CTU | Counts upward. | Product counting |
| CTD | Counts downward. | Remaining quantity calculation |
Example: AND Logic Function
Suppose a motor should start only when both the Start Command and Safety Permissive are TRUE. An AND function block can represent this condition.
START COMMAND ─────┐
├── AND ─── MOTOR OUTPUT
SAFETY PERMISSIVE ─┘
Advantages of FBD
Visual Programming
Logic can be represented using connected blocks.
Reusable Functions
Function blocks can be reused in different parts of a project.
Process Control
Useful for timers, counters, mathematical functions and control operations.
Signal Flow
Connections help engineers understand how data moves through the logic.
Applications of FBD
- Analog Signal Processing
- PID Control Applications
- Interlocking and Permissive Logic
- Timer and Counter Operations
- Process Automation
7. Structured Text (ST)
Structured Text is a high-level textual PLC programming language. It uses statements and expressions similar to conventional programming languages.
Common Structured Text Statements
| Statement | Purpose | Example |
|---|---|---|
| IF / THEN / ELSE | Conditional execution | IF Temperature > 80 THEN |
| CASE | Multiple selection conditions | CASE MachineState OF |
| FOR | Repeating a block for a defined number of iterations | FOR i := 1 TO 10 DO |
| WHILE | Repeating while a condition remains TRUE | WHILE Counter < 10 DO |
| Assignment | Assigning a value to a variable | MotorRun := TRUE; |
Example: Temperature Control Condition
The following simplified example turns on a cooling output when the measured temperature exceeds 80°C.
IF Temperature > 80.0 THEN
Cooling_Fan := TRUE;
ELSE
Cooling_Fan := FALSE;
END_IF;
Example: Analog Scaling Calculation
Structured Text can be used for mathematical calculations. The following example converts a raw input value into an engineering value using linear scaling.
Engineering_Value :=
((Raw_Value - Raw_Min) /
(Raw_Max - Raw_Min)) *
(Eng_Max - Eng_Min) + Eng_Min;
Advantages of Structured Text
Mathematical Operations
Suitable for complex calculations and data processing.
Conditional Logic
Supports IF, ELSE and CASE statements.
Loops
Supports iterative operations where appropriate.
Compact Code
Complex operations can often be expressed in fewer lines.
Applications of Structured Text
- Mathematical Calculations
- Analog Signal Processing
- Data Handling
- Recipe and Batch Processing
- Complex Control Algorithms
8. Sequential Function Chart (SFC)
Sequential Function Chart is a graphical method used to represent sequential control operations. It organizes a process into steps and transitions.
Basic SFC Elements
Step
Represents a stage or operating condition in a sequence.
Transition
Defines the condition required to move from one step to another.
Action
Defines the operation associated with a step.
Branch
Represents alternative or parallel sequence paths.
Example: Automatic Tank Filling Sequence
Advantages of SFC
- Clearly represents sequential processes.
- Helps organize machine operating sequences.
- Supports complex step-based operations.
- Makes process sequence easier to understand.
Applications of SFC
- Automatic Filling Machines
- Batch Processing Systems
- Packaging Machines
- Sequential Motor Operations
- Automatic Production Lines
9. Instruction List (IL) – Legacy Language
Instruction List was a low-level textual PLC programming language that used mnemonic instructions. It was included in earlier editions of IEC 61131-3.
Characteristics of Instruction List
- Uses short mnemonic instructions.
- Represents logic in a sequential textual format.
- Can be found in some older PLC applications.
- Requires familiarity with instruction-level programming.
Illustrative Legacy Instruction List Example
LD Start_Button
ANDN Stop_Button
ST Motor_Output
This is an illustrative legacy-style example. Exact syntax, instruction names and execution behavior depend on the PLC platform and programming environment.
10. Comparison of PLC Programming Languages
Different PLC programming languages are suitable for different types of control applications. The following table summarizes their general characteristics.
| Language | Type | Main Use | Typical Strength |
|---|---|---|---|
| LD | Graphical | Relay logic and machine control | Familiar visual logic |
| FBD | Graphical | Function-based control | Visual function connections |
| ST | Textual | Calculations and complex logic | Flexible textual programming |
| SFC | Graphical sequence method | Sequential processes | Clear process sequencing |
| IL | Textual – Legacy | Older PLC programs | Low-level mnemonic instructions |
Which Language Should You Learn First?
For Beginners
Start with Ladder Diagram because it introduces basic contacts, coils and control logic visually.
For Process Control
Learn Function Block Diagram for interconnected function blocks and control operations.
For Advanced Logic
Learn Structured Text for calculations, data handling and complex conditions.
For Sequential Machines
Study SFC concepts for step-by-step machine and process sequences.
11. How to Choose the Right PLC Programming Language
Selecting a PLC programming language depends on the application, complexity of control logic, engineering requirements and the programming tools supported by the PLC platform.
12. Practical Industrial Examples
Example 1: Conveyor Motor Control
A conveyor motor can be controlled using Ladder Diagram. The logic may include a Start Command, Stop Command, motor overload status and motor output.
Example 2: Tank Level Monitoring
Function Block Diagram can be used to process level signals, compare values with setpoints and generate control commands.
Example 3: Temperature Calculation
Structured Text can perform calculations and conditional operations based on temperature measurements.
IF Temperature > High_Limit THEN
High_Temperature_Alarm := TRUE;
ELSE
High_Temperature_Alarm := FALSE;
END_IF;
Example 4: Automatic Filling Sequence
Sequential Function Chart concepts can represent an automatic filling process using Idle, Filling and Complete steps.
Example 5: Product Counting
A counter function block can count products detected by a proximity sensor on a conveyor. When the preset count is reached, the PLC can generate a batch-complete signal.
13. PLC Program Organization
A well-organized PLC program is easier to understand, test, troubleshoot and maintain. IEC 61131-3 includes software organization concepts that support structured programming.
Configuration
Represents the overall software configuration and resources of a programmable controller system.
Resource
Represents the processing environment in which programs and tasks are executed.
Task
Controls when and how program execution is scheduled.
Program
Contains the main application logic and can use functions and function blocks.
Function
Performs a defined operation and returns a result.
Function Block
Provides reusable logic with internal state that can be retained between executions as defined by its implementation.
Function vs Function Block
| Feature | Function | Function Block |
|---|---|---|
| Return Value | Returns a result | Can provide outputs through its interface |
| Internal State | Does not retain instance state in the same way as a function block | Can maintain internal state |
| Instance | Normally called by its name | Uses an instance |
| Typical Example | Mathematical calculation | Timer or counter function block |
14. PLC Manufacturers and Programming Environments
Different PLC manufacturers provide their own programming environments. These tools support PLC configuration, programming, simulation, diagnostics and online monitoring.
| Manufacturer | Common PLC Platform | Programming Environment |
|---|---|---|
| Siemens | S7-1200 / S7-1500 | STEP 7 / TIA Portal |
| Rockwell Automation | CompactLogix / ControlLogix | Studio 5000 Logix Designer |
| Mitsubishi Electric | FX / iQ-F / iQ-R | GX Works |
| Omron | CP / CJ / NX Series | Sysmac Studio / CX-Programmer |
| Schneider Electric | Modicon PLCs | EcoStruxure Control Expert |
15. PLC Programming Best Practices
💬 NEED GUIDANCE IN PLC?
Contact THE ENGINEERS GROUP for eBook details, course information and learning support.
MESSAGE US ON WHATSAPP16. PLC Programming Interview Questions and Answers
Prepare for PLC programming interviews with these important questions based on IEC 61131-3 and industrial automation.
Q1. What is IEC 61131-3?
IEC 61131-3 is an international standard that defines programming language syntax and semantics for programmable controllers.
Q2. What is the main purpose of IEC 61131-3?
Its purpose is to provide a common framework for PLC programming languages and software organization.
Q3. What is Ladder Diagram?
Ladder Diagram is a graphical PLC programming language based on relay control logic.
Q4. What is Function Block Diagram?
FBD is a graphical language that uses interconnected function blocks to represent control operations.
Q5. What is Structured Text?
Structured Text is a high-level textual PLC programming language used for calculations, conditions and complex logic.
Q6. What is Sequential Function Chart?
SFC is a graphical method used to represent sequential operations through steps, transitions and actions.
Q7. What is Instruction List?
Instruction List is a legacy textual PLC programming language that uses mnemonic instructions. It was removed from the third edition of IEC 61131-3.
Q8. Which PLC programming language is similar to relay logic?
Ladder Diagram is based on relay control logic and is commonly used for machine control applications.
Q9. Which language is suitable for complex mathematical calculations?
Structured Text is generally suitable for complex calculations and data-processing operations.
Q10. What is a function block?
A function block is a reusable program unit that can maintain internal state and provide outputs through its interface.
Q11. What is the difference between a function and a function block?
A function returns a result and does not retain instance state in the same way as a function block. A function block uses an instance and can maintain internal state.
Q12. What is a TON timer?
TON is an on-delay timer function block. Its output becomes TRUE after the input has remained TRUE for the preset time.
Q13. What is the purpose of an SFC transition?
A transition defines the condition required for the sequence to move from one step to another.
Q14. What is a PLC task?
A task controls the scheduling and execution of programs within a PLC resource.
Q15. What is a PLC program?
A PLC program contains application logic that performs the required control operations.
Q16. Why are comments important in PLC programming?
Comments explain program logic and help engineers understand, troubleshoot and maintain the application.
Q17. What is the advantage of Ladder Diagram?
It provides a familiar graphical representation of control logic and is useful for troubleshooting industrial control systems.
Q18. What is the advantage of Function Block Diagram?
It provides a visual representation of interconnected functions and is useful for control and signal-processing applications.
Q19. Can different PLC programming languages be used in one project?
Many PLC environments support multiple programming languages within the same project, depending on the platform and its capabilities.
Q20. Why should PLC programs be tested before commissioning?
Testing helps verify the intended logic, identify errors and reduce the risk of unexpected equipment behavior during commissioning.
FREE 100 PLC INTERVIEW Q&A PDF DOWNLOAD
Download your free PLC learning material.
📥 DOWNLOAD FREE PLC PDFTHE ENGINEERS GROUP
17. PLC Programming Practice MCQs
Test your understanding of IEC 61131-3 programming languages with these multiple-choice questions.
A) IEC 60204
B) IEC 61131-3
C) IEC 60364
D) IEC 60529
A) Structured Text
B) SFC
C) Ladder Diagram
D) Instruction List
A) Function Block Diagram
B) Field Bus Device
C) Functional Binary Data
D) Fast Block Design
A) LD
B) FBD
C) ST
D) SFC
A) LD
B) SFC
C) ST
D) IL
A) Ladder Diagram
B) Function Block Diagram
C) Structured Text
D) Instruction List
A) FBD
B) ST
C) IL
D) Text Editor
A) CONTACT
B) IF…THEN
C) COIL
D) RUNG
A) Off-delay timer
B) On-delay timer
C) Down counter
D) Up counter
A) Ladder Diagram
B) SFC
C) Structured Text only
D) Instruction List only
A) Coil
B) Transition
C) Register
D) Counter
A) GX Works
B) TIA Portal
C) Studio 5000
D) CX-Programmer
A) It uses only text
B) It visually represents interconnected functions
C) It does not support logic
D) It is only used in old PLCs
A) Task
B) Contact
C) Coil
D) Sensor
A) Increase input voltage
B) Explain program logic
C) Change hardware address
D) Increase scan time intentionally
18. Chapter Summary
IEC 61131-3 provides an international framework for PLC programming languages and software organization. It helps engineers develop structured and maintainable programmable controller applications.
In this chapter, we studied Ladder Diagram (LD), Function Block Diagram (FBD), Structured Text (ST), Sequential Function Chart (SFC) and legacy Instruction List (IL).
Each programming approach has its own characteristics and applications. Ladder Diagram is widely used for relay-style control logic, FBD represents interconnected functions, Structured Text supports calculations and complex logic, and SFC represents sequential operations.
Understanding these languages is an important foundation for developing, maintaining and troubleshooting industrial PLC programs.
Learn the programming concepts, practice industrial logic and improve your automation skills with THE ENGINEERS GROUP.
19. Next Chapter – Ladder Logic Fundamentals
In the next chapter, we will learn Ladder Logic Fundamentals, including ladder diagrams, power rails, rungs, contacts, coils and basic PLC logic development.
You will understand how to create simple control programs using practical industrial examples.
CONNECT WITH THE ENGINEERS GROUP
Learn. Practice. Improve. Grow.
📘 EXPLORE OUR EBOOK 💬 CONTACT US ON WHATSAPP ▶️ SUBSCRIBE ON YOUTUBE FOLLOW US ON FACEBOOKTHE ENGINEERS GROUP
Free Engineering Education for Everyone
