PLC

Also known as: Programmable logic controller

On this page 7

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.

PhaseWhat happensTypical share of scan
Input scanPhysical input states copied to the input image5-10 percent
Program executionUser logic evaluated against the image60-85 percent
Output updateOutput image written to physical terminals5-10 percent
HousekeepingDiagnostics, communication, watchdog reset5-20 percent
Phases of a typical PLC scan cycle

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.

LanguageStyleBest suited for
Ladder diagram (LD)Graphical relay logicInterlocks, discrete on/off control
Function block diagram (FBD)Graphical signal flowAnalog processing, PID loops
Structured text (ST)Pascal-like textCalculations, data handling, algorithms
Sequential function chart (SFC)Steps and transitionsMachine sequences, batch phases
Instruction list (IL)Assembly-like textLegacy code; deprecated in edition 3
IEC 61131-3 languages and their typical uses

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.

PlatformMain strengthTypical cycle timeTypical role in a cell
PLCDeterministic, rugged, maintainable1-50 msSequencing, interlocks, I/O
Robot controllerKinematics, trajectory, servo control0.25-4 msArm motion and path planning
Industrial PC with ROS 2Perception, planning, flexible softwareVariable, 1-100 msVision, mobile autonomy, research
Safety PLCCertified fault-tolerant logic5-30 msEmergency stops, light curtains
MicrocontrollerLow cost, very fast loopsMicrosecondsEmbedded drives and sensors
PLC versus related control platforms

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.

SymptomLikely causeRemedy
Missed short sensor pulsesPulse shorter than scan timeUse high-speed inputs or interrupts
Erratic outputsSame output written in several placesWrite each output in one routine
Cell stuck after faultNo recovery path in the sequenceDesign explicit reset and homing steps
Watchdog faultsLoops or heavy math in the main taskMove work to slower periodic tasks
Security incidentsOpen network ports, default passwordsSegment networks per IEC 62443
Frequent PLC problems, causes and remedies

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.