Why PLC Programming Still Matters
Every automated manufacturing system runs on control logic, and for the vast majority of industrial applications, that logic lives inside a programmable logic controller. PLCs have been the backbone of factory automation since the late 1960s, when they replaced hardwired relay panels in automotive plants. Decades later, the fundamental role hasn't changed: PLCs read inputs from sensors and operator interfaces, execute programmed logic, and drive outputs to actuators, motors, valves, and indicators.
What has changed is the complexity of what we ask these controllers to do. Modern PLCs handle motion control, safety systems, network communications, data logging, and real-time process adjustments all within a single scan cycle. If you're involved in designing, specifying, or maintaining automated equipment, a working knowledge of PLC programming fundamentals isn't optional. It's essential.
Understanding the PLC Scan Cycle
The scan cycle is the heartbeat of every PLC program. Understanding it is the first step to writing reliable control logic.
During each scan, the processor executes three main phases:
-
Input scan - The PLC reads the current state of all physical and networked inputs and stores those values in an input image table. This is a snapshot. No matter what happens to the physical inputs during the rest of the scan, the program works with these captured values.
-
Program execution - The processor evaluates every rung, function block, or instruction in the program from top to bottom, left to right. It updates internal memory, timers, counters, and the output image table based on the logic.
-
Output scan - The PLC writes the output image table to the physical outputs, energizing or de-energizing devices accordingly.
A typical scan cycle takes between 1 and 20 milliseconds depending on program size and processor speed. This matters for time-critical applications. If your process requires response times faster than the scan cycle, you may need high-speed counter inputs, interrupt routines, or a faster processor.
Programming Languages: IEC 61131-3
The international standard IEC 61131-3 defines five programming languages for PLCs. In practice, most industrial automation work uses two or three of them.
Ladder Diagram (LD) remains the most widely used language in North American manufacturing. Its visual format mirrors the relay logic diagrams that electricians and maintenance technicians already understand. Each rung represents a circuit with contacts (inputs) on the left and coils (outputs) on the right. For straightforward discrete control like conveyor sequencing, cylinder actuation, and interlock logic, ladder is hard to beat for readability and maintainability.
Structured Text (ST) is a high-level text-based language similar to Pascal. It excels at mathematical calculations, data manipulation, recipe management, and complex algorithms. When you need to compute a PID output, parse a serial string from a barcode reader, or manage an array of recipe parameters, structured text is significantly more efficient than trying to accomplish the same in ladder.
Function Block Diagram (FBD) uses graphical blocks connected by signal lines, making it well-suited for continuous process control and analog signal processing. Many engineers working with motion control and drive systems find FBD intuitive.
Sequential Function Chart (SFC) provides a top-level framework for organizing sequential processes into steps and transitions. It's particularly useful for batch processes and multi-step machine cycles where the sequence of operations matters more than the individual logic within each step.
Instruction List (IL) is essentially PLC assembly language. It's rarely used for new development today, but you may encounter it in legacy programs.
The best approach is to use the right language for each task within the same project. Most modern PLC platforms support mixing languages freely.
I/O Configuration and Addressing
Getting the I/O architecture right early in a project prevents headaches later. Here are the practical considerations:
Input types - Digital inputs handle limit switches, proximity sensors, photoelectric sensors, and pushbuttons. Analog inputs handle 4-20mA transmitters, 0-10V sensors, thermocouples, and RTDs. Specialty modules handle high-speed encoders, strain gauges, and serial communications.
Output types - Relay outputs work for low-speed switching of AC or DC loads. Transistor (sourcing/sinking) outputs handle higher-speed DC switching. Analog outputs drive proportional valves, variable frequency drives, and displays.
Addressing conventions vary between platforms, but the principle is consistent: every I/O point has a unique address the program references. Maintain a thorough I/O list document mapping every address to its field device, wire number, and function. This single document saves more troubleshooting time than almost anything else you can do.
For larger systems, distributed I/O on industrial networks like EtherNet/IP or PROFINET reduces wiring runs and simplifies installation. The PLC communicates with remote I/O racks over the network, and from a programming perspective, the remote points appear just like local I/O.
Writing Maintainable Code
A PLC program that works is the minimum requirement. A PLC program that a maintenance technician can troubleshoot at 2 AM under production pressure is the real goal. Some principles that matter:
Use meaningful tag names. Conveyor_1_Motor_Run tells you exactly what's happening. O:2/5 does not. Modern PLC platforms support long descriptive tag names with no performance penalty.
Comment everything that isn't obvious. The logic for a simple motor start/stop doesn't need a novel, but the interlock that prevents a press from cycling when the light curtain detects an obstruction should explain the safety rationale.
Organize by machine section. Group your routines or program sections by physical machine area: infeed, process station, outfeed, reject handling. When something stops working, maintenance goes to the area of the machine that's faulted, and your program structure should match that mental model.
Standardize your AOIs and function blocks. If you're building custom assembly systems with repeated stations, create Add-On Instructions or function blocks for common patterns like motor control, cylinder sequences, and part-present checks. This reduces errors and speeds development.
Troubleshooting Fundamentals
When a machine stops and production is waiting, efficient PLC troubleshooting follows a predictable pattern:
Start with the HMI fault display. A well-designed program generates specific fault messages that point directly to the problem: "Station 3 clamp cylinder did not extend - check prox sensor B14."
Next, go online with the PLC and watch the logic execute in real time. In ladder logic, you can see which rungs are true and which contacts are blocking. Follow the logic path from output back through the conditions to find which input or interlock is preventing the expected operation.
Check the I/O diagnostics. Most modern I/O modules report wire-break faults, overcurrent conditions, and short circuits. These hardware-level diagnostics often identify the problem faster than tracing through program logic.
For intermittent issues, trending and data logging are invaluable. Configure the PLC to log relevant signals at high speed so you can capture what happened during a fault event and analyze it afterward. This approach pairs well with a solid sensor selection strategy that ensures your instruments provide the resolution and response time the application requires.
Integration With Broader Automation Systems
PLCs rarely operate in isolation. In a modern production environment, the controller communicates with HMIs, SCADA systems, MES platforms, vision systems, robots, and other PLCs. Understanding the network architecture that connects these systems is important for designing reliable and secure automation.
Common integration points include:
- HMI/SCADA - Tag-based communication over Ethernet for operator displays and process visualization
- Robot controllers - Handshaking signals for part-present, cycle-start, and fault acknowledgment
- Vision systems - Trigger signals and inspection results passed via discrete I/O or network protocols
- MES/ERP - Production counts, recipe selection, and traceability data exchanged through OPC UA or database middleware
Getting Started
If you're evaluating PLC platforms for a new automation project, focus on the ecosystem rather than any single specification. Consider the installed base at your facility, the availability of trained integrators and maintenance staff, the quality of the development environment, and the breadth of compatible I/O and communication modules.
For manufacturers implementing their first automated systems or upgrading legacy controls, having an experienced integration partner shortens the learning curve and avoids common pitfalls. AMD Machines has designed and programmed control systems for over 2,500 custom machines across a wide range of industries. Contact us to discuss your project requirements.
We'll give you an honest assessment - even if it means recommending a simpler solution.