Programmable Logic Controllers: Practical Approach to IEC 61131-3 Using CODESYS


Table of Contents

Programmable Logic Controllers
Preface
Part One: Hardware
1 About PLCs
1.1 History
1.2 Structure
1.3 PLC Operation
1.4 Test Problems
2 Digital Signals and Digital Inputs and Outputs
2.1 Introduction
2.2 Terminology
2.3 Switches
2.4 Logical Sensors
2.5 Connection of Logical Sensors
2.6 Properties of Discrete Inputs
2.7 Discrete Actuators
2.8 Test Problems
3 Analog Signals and Analog I/O
3.1 Introduction
3.2 Digitalization of Analog Signals
3.3 Analog Instrumentation
3.4 Temperature Sensors
3.5 Connection
3.6 Properties of Analog Input Modules
3.7 Analog Output Modules and Standard Signal Formats
3.8 Test Problems
Part Two : Methodic
4 Structured Design
4.1 Introduction
4.2 Number Systems
4.3 Digital Logic
4.4 Boolean Design
4.5 Sequential Design
4.6 State-Based Design
4.7 Summary
4.8 Test Problems
Part Three: IEC 61131-3
5 Introduction to Programming and IEC 61131-3
5.1 Introduction
5.2 Brief Presentation of the Languages
5.3 Program Structure in IEC 61131-3
5.4 Program Processing
5.5 Test Problems
6 IEC 61131-3: Common Language Elements
6.1 Introduction
6.2 Identifiers, Keywords, and Comments
6.3 About Variables and Data Types
6.4 Pragmas and Literals
6.5 Data Types
6.6 Variables
6.7 Direct Addressing
6.8 Variable versus I/O-Addresses
6.9 Declaration of Multielement Variables
6.10 Test Problems
7 Functions
7.1 Introduction
7.2 On Functions
7.3 Standard Functions
7.4 Boolean Operations
7.5 Arithmetic Functions
7.6 Comparison
7.7 Numerical Operations
7.8 Selection
7.9 Type Conversion
7.10 Bit-String Functions
7.11 Text-String Functions
7.12 Defining New Functions
7.13 EN/ENO
7.14 Test Problems
8 Function Blocks
8.1 Introduction
8.2 Declaring and Calling FBs
8.3 FBs for Flank Detection
8.4 Bistable Elements
8.5 Timers
8.6 Counters
8.7 Defining New FBs
8.8 Programs
8.9 Test Problems
Part Four: Programming
9 Ladder Diagram (LD)
9.1 Introduction
9.2 Program Structure
9.3 Boolean Operations
9.4 Rules for Execution
9.5 Use of Standard Functions in LD
9.6 Development and Use of FBs in LD
9.7 Structured Programming in LD
9.8 Summary
9.9 Test Problems
10 Function Block Diagram (FBD)
10.1 Introduction
10.2 Program Structure
10.3 Execution Order and Loops
10.4 User-Defined Functions and FBs
10.5 Integer Division

Preface

As long as there have been competing producers of PLCs on the market, there have been different programming languages from one PLC brand to another. Even though the same languages, beginning with Instruction Lists (IL) and Ladder diagram (LD), have been used by most of the producers, all of them added their own “dialects” to the languages. When physical programming terminals replaced software-based programming tools, the differences between languages of the various producers escalated. Several programming languages also saw the light of day. This development was the natural result of the attempt by the producers to make themselves stand out among increasing competition by developing the most user-friendly languages and tools.

When the IEC1 61131-3 standard came out in 1993, the situation started to improve. This
standard was the result of the work that had been ongoing for several years in which the best from the various languages and dialects from different producers was assembled into a single document. This is not a rigid standard in the sense that the producers must follow all requirements and specifications, but more a set of guidelines that the producers could choose to follow to a certain extent. Today, most of the equipment producers have come to realize the advantages of organizing themselves in accordance with the standard. All of the major producers of PLCs, such as Telemecanique, Wago, Mitsubishi, Klockner Moeller, AllenBradley, Omron, Siemens, and so on, have therefore, to a greater or lesser extent, adapted their programming tools to IEC 61131-3.This book covers close to 100% of the specifications and guidelines that are given in Standard (International Electrotechnical Commission, 2013).2 The book will therefore be interested to everyone who works with, or wants to learn about programming PLCs, no matter which PLC brand they use

Programmable Logic Controllers: Practical Approach to IEC 61131-3 Using CODESYS

The IEC 61131-3 standard is the global benchmark for programming languages used in Programmable Logic Controllers (PLCs). CODESYS, a widely adopted development environment, is specifically designed to implement this standard. Here's a guide to understanding and practically applying this approach:


What is IEC 61131-3?

IEC 61131-3 defines the programming languages and guidelines for PLCs. It enables consistent, portable, and scalable software development for industrial automation systems.

Supported Programming Languages:

  1. Ladder Diagram (LD): Graphical language based on relay logic.
  2. Structured Text (ST): High-level, text-based programming (similar to Pascal).
  3. Function Block Diagram (FBD): Graphical language for control algorithms using function blocks.
  4. Sequential Function Chart (SFC): Language for sequential control and state machines.
  5. Instruction List (IL): Low-level language (now deprecated in newer versions of IEC 61131-3).

What is CODESYS?

CODESYS is an Integrated Development Environment (IDE) for developing automation software based on IEC 61131-3. It supports all five programming languages and provides tools for simulation, debugging, and hardware integration.

Key Features:

  • Hardware-independent platform, supported by numerous PLC manufacturers.
  • Online and offline simulation for program testing.
  • Advanced debugging tools: Breakpoints, variable monitoring, and trend recording.
  • Support for visualization and HMI development.
  • Integration with fieldbuses like Modbus, EtherCAT, and CANopen.

Practical Approach to IEC 61131-3 Using CODESYS

  1. Install CODESYS:

  2. Select Target Hardware:

    • Choose a PLC that supports CODESYS (e.g., WAGO, Beckhoff, or Schneider Electric devices).
    • Alternatively, use a virtual PLC in CODESYS for learning and testing.
  3. Create a New Project:

    • Launch CODESYS and create a new project.
    • Select the desired IEC 61131-3 language (e.g., LD, ST, or FBD).
  4. Develop the Control Logic:

    • Use the editor to write programs for the selected language.
    • Structure your code using POUs (Program Organization Units):
      • Programs: Main execution units.
      • Function Blocks: Reusable code units with internal state.
      • Functions: Stateless reusable blocks.
  5. Simulate the Program:

    • Use the built-in simulation tools to test your program without physical hardware.
    • Monitor and debug using variable tracing and breakpoint tools.
  6. Deploy to PLC:

    • Connect to the PLC using supported communication interfaces (Ethernet, USB, etc.).
    • Download and execute the program on the PLC.
  7. Visualize and Monitor:

    • Use the integrated visualization tools to create HMIs for monitoring and control.
    • Test live data using online monitoring.

Advantages of Using CODESYS with IEC 61131-3

  • Standardized Development: Ensures compatibility and portability across devices.
  • Flexibility: Choose the best programming language for each task.
  • Efficiency: Simplifies debugging and maintenance with reusable function blocks.
  • Scalability: Suitable for projects ranging from small machines to complex industrial systems.



You have to wait 05 seconds.

Download Timer
Previous Post Next Post