Ahmedonics builds control systems on all three: programmable logic controllers, custom boards around a microcontroller, and industrial PCs. None of them is the modern one and none is the cheap one; each is the right answer to a different question. The question is rarely about the technology. It is about the site the machine will run on, the number of machines there will be, and the people who will keep them running for the next fifteen years. This guide sets out what each controller gives you and costs you, the questions that decide, and the combinations that turn up again and again in real plants.
What a PLC gives you
A PLC is a computer that has been designed, tested and packaged to run one program forever in a dirty cabinet. Its inputs and outputs are built to IEC 61131-2: 24 V DC inputs that tolerate the wiring mistakes a panel builder makes, relay and transistor outputs that survive an inductive load, analogue channels that are isolated and protected, all rated for 0 to 55 °C, vibration and the surges and fast transients of an industrial supply. The program runs as a scan: read all inputs, execute the logic top to bottom, write all outputs, repeat, typically every 1 to 10 ms, and the scan time is known, bounded and displayed. That determinism, without any effort from the programmer, is the property that makes a PLC a PLC.
It is programmed in the IEC 61131-3 languages: ladder diagram, function block diagram, structured text and sequential function chart. An electrician who has never written software can read a ladder rung and, with the programming laptop, see it change colour as the machine runs. Every module has status LEDs; a failed input card is found by looking at it and replaced by unplugging it, on some ranges without stopping the CPU. The manufacturers keep a controller family in production and supported for well over a decade, and the same program runs on the replacement. All of this is why plants have a maintenance culture around PLCs and none around anything else.
The costs are just as definite. The price per I/O point is high: a PLC with 64 digital and 8 analogue points, a power supply, an HMI panel and the software licence costs several times what the equivalent circuitry costs as a board, and the price does not fall if you build ten. You are tied to one vendor's programming environment, some of which are paid and licensed to a machine, and to that vendor's idea of what an analogue input, a communications module or a data log should be. Anything the vendor did not anticipate, a special sensor, a fast waveform, a custom protocol, is either an expensive module or not possible.
What a microcontroller gives you
A microcontroller board is the same idea reduced to a circuit board that does exactly one job. Its cost at volume is the cost of the chip, the board and the parts on it, which for a small controller is a few thousand rupees rather than a few hundred thousand. It can be any size, run from a battery or a solar panel, sleep at microamps, and carry whatever front end the measurement needs: a 24-bit converter for a load cell, a precision reference for a 4–20 mA input, an isolated driver for a specific actuator, a radio. The firmware is yours: no licence, no vendor runtime, no feature that cannot be added, and a product you can sell as your own.
Everything the PLC gave you for free is now your responsibility. Input protection, isolation and EMC immunity are your circuit design and your test report. The watchdog, the brown-out reset, the safe state on power loss and the fault log are code you write, and if you do not write them the board hangs in the field with no LED to tell anyone why. A field firmware update needs a bootloader, a transport and a way to recover from a bad update. Diagnostics that a PLC shows on its front need a display, a serial console or a cloud dashboard that you build. And there is no standard maintenance path: the technician who can swap a PLC card cannot do anything with a board except replace it, so the design has to be replaceable as a unit and you have to hold spares. The road from a working development board to a product that survives a thousand installations is a discipline of its own, covered in from dev board to product.
The microcontroller wins where those costs are paid once and the savings are collected many times: a device built in the hundreds or thousands, a measurement no PLC module makes, a place a PLC cannot fit or be powered, or a product whose value is the firmware.
What an industrial PC gives you
An industrial PC is a fanless computer, x86 or ARM, in a panel-mount or DIN-rail box, running Linux or Windows. It gives you compute and software: a vision library processing camera frames, a database logging every cycle of the machine, an HMI with real graphics, a machine-learning model running at the edge, an OPC UA server, a VPN client, a web browser. It runs the same tools your software engineers use everywhere else, and it can run a soft-PLC runtime, which executes IEC 61131-3 programs on the PC and talks to remote I/O over an industrial Ethernet.
What it does not give you, without work, is determinism. A general-purpose operating system schedules your control loop alongside its updates, its logging and its network stack, and a loop that runs every 10 ms on average will occasionally run after 100 ms. A real-time kernel, a soft-PLC runtime with its own scheduler, or a separate PLC for the parts that must be on time are the answers, and the last is the most common. The IPC has the failure modes of a PC: a solid-state disk that wears out under continuous logging, an operating system that wants to reboot for an update at 3 a.m., a power cut that corrupts a file system that was not mounted read-only, and a panel at 50 °C that halves the life of every electrolytic capacitor in its power supply for every 10 °C above the rating. All of these are manageable, and all of them have taken a machine down.
The IPC belongs where the job is compute, data or a user interface, and almost always on top of something else that handles the I/O.
The decision, in questions
- How many I/O points, and of what kind? Fifty 24 V inputs, thirty relay outputs and a dozen 4–20 mA loops is PLC territory: the modules exist, the wiring is standard and the panel builder knows it. Four inputs, a pressure sensor and a radio is a board. A camera and a gigabyte a day of log is a PC.
- Is there a safety function? Anything that protects a person from a machine, an emergency stop, a guard interlock, a light curtain, a two-hand control, falls under IEC 62061 or ISO 13849-1 and is implemented with a safety relay or a safety PLC certified to those standards, never with an ordinary PLC program and never with a microcontroller you designed yourself. The rest of the machine can be on whatever suits it; the safety circuit is separate and it is certified.
- How fast, and how predictable? A conveyor and a pump tolerate 10 ms of jitter; a flying shear or a servo axis does not. Where timing is the product, a PLC with motion modules or a dedicated motion controller; where a microsecond matters, a microcontroller with hardware timers; a PC only with a real-time layer.
- What environment? A ventilated control room and a cabinet on a Sindh sugar mill's boiler floor in June are different places. PLCs are rated for 55 °C, industrial PCs usually for 50 °C, and a custom board is rated for whatever you designed and tested it to.
- How many will you build? One machine, or a line of three, is a PLC. A hundred tank monitors, a thousand smart meters or a product you sell is a board, because engineering cost is paid once and unit cost is paid every time.
- Who maintains it, and with what? If the plant's electrician will keep it running with a laptop and the vendor's software, it is a PLC. If you will maintain it remotely and ship replacements, a board or an IPC is possible.
- How long must it last? A PLC family is supported for well over a decade and the replacement runs the same program. A microcontroller goes out of production on the chip maker's schedule, and an IPC's operating system on the software vendor's; both need a plan for that day.
- What must it talk to? Modbus RTU and TCP are available on all three. PROFINET, EtherNet/IP and EtherCAT are native to PLCs and IPCs and a serious effort on a board. OPC UA and MQTT are natural on an IPC, possible on a modern PLC, and a lean subset on a microcontroller. The Modbus guide covers the protocol every one of them speaks.
- Who certifies it? A PLC and an IPC carry their own CE and UL marks; the machine builder certifies the machine. A custom board is certified by whoever designed it, which means EMC testing, a technical file and the time and money for both.
- Capital or engineering? A PLC turns the problem into a purchase order and a few weeks of programming. A board turns it into months of design and test and a low unit price. An IPC sits between, with the software effort depending entirely on what runs on it. The right choice is the one whose total cost is lowest over the life of the machine, not the one with the lowest invoice.
Combinations that work
Most real systems are two of the three, and the combinations are more instructive than the pure cases.
- A PLC with a custom sensor board on Modbus. The machine runs on the PLC; one measurement the PLC cannot make, a fast strain reading, a multi-channel temperature scan, a special analogue front end, lives on a small board that presents itself as a Modbus RTU server. The electrician sees a PLC and a black box with a serial cable, and the black box is documented as a register map.
- An industrial PC over a PLC. The PLC runs the machine and the safety interlocks; the IPC runs the camera, the database, the recipe management or the model, and passes results to the PLC as a handful of tags. If the IPC crashes, the machine stops cleanly or carries on without it, by design.
- A microcontroller product with a small HMI. A board that does one job, with a panel-mount display or a phone app as its interface, sold as a unit. This is what a PLC is the wrong tool for: a controller that will be built five hundred times is a product, and a product built on a PLC costs five hundred PLCs.
- A PLC with a gateway to the cloud. The plant floor stays on the PLC and its network; a gateway, often a small Linux box, reads it over Modbus or OPC UA and publishes to a dashboard over MQTT. The gateway can fail without the plant noticing.
Pakistani realities
Spares and skills decide more than datasheets. The electrical markets of Lahore and Karachi stock the common PLC ranges and their modules, and a machine built on one of them can be repaired on a Sunday. Technicians who know the mainstream brands, Siemens, Delta and Mitsubishi among them, are found in every industrial estate; technicians who can debug a custom board or a Linux service are not, so a board or an IPC in a plant comes with a remote support arrangement, held spares and a way to swap the unit without a specialist.
Power and heat are harder on controllers here than the datasheets assume. Supply voltage sags and surges with load-shedding and the changeover to a generator, and a controller that loses its program or its clock on a brown-out has a bad week; a UPS on the control supply and a 24 V supply with hold-up are standard, not optional. Panel temperatures in Sindh and southern Punjab reach the top of a PLC's 55 °C rating and pass an IPC's, so the panel needs a fan filter, a cooler or a location that was thought about. Counterfeit components exist in the local supply chain, from relays and contactors to PLC modules and semiconductors, and a board built from a grey-market chip fails in ways that are hard to trace; buy through authorised channels and test incoming parts. Connectivity for remote support is usually a 4G router, and it is reliable enough to make remote diagnosis the first response and a site visit the second.
How we decide at Ahmedonics
We ask the questions above in that order, and the first three usually settle it: the I/O count, the safety functions and the timing exclude one or two of the options before cost is mentioned. Then we ask who will stand in front of the panel in five years, and design for them rather than for us. When a site has a maintenance crew and a single machine, we specify a PLC from a range they can buy and repair locally, and we write the program so the crew can read it. When the job is a device to be built in quantity, we design the board, and we plan the bootloader, the diagnostics and the spares before the first schematic. When the job is data or vision, we put an industrial PC beside a PLC and give each the part it is good at. The principle behind all three is the same: the controller is chosen for the people and the site, and the engineering goes into making it boring to own.
Three examples from practice
These are typical jobs, described generically rather than as named projects.
A packaging line. A filler, a capper, a labeller and two conveyors: about two hundred digital I/O, a dozen analogue channels, eight variable-speed drives, guard doors and emergency stops on every machine. A modular PLC with remote I/O on each machine, a safety PLC or safety relays for the guarding to ISO 13849-1, the drives on an industrial Ethernet, and a panel HMI. The site's electricians maintain it, the local market stocks the modules, and the program is ladder and function block that they can read. No board, no PC; a line supervisor's dashboard reads production counts from the PLC over Modbus TCP.
Two hundred tank monitors. A fuel distributor wants the level in every day tank at every site on one screen. Each site needs a 4–20 mA input for the level transmitter, a temperature input, a LoRaWAN or 4G radio, a solar panel and a battery, in a box on a pole. A PLC per site would cost more than the tank and would need mains. A microcontroller board, designed once, built in a batch of two hundred with ten spares, with a bootloader for updates over the radio, a watchdog, a stored log for when the radio is down, and a register map so that a PLC or a gateway can also read it locally. The engineering is paid once; the unit cost is what makes the project possible at all.
A vision inspection cell. Bottles pass a camera at four a second; each must be checked for fill level and cap presence and rejected if wrong. An industrial PC runs the camera and the inspection software and produces one result per bottle. A small PLC receives the result, tracks each bottle to the reject station with an encoder, fires the rejector, handles the guarding and stops the line if the PC stops answering. The PC carries the computing; the PLC carries the timing and the safety; either can be replaced without touching the other.
References
- IEC 61131-3:2013, Programmable controllers — Part 3: Programming languages — ladder, function block, structured text and sequential function chart
- IEC 61131-2:2017, Industrial-automation systems — Programmable controllers — Part 2: Equipment requirements and tests — environmental, EMC and I/O requirements
- IEC 62061:2021, Safety of machinery — Functional safety of safety-related control systems
- ISO 13849-1:2023, Safety of machinery — Safety-related parts of control systems — Part 1: General principles for design — performance levels PL a to e
- IEC 61499-1:2012, Function blocks — Part 1: Architecture — distributed control applications
- IEC 62541 series, OPC Unified Architecture
- Modbus Organization, MODBUS Application Protocol Specification V1.1b3, 2012