A PLC (programmable logic controller) is a ruggedized industrial computer that reads inputs from sensors, executes a stored control program in a repeating scan cycle and writes outputs to actuators such as motors, valves and contactors. In robotics and industrial control systems, the PLC is usually the cell-level supervisor: it sequences conveyors, fixtures, safety interlocks and robot controllers so that an automated workcell behaves predictably, shift after shift.
PLCs replaced hard-wired relay panels in the late 1960s, and their design still reflects that heritage: deterministic execution, ladder logic that resembles electrical schematics, and hardware built to survive vibration, electrical noise and temperatures that would disable an office PC.
How a PLC executes its scan cycle
A PLC runs its program in a fixed, cyclic loop rather than responding to events in arbitrary order. Each cycle has distinct phases, and the sum of their durations is the scan time, typically 1 to 50 milliseconds depending on program size and processor speed.
The defining property is the process image: inputs are copied into memory once at the start of the cycle, the logic operates on that frozen snapshot, and outputs are written together at the end. This makes behavior repeatable and analyzable, because a signal cannot change halfway through a logic evaluation.
| Phase | What happens | Typical share of scan |
|---|---|---|
| Input scan | Physical input states copied to the input image | 5-10 percent |
| Program execution | User logic evaluated against the image | 60-85 percent |
| Output update | Output image written to physical terminals | 5-10 percent |
| Housekeeping | Diagnostics, communication, watchdog reset | 5-20 percent |
A watchdog timer supervises every cycle. If the scan exceeds a configured limit, for example because of an endless loop, the controller faults and drives outputs to a defined safe state. Many modern PLCs also support cyclic interrupt tasks that run time-critical routines at fixed intervals, independent of the main scan.
Programming languages defined by IEC 61131-3
The international standard IEC 61131-3 defines five languages for PLC programming, and most vendors implement several of them. Choosing the right language for each part of a program is a mark of mature engineering practice, because readability for maintenance staff matters as much as elegance.
| Language | Style | Best suited for |
|---|---|---|
| Ladder diagram (LD) | Graphical relay logic | Interlocks, discrete on/off control |
| Function block diagram (FBD) | Graphical signal flow | Analog processing, PID loops |
| Structured text (ST) | Pascal-like text | Calculations, data handling, algorithms |
| Sequential function chart (SFC) | Steps and transitions | Machine sequences, batch phases |
| Instruction list (IL) | Assembly-like text | Legacy code; deprecated in edition 3 |
Programs are organized into program organization units: programs, function blocks with internal memory, and stateless functions. Reusable function blocks for motors, valves and robot handshakes form the backbone of a well-structured PLC library, and the related standard IEC 61499 extends the model toward distributed, event-driven applications.
How a PLC compares with other robot controllers
A PLC is not a replacement for a robot controller or a motion computer; each device handles a different layer of the control hierarchy. The robot controller solves kinematics and servo loops at kilohertz rates, while the PLC coordinates the surrounding equipment and decides when the robot may move.
| Platform | Main strength | Typical cycle time | Typical role in a cell |
|---|---|---|---|
| PLC | Deterministic, rugged, maintainable | 1-50 ms | Sequencing, interlocks, I/O |
| Robot controller | Kinematics, trajectory, servo control | 0.25-4 ms | Arm motion and path planning |
| Industrial PC with ROS 2 | Perception, planning, flexible software | Variable, 1-100 ms | Vision, mobile autonomy, research |
| Safety PLC | Certified fault-tolerant logic | 5-30 ms | Emergency stops, light curtains |
| Microcontroller | Low cost, very fast loops | Microseconds | Embedded drives and sensors |
PLCs are capable of closed-loop feedback control: standard instruction sets include PID blocks suitable for temperature, pressure and flow loops. However, scan-time jitter and limited floating-point throughput make them a poor choice for high-bandwidth motion control, which is delegated to drives or dedicated motion modules.
Hardware architecture and communication
PLC hardware ranges from compact units with a dozen built-in I/O points to modular rack systems with hundreds of cards and redundant processors. The main components are the CPU module, power supply, digital and analog I/O modules, and communication interfaces.
- Digital I/O commonly uses 24 V DC signals for sensors, pushbuttons and solenoids.
- Analog I/O handles 4-20 mA or 0-10 V signals from transmitters and to proportional valves.
- Remote I/O stations reduce wiring by placing modules close to the machine.
- Industrial Ethernet protocols such as PROFINET, EtherNet/IP and EtherCAT link the PLC to drives, robots and HMIs.
- OPC UA provides structured data exchange with MES, SCADA and cloud systems.
In a robot cell, the PLC exchanges a handshake signal set with the robot controller: program number, start, cycle complete, fault and zone-clear bits. Defining this interface clearly is one of the most important integration decisions, because ambiguous handshakes cause deadlocks and collisions.
Limitations and common engineering mistakes
PLCs are reliable, but most field failures originate in program design rather than hardware. The following table summarizes recurring problems that commissioning engineers encounter.
| Symptom | Likely cause | Remedy |
|---|---|---|
| Missed short sensor pulses | Pulse shorter than scan time | Use high-speed inputs or interrupts |
| Erratic outputs | Same output written in several places | Write each output in one routine |
| Cell stuck after fault | No recovery path in the sequence | Design explicit reset and homing steps |
| Watchdog faults | Loops or heavy math in the main task | Move work to slower periodic tasks |
| Security incidents | Open network ports, default passwords | Segment networks per IEC 62443 |
A frequent misconception is that a standard PLC can implement functional safety on its own. Emergency stops and guarding require a certified safety PLC or safety relay rated to ISO 13849 or IEC 62061; ordinary logic may monitor safety devices but must not be the only protection. Cybersecurity is another growing concern, since many legacy controllers accept program changes without authentication.
In simple terms
A PLC is a tough little computer that runs a machine. It looks at its switches and sensors, decides what should happen according to its program, and then turns motors, lights and valves on or off. It repeats this check many times every second, always in the same order.
Think of it as a very disciplined supervisor on a factory floor. It never improvises, it does not get tired, and it keeps working in dust, heat and noise. In a robot cell, the robot moves the arm, while the PLC decides when it is safe and useful for the robot to move.
A practical example
A packaging plant installs a robotic palletizing cell at the end of a carton line. A modular PLC with about 120 I/O points controls the infeed conveyor, a carton turner, a pallet dispenser and the light curtains at the cell entrance, while a six-axis robot controller handles the arm motion.
The PLC program, written in ladder diagram for interlocks and sequential function chart for the pallet sequence, runs with a scan time of about 8 ms. When a full pallet is detected, the PLC stops the infeed, signals the robot to finish its current layer and commands the pallet conveyor to index. A separate safety PLC stops the robot within its rated stopping time whenever an operator breaks the light curtain.
After commissioning, maintenance technicians diagnose most stoppages from the HMI fault list without opening the code, and the cell reaches its target of 12 cartons per minute with unplanned downtime below one percent per shift.