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.

MESProduction · line 1

Work orders

OrderPart nameQuantityDoneStatus
2291DEMO-2212036In progress
2292DEMO-22-B600Planned
2288DEMO-118080Closed
MESProduction

ST010 - Entry

Serial numberSubmit
Part name
DEMO-22
Work order
2291
Recipe
28 · v3

Identified

MES · Recipes

DEMO-22 · recipe 28 · v3 validated

  1. Goes in control board, cover TP-0412, 4 M4 screws, label
  2. Operations 10, at 5 stations
  3. Specifications firmware 6.13, torque 2.0 – 2.4 N·m…
  4. EOL a suite of 9 tests
MES · Rules

Rule 41 · operation

PARTNAMEpositions 6–7= 22

→ Screw the cover · program 4 · 2.2 N·m

Part names

  1. DEMO-22 meets
  2. DEMO-22-B new meets
  3. DEMO-11 no
MES · Route

DEMO-22 route · recipe 28 v3

  1. ST010 Entry identify the serial OK
  2. ST020 Flashing firmware 6.13 and 99 keys OK
  3. ST060 Assembly cover TP-0412 and 4 screws, 2.0 – 2.4 N·m T2: 1.62 → 2.23 OK
  4. ST130 EOL a suite of 9 tests OK
  5. ST140 Vision two photos: with light and in the dark OK
  6. ST170 Label print it and apply it OK

Route met

ST020 · Flashing0184 · DEMO-22

Sequence from the MES

OpDescriptionTextImageSetup
10Lower the pins31Z −120OKOut
20Write firmware42FW 6.13OKOut
30Write configuration5299 keysOKOut
40Read back and compare63equaldiffersOKOut
50Raise the pins31Z 0OKOut
ST060 · Assembly0184 · DEMO-22

Sequence from the MES

OpDescriptionTextImageSetup
10Scan the cover116TP-0412OKOut
20Screw in a cross127PRG 4 · 4×OKOut
ST060 · Assembly0184 · DEMO-22

Step 1 of 2

Scan the cover and place it.

  1. T1 2.21 OKOut
  2. T3 2.19 OKOut
  3. T2 1.622.23 OKOut
  4. T4 2.20 OKOut

text 11 · image 6

Waiting for the cover

EOL · ST1300184 · DEMO-22

DEMO-22 suite · 9 tests

  1. Earth probe contact PASS
  2. Boot and communication answers PASS
  3. Charge at 32 A 31.0 – 33.0 31.9 A PASS
  4. Earth fault: residual voltage max. 1.0 0.6 V PASS
  5. Five more tests inside PASS

9 of 9 PASS

Vision · ST1400184 · DEMO-22
With light
In the dark · LED

6 of 6 and the LED, in place OK

Label · ST170DEMO family template
DEMO-22Charger · 230 V · 32 AS/N 0184

Printed and applied OK

MES · Traceability

Serial 0184 · DEMO-22 · recipe 28 v3

  1. ST010 Entry identified OKOut
  2. ST020 Flashing firmware 6.13, 99 keys OKOut
  3. ST060 Assembly cover and 4 screws (screw 2, second try) OKOut
  4. ST130 EOL 9 of 9 OKOut
  5. ST140 Vision 6 of 6 and the LED, in two photos OKOut
  6. ST170 Label printed OKOut
With light
In the dark

Finished Route met: 20 operations, all within; T2 at the second try.

Recreation with example values: the orders, DEMO-22, serial 0184, the text and image numbers, the torques and the measurements are made up. The stations and their order are those of a charger line; here, five of them and the entry.

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

FunctionWhat it doesWho it talks to
Work ordersReceives 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 routesKeeps, for each product, what each station must do to it and within which limits. Recipes come from rules.Its database
SequencesWhen a product arrives, the station asks for its sequence and the MES sends it.The PLCs, over OPC UA
ResultsEvery measurement and every step comes back with the serial number, and the MES decides whether the product moves on.The stations, over MQTT
LabelsPrints each unit’s label, with its serial number.The printers, over HTTP
TraceabilityKeeps what was done to each unit, with which values, when, and its photos.Its database
Fig. 1 How the MES behind this site’s projects splits the work. Other MES use other protocols for the same jobs.

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.

[ See it on the line · 01 · The order ]

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.

[ See it on the line · 02 · The route ]

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.

[ See it on the line · 03 · Flashing ]

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.

[ See it on the line · 04 · Assembly ]

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.

[ See it on the line · 07 · Done ]

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.

Request an invitation

For a hiring process or a specific job, freelance included. Tell me what it is about: I read it myself and, if it fits, you get in from this same browser or receive a personal link.

The job post, the project or who sent you the link.
The role or the job, in a few lines.