There are as many different kinds of programming software as there are PLC manufacturers. Each maker created their own proprietary software, with the only requirement being that it adhere to relay ladder logic for technicians to learn it without having to be software engineers.
PLC Program Categories
There are two main categories of PLC programs:
- open architecture
- closed architecture
To a large extent, open-architecture software doesn’t require a license to use, modify, or copy. When it comes to PLCs, “closed architecture” refers to the use of proprietary software that can only be obtained directly from the manufacturer and is not available for redistribution.
It becomes more challenging to link devices from different manufacturers in this way. The shortage created issues for the market.
The International Electrotechnical Commission (IEC) has defined standard 61131 as the primary standard for PLC programming today. As the most widely used benchmark, it addresses:
IEC 61131, this standard is broken down into:
• IE 61131-1 Programmable controllers – Part 1: General information.
• IEC 61131-2:2003 Programmable controllers – Part 2: Equipment requirements and tests.
• IEC 61131-3:2003 Programmable controllers – Part 3: Programming languages.
• IEC 61131-4:2004 Programmable controllers – Part 4: User guidelines.
• IEC 61131-5:2000 Programmable controllers – Part 5: Communications.
• IEC 61131-7: Programmable controllers – Part 7: Fuzzy control programming.
• IEC 61131-8:2003 Programmable controllers – Part 8: Guidelines for the application and implementation of programming languages.
The goal of this standard was to establish a framework for software development that would make it possible for engineers and technicians with varying levels of expertise to gain access to computer programming. Others try to set the bar higher, but they all ultimately come back to this one. The guidelines will shift as programming becomes more advanced.
Lastly, the GM engineers insisted that the programming be done using relay ladder logic, a system already well-known to the plant’s electricians, engineers, and technicians.
For many years, Ladder and Relay Logic was the norm, and it is still widely used today. It serves as the basis upon which PLC programs are designed. PLC programming and troubleshooting training was simplified as a result, and the adoption of the new technology was greeted with less resistance.
PLC Scan Cycle
Software for PLCs was originally developed using industry-standard relay logic. Let’s examine the inner workings of a program now that we know how it came to be.
User programs are loaded into memory on the PLC’s CPU. The execution of the code initiates what is known as a PLC scan cycle. During the scan cycle, all inputs will be read and the input status file will be updated accordingly. The PLC ladder logic is modified accordingly.
Finally, the system sends on/off signals to the relevant outputs and updates the output status file. This scanning procedure is repeated many times throughout the PLC program’s execution. Because of this, the PLC can instantly read from and write to its inputs and outputs.
To view a video illustration of the scan cycle procedure, please watch the video below:
The scan cycle operates in a sequential fashion, reading and executing one line of code at a time. In the same way that a ladder logic diagram reads from left to right, so does this reader. The status of the program files is being constantly updated and executed by the CPU.
When additional information or mathematical/logical processing is required, the scan is halted and a suitable memory subroutine is retrieved. Attached to these procedures are data files used to keep track of data for things like timers and counters. When the subroutine is finished, control is handed back to the user program and the scanning process continues.
That’s the fundamental framework of a ladder logic-based PLC program. The structure of modern programs is a lot more intricate. More intricate and complex programming is needed in today’s industrial settings.
Expanding on the standard of ladder logic programming, function block programming has become increasingly popular. It enables the programmer to define a subroutine as a chunk of data that can be accessed and reused repeatedly without requiring any new coding.
With ladder logic becoming increasingly obsolete, statement list programming has emerged as a viable alternative for communicating with PLCs.
Both are popular and useful, but they differ from PLCs’ traditional ladder logic programming.
The next step is to analyze a sample PLC program that demonstrates how a PLC can be used to automate a process by reading inputs and controlling outputs to fill a water tank. Keep in mind that the PLC is constantly checking, monitoring, and updating the outputs. Just watch this video: