What is an MES? Explained with a 3D line
[ Note · Updated 6 Dec 2026 ]An MES (manufacturing execution system) is the software that runs production inside the plant. It sits between the ERP, which decides what to make and how much, and the machines that make it, with a PLC at each station. It receives the work orders, knows each product’s recipe and tells each station what to do to it and within which limits. Then it collects every result and decides whether the product moves on. At the end, each unit leaves with its traceability: what was done to it, with which values and when. Below, a charger crosses an assembly line from end to end.
By Ignacio Oliú, developer of the MES of two charger plants.
What the MES does
[ One charger, end to end ]The MES holds the work orders (manufacturing orders, in an ERP). From each charger’s code, the MES knows its recipe, and the recipe is its routing: what each station, or work center, must do to it and within which limits. It leaves finished when it has met all of it.
Work orders
| Order | Part name | Quantity | Done | Status |
|---|---|---|---|---|
| 2291 | DEMO-22 | 120 | 36 | In progress |
| 2292 | DEMO-22-B | 60 | 0 | Planned |
| 2288 | DEMO-11 | 80 | 80 | Closed |
ST010 - Entry
- Part name
- DEMO-22
- Work order
- 2291
- Recipe
- 28 · v3
Identified
DEMO-22 · recipe 28 · v3 validated
- Goes in control board, cover TP-0412, 4 M4 screws, label
- Operations 10, at 5 stations
- Specifications firmware 6.13, torque 2.0 – 2.4 N·m…
- EOL a suite of 9 tests
Rule 41 · operation
PARTNAMEpositions 6–7= 22
→ Screw the cover · program 4 · 2.2 N·m
Part names
- DEMO-22 meets
- DEMO-22-B new meets
- DEMO-11 no
DEMO-22 route · recipe 28 v3
- ST010 Entry identify the serial OK
- ST020 Flashing firmware 6.13 and 99 keys OK
- ST060 Assembly cover TP-0412 and 4 screws, 2.0 – 2.4 N·m T2: 1.62 → 2.23 OK
- ST130 EOL a suite of 9 tests OK
- ST140 Vision two photos: with light and in the dark OK
- ST170 Label print it and apply it OK
Route met
Sequence from the MES
| Op | Description | Text | Image | Setup | |
|---|---|---|---|---|---|
| 10 | Lower the pins | 3 | 1 | Z −120 | OKOut |
| 20 | Write firmware | 4 | 2 | FW 6.13 | OKOut |
| 30 | Write configuration | 5 | 2 | 99 keys | OKOut |
| 40 | Read back and compare | 6 | 3 | equaldiffers | OKOut |
| 50 | Raise the pins | 3 | 1 | Z 0 | OKOut |
Sequence from the MES
| Op | Description | Text | Image | Setup | |
|---|---|---|---|---|---|
| 10 | Scan the cover | 11 | 6 | TP-0412 | OKOut |
| 20 | Screw in a cross | 12 | 7 | PRG 4 · 4× | OKOut |
Step 1 of 2Step 2 of 2Step 2 of 2
Scan the cover and place it.Screw in a cross: 1, 3, 2, 4.Screw 2 out of torque. Redo it.
- T1 2.21 OKOut
- T3 2.19 OKOut
- T2 1.622.23 OKOut
- T4 2.20 OKOut
Waiting for the coverCover TP-0412: the one in its recipeTorque: 2.0 – 2.4 N·m
DEMO-22 suite · 9 tests
- Earth probe contact PASS
- Boot and communication answers PASS
- Charge at 32 A 31.0 – 33.0 31.9 A PASS
- Earth fault: residual voltage max. 1.0 0.6 V PASS
- Five more tests inside PASS
9 of 9 PASS
6 of 6 and the LED, in place OK
Printed and applied OK
Serial 0184 · DEMO-22 · recipe 28 v3
- ST010 Entry identified OKOut
- ST020 Flashing firmware 6.13, 99 keys OKOut
- ST060 Assembly cover and 4 screws (screw 2, second try) OKOut
- ST130 EOL 9 of 9 OKOut
- ST140 Vision 6 of 6 and the LED, in two photos OKOut
- ST170 Label printed OKOut
Finished Route met: 20 operations, all within; T2 at the second try.
The line is hand-written WebGL 2, with no 3D library or framework: how I built this portfolio.
What an MES does, function by function
| Function | What it does | Who it talks to |
|---|---|---|
| Work orders | Receives from the ERP what to make, how much and on which line, and reports back what was made. | The ERP, through its API |
| Recipes and routes | Keeps, for each product, what each station must do to it and within which limits. Recipes come from rules. | Its database |
| Sequences | When a product arrives, the station asks for its sequence and the MES sends it. | The PLCs, over OPC UA |
| Results | Every measurement and every step comes back with the serial number, and the MES decides whether the product moves on. | The stations, over MQTT |
| Labels | Prints each unit’s label, with its serial number. | The printers, over HTTP |
| Traceability | Keeps what was done to each unit, with which values, when, and its photos. | Its database |
How is an MES different from an ERP?
The ERP plans: what is sold, what is bought, what to make and when. The MES executes: how each unit is made, at which station and with which values. The ERP thinks in orders and quantities; the MES, in serial numbers and seconds.
That is why they live together. The ERP hands the MES its manufacturing orders, and the MES reports back what was made, with its traceability. In the ISA-95 standard, the ERP is level 4 and the MES level 3; below them are the PLCs and the machines. The projects on this site belong to an MES like that.
What is a recipe, and why is it a route?
The recipe says how a product is made. On an assembly line it is a route of operations: station by station, what to do to it and within which limits, such as a screw torque, a voltage or a firmware version.
Recipes are not written one by one: they come from rules per product family, so a new product already has its own. Changing a rule changes every recipe that depends on it, which is why it pays to preview the change before applying it. How that is configured in one of the projects: production configuration, from SQL to an LLM agent with MCP.
How does an MES talk to the PLCs?
Over OPC UA, the industry standard for reading and writing to a PLC regardless of its maker. A Siemens S7 PLC exposes its variables as nodes, and the MES reads or writes them. When a product arrives, the station reads its serial number and asks for its sequence; the MES looks it up in the recipe and sends it.
On the line behind the projects, results come back over MQTT, with request and response: the station waits for the reply before moving on, so that wait is cycle time. Both, in the live production line over OPC UA and MQTT replies between stations and the MES.
What does the MES check at each station?
That the route is followed, and nothing goes outside its limits. In assembly, the operator’s screen says what to do and how; the station measures every screw torque and, if one is out, does not let the unit move on until it is redone.
At the end of the line, the EOL (end-of-line) test measures the whole product against its tolerances. Every value goes back to the MES with the serial number, and those same values, read over time, warn when it is the tester that starts to fail, not the product: predictive maintenance for EOL testing.
What is traceability by serial number?
Being able to answer, for each unit, what was done to it, at which station, with which values and when. The MES builds it on its own, step by step: each result comes in with the serial number, so do the vision photos, and the label carries the serial printed on it.
If a customer returns a product, or a batch of parts turns out faulty, you know which units it affects. The label ties each unit to its history: the MES label system.
What happens if the MES goes down?
The line depends on it. Without the MES, stations get no sequence and cannot save their results, so the line goes to manual or stops.
That is why an MES has to know at all times what works and what does not, from the PLCs to the database, and come back on its own after an outage: plant health and restart after a power cut.