Chapter 1 · Purpose, scope and standards
What an MES does and where it sits
A manufacturing execution system (MES) is the layer that makes a plan happen on the floor and writes down what really happened. This chapter says what it does, where it sits between the ERP and the machines, which standards give it a shape, and what this module leaves to others.
20 minISA-95 Level 311 MESA functions12 capabilities
By the end of this chapter you can
- Say in one sentence what an MES executes, enforces and records.
- Place the MES among the ISA-95 levels and name the standards the module follows.
- Sort the eleven MESA functions into those this module builds and those other modules own.
Execute, enforce, record
An MES defines how products are made, dispatches orders to work centres, guides operators step by step, checks materials and qualifications, collects data from machines and people, builds the genealogy of every lot, captures downtime and OEE, and reports performance back to the ERP. Three verbs cover it: execute the work, enforce the rules while it is done, and record what happened in a form nobody can quietly change.
Tools in this class include Rockwell Plex and FactoryTalk ProductionCentre, Siemens Opcenter Execution, Critical Manufacturing, AVEVA MES, Dassault DELMIA Apriso, Parsec TrakSYS, Tulip and Sepasoft on Ignition. This module is the capstone of the library: the platform's direction is that the MES hub emerges from the other modules (scheduling, maintenance, documents, training, quality), and this module ties them together on the one shared spine.
Where it sits: ISA-95
ISA-95, published internationally as IEC 62264, divides a manufacturer into levels [1][2]. The business systems (ERP) are at Level 4, and the machines and their controls are below. Manufacturing operations management, the MES, sits at Level 3, between the two. That position explains what an MES does: it receives a schedule from above, turns it into work on the floor, and sends what was done back up.
The standard has five parts. Parts 1 and 2 give the object models and terminology; Part 3 gives the Level 3 activity model, which is four categories of operation (production, maintenance, quality and inventory) crossed with eight activities; Part 4 describes the information that flows between those activities; and Part 5 defines the business-to-manufacturing (B2M) transactions between the ERP and the MES [3]. The module uses Parts 1 and 2 to name its equipment and material, and Part 5 for the ERP exchange in chapter 4.
| Standard | What the module takes from it |
|---|---|
| ISA-95 / IEC 62264 Parts 1 to 5 | Object models (Parts 1 and 2), the Level 3 activity model (Part 3), information flows (Part 4), B2M transactions (Part 5) |
| MESA-11 functional model | A checklist of eleven MES functions, used to inventory a plant today |
| B2MML (MESA) | XML and JSON schemas that carry ISA-95 messages to the ERP |
| ISA-88 / IEC 61512 | Batch control: the physical and procedural models (procedure, unit procedure, operation, phase) and recipe types |
| ISO 22400-2 | Definitions of the manufacturing KPIs: OEE, availability, effectiveness, quality ratio, throughput |
| ISA-TR88.00.02 (PackML) | A machine state model and tags for packaging lines |
| OPC UA (IEC 62541) and Eclipse Sparkplug B | How machine values reach the tag registry |
| 21 CFR 211.188 and 211.192; 21 CFR 820 | Batch production records, and device history records under the QMSR (aligned to ISO 13485), where regulated |
The eleven functions
The MESA model lists eleven functions an MES covers: resource allocation, scheduling, dispatching, document control, data collection, labour, quality, process management, maintenance, genealogy and performance analysis [1]. It is a checklist, not a design: use it to find out which of the eleven your plant does today, with what, and who does them.
What is in and out of scope
Twelve capabilities, in three tiers
The specification groups the module's capabilities by tier. MVP is what every plant needs first; STD is what a standard MES also does; BIC is best in class.
| Capability | Tier | What it does |
|---|---|---|
| Product and process definition | MVP | Routings and master recipes with revisions and effectivity; operations with work centre, standard times, crew, instructions, required skills, parameters with limits and a bill of materials for each operation |
| Dispatching | MVP | Release orders; dispatch lists per work centre from the schedule or by priority; operator job selection |
| Execution management | MVP | Start, pause and complete operations; guided steps; interlocks for qualification, calibration, material scan and previous step |
| Material tracking and genealogy | MVP | Consume by scan or backflush, produce lots and serials, trace forward and backward in seconds |
| Downtime and OEE | MVP | A state model aligned to PackML, reason-coded downtime and micro-stoppages, OEE per ISO 22400 |
| Data collection | STD | Counts and states from tags; manual fallback; parameters evaluated against limits |
| Labour tracking | STD | Clock on and off operations; setup, run and indirect time; crew size |
| In-process quality | STD | Inspection triggers, automatic lot holds, quality gates at operation completion |
| Performance analysis | STD | Yield, scrap, cycle time, schedule adherence and ISO 22400 KPIs by line, shift and product |
| ERP integration | STD | Production schedule in; performance and material movements out as B2MML messages through an outbox |
| Electronic batch and device history record | BIC | Step records with performer and verifier signatures, deviations linked to M08, review by exception |
| Process-industry batch (ISA-88) | BIC | Procedural recipes, phase execution, recipe parameter downloads with read-back |
You need: Your Session 1 notes (docs/mes-inventory.md if you have started it), one routing from your plant, and a pen
Use one real line. Work on paper first; leave operator and customer names out of anything you save.
Outcome: A one-page placement of your plant on ISA-95 and MESA-11, with the three painful functions named and the control boundary written down.
Knowledge check
At which ISA-95 level does an MES sit?
Knowledge check
Which of these is outside the MES module's scope?
References
- SYMESTIC: the 11 core MES functions (MESA-11) and the ISA-95 Part 3 matrix. https://www.symestic.com/en-us/what-is/mesa-11
- Siemens: ISA-95 framework and layers. https://www.siemens.com/en-us/technology/isa-95-framework-layers/
- Automation World: the five parts of ISA-95. https://www.automationworld.com/products/software/article/13309288/the-five-parts-of-isa-95
- ISA: ISA-95 series of standards (enterprise-control system integration). https://www.isa.org/standards-and-publications/isa-standards/isa-95-standard
Chapter 2 · The data model
Definitions, orders and records: the fifteen tables
How production is stored decides what you can ever ask of it. Five tables say how a product is made, two say who is making it and where, and eight keep what happened. Everything points at the shared spine, so the MES never grows a second equipment list.
25 min15 tables3 groups2 pitfalls
By the end of this chapter you can
- Name the fifteen mes_ tables and sort them into definitions, order and run, and records.
- Explain how a product definition is approved, becomes effective and is superseded without being edited.
- Say why equipment, items and people are keys to the spine and why measured values are typed columns.
Three groups of tables
Every table starts with the standard columns every platform table has: id, tenant_id, created_at, created_by, updated_at, updated_by, row_version, archived_at and ext. The module has no item master, machine list, lot table or people table of its own. Its keys go to core_item, core_equipment, core_lot, core_person and core_shift_instance, and to core_e_signature, core_uom, core_data_tag, core_reason_code, core_attachment, core_site and core_serial_unit. Its own tables share the prefix mes_.
The tables below give every column the module adds to the standard ones. Types are as in the specification: text, int, num (a decimal number), qty (a quantity, kept with its unit in a uom_id column), bool, ts (a timestamp with time zone), uuid and json (jsonb in Postgres). An arrow means a foreign key to that table, req means required (not null), and a list after a colon is the allowed values. This is what your agent builds from in Session 2.
Definitions: how a product is made
| Table | Holds | Columns |
|---|---|---|
| mes_product_definition | A routing or master recipe header, with revision and effectivity | code text req, unique; item_id → core_item req; revision text req; process_type text req: discrete, batch, continuous or mixed; status text req: draft, approved, effective, superseded or obsolete; effective_from ts; effective_to ts; approved_signature_id → core_e_signature |
| mes_operation_definition | An operation (or ISA-88 unit procedure, operation or phase) within a definition | product_definition_id → mes_product_definition req; seq int req; code text req; name text req; work_center_id → core_equipment req; isa88_level text: none, unit_procedure, operation or phase; std_setup_min num; std_cycle_sec num; std_crew num; instruction_doc_ref uuid, a soft link to M06's doc_controlled_document; required_skill_ref uuid, a soft link to M07's trn_skill; quality_gate bool |
| mes_operation_step | A guided step: instruction, check, data entry, scan, signature | operation_definition_id → mes_operation_definition req; step_no int req; step_type text req: instruction, check, data_entry, material_scan, signature, timer or equipment_check; text text req; media_attachment_id → core_attachment; requires_verification bool; parameter_key text |
| mes_operation_parameter | A process parameter with limits, captured automatically or by hand | operation_definition_id → mes_operation_definition req; key text req; name text req; data_tag_id → core_data_tag; uom_id → core_uom; target num; lsl num; usl num; capture text req: auto, manual or both; critical bool |
| mes_operation_material | The bill of materials for one operation: inputs, outputs and by-products | operation_definition_id → mes_operation_definition req; item_id → core_item req; qty_per qty req; uom_id → core_uom req; direction text req: input, output or byproduct; consumption text req: scan, backflush or manual; scrap_factor num |
Order and run: who makes what, where
| Table | Holds | Columns |
|---|---|---|
| mes_production_order | An order to produce, from the ERP, MRP, a scheduler or by hand | order_no text req, unique; item_id → core_item req; product_definition_id → mes_product_definition req; site_id → core_site req; qty_planned qty req; uom_id → core_uom req; due_at ts; priority int; status text req: planned, released, in_progress, on_hold, completed, closed or cancelled; source text req: erp, mrp, aps or manual; external_ref text; output_lot_id → core_lot |
| mes_operation_run | One operation of one order on one piece of equipment | production_order_id → mes_production_order req; operation_definition_id → mes_operation_definition req; equipment_id → core_equipment; status text req: pending, ready, running, paused, complete or skipped; started_at ts; ended_at ts; qty_good qty; qty_scrap qty; qty_rework qty; lead_operator_id → core_person; shift_instance_id → core_shift_instance |
| mes_shift_performance | ISO 22400 performance for one piece of equipment and one shift, calculated | equipment_id → core_equipment req; shift_instance_id → core_shift_instance req; planned_busy_min num; actual_run_min num; ideal_cycle_sec num; total_count qty; good_count qty; availability num; performance num; quality num; oee num |
Records: what happened
| Table | Holds | Columns |
|---|---|---|
| mes_step_record | The electronic batch or device history record of a step, with performer and verifier | operation_run_id → mes_operation_run req; operation_step_id → mes_operation_step req; entry json; performed_by → core_person req; performed_at ts req; verified_by → core_person; verified_at ts; performer_signature_id → core_e_signature; verifier_signature_id → core_e_signature; deviation_ref uuid, a soft link to M08's qms_quality_event |
| mes_parameter_value | A captured value with its specification evaluation | operation_run_id → mes_operation_run req; operation_parameter_id → mes_operation_parameter req; value_num num; value_text text; captured_at ts req; captured_by → core_person; source text req: tag or manual; in_spec bool |
| mes_material_consumption | Material consumed from a lot into a run | operation_run_id → mes_operation_run req; item_id → core_item req; lot_id → core_lot; serial_unit_id → core_serial_unit; qty qty req; uom_id → core_uom req; consumed_at ts req; consumed_by → core_person; verified_by_scan bool |
| mes_material_production | A lot or serial produced by a run | operation_run_id → mes_operation_run req; item_id → core_item req; lot_id → core_lot; serial_unit_id → core_serial_unit; qty qty req; uom_id → core_uom req; produced_at ts req |
| mes_labor_record | Labour time against a run | person_id → core_person req; operation_run_id → mes_operation_run; activity text req: direct, setup, indirect, training or break; started_at ts req; ended_at ts |
| mes_equipment_state_event | A state interval for one piece of equipment, with a reason | equipment_id → core_equipment req; state text req: running, idle, starved, blocked, planned_down, unplanned_down, changeover, micro_stop or offline; started_at ts req; ended_at ts; reason_code_id → core_reason_code; source text req: tag, manual or inferred; operation_run_id → mes_operation_run |
| mes_production_count | A count increment, good and reject, by equipment and time | equipment_id → core_equipment req; operation_run_id → mes_operation_run; ts ts req; good qty req; reject qty; source text req: tag or manual |
Two links are soft on purpose. instruction_doc_ref, required_skill_ref and deviation_ref are plain uuid columns with no foreign key, because the modules that own those tables (M06, M07 and M08) may not be installed yet; the module library's cross-module file adds the keys once both sides exist.
Definitions are versioned, never edited
A routing is a promise about how a product is made, so a change to it is a new revision, not an edit. A definition is a draft while it is being written, becomes approved only with an approval signature, becomes effective on a date (and the earlier effective revision of the same item becomes superseded on that date), and is never changed after that. An order records the definition it was made against, so a year later you can say exactly how a lot was made.
ISA-88 names four recipe types: general, site, master and control. For a batch process a mes_product_definition is the master recipe, and the control recipe is what one batch actually runs, which here is the order with its runs pinned to the effective revision. The isa88_level column marks an operation as a unit procedure, an operation or a phase; it is none for a discrete routing such as the seed's bracket.
Regulated plants need this rule. For batch production, the US rules ask that a master record exists and that each batch record shows each step completed and checked [1]; for devices the QMSR asks for a device history record [2]. Where records are electronic, the electronic-signature rules apply [3]. Even where nothing is regulated, the habit is worth having: a revision you can point to ends arguments about what the instruction said on the day.
Rules this course adds
The specification names the tables and columns. This course adds rules inside the database so impossible rows cannot get in; ask your agent to add each, with a test.
- One core_item has at most one mes_product_definition with status effective at a time (a partial unique index: a uniqueness rule that applies only to rows meeting a condition).
- One piece of equipment has at most one mes_equipment_state_event with no ended_at, so it cannot be in two states at once.
- One mes_operation_run for each order and operation; one operation for each definition and seq; one step for each operation and step_no; one mes_shift_performance for each equipment and shift.
- lsl is not above usl; ended_at is not before started_at; a run's qty_good, qty_scrap and qty_rework are not negative.
- Counts and consumptions may be negative, because that is how they are corrected: a row with the opposite sign that names the row it corrects in ext and carries a core_comment with the reason. The supervisor enters a count correction with source manual; the operator reverses a wrong scan while the run is still running; after a run is complete a wrong consumption becomes a deviation instead.
You need: The routing from your Session 1 inventory, the column tables in this chapter, and your AI coding agent
Use the product you chose in Session 1. Do steps 1 to 5 on paper or in a text file; the agent comes in at step 6.
Outcome: A routing written as rows of the five definition tables, every work centre an existing spine equipment code, and every measured value a typed parameter with limits.
Knowledge check
Why does an order record the product definition it was made against?
Knowledge check
A machine appears in the MES with its own code and in core_equipment with another. What has gone wrong?
References
- eCFR: Title 21, Part 211, current good manufacturing practice for finished pharmaceuticals (subpart J holds the batch production records, sections 211.188 and 211.192). https://www.ecfr.gov/current/title-21/chapter-I/subchapter-C/part-211
- eCFR: Title 21, Part 820, Quality System Regulation and QMSR. https://www.ecfr.gov/current/title-21/chapter-I/subchapter-H/part-820
- eCFR: Title 21, Part 11, Electronic records; electronic signatures. https://www.ecfr.gov/current/title-21/chapter-I/subchapter-A/part-11
- ISA: ISA-95 series of standards (object models for equipment and material). https://www.isa.org/standards-and-publications/isa-standards/isa-95-standard
Chapter 3 · On the floor
Run the work: interlocks, records and genealogy
An order is released, an operator starts a run, and from then on the database, not a memory or a poster, decides what is allowed. This chapter follows one run from the dispatch list to a signed record and a lot that can be traced.
30 min9 interlocks3 status laddersTrace in under 1 second
By the end of this chapter you can
- Follow an order from release to completion and say which status changes at each point.
- Name the interlocks that stop an unqualified operator, an overdue gauge, a held lot and a step done out of order.
- Explain signed step records, review by exception and how genealogy is built from consumption and production.
Release and dispatch
An order starts planned. The planner releases it, which is allowed only if its product definition is effective and signed, and releasing creates one run for each operation: the first is ready and the rest are pending. Releasing also writes an event, mes.production_order.released, to the outbox. The dispatch list for a work centre then shows one card for each ready run in the operator's area, ordered by priority and then due date, with a Start button only when the run is ready.
| Record | Statuses, in order | Who or what moves it |
|---|---|---|
| mes_production_order | planned, released, in_progress, completed, closed (also on_hold and cancelled) | Planner releases; the first start makes it in_progress; completion of the last run makes it completed; review closes it |
| mes_operation_run | pending, ready, running, paused, complete (also skipped) | Release sets the first run ready; completing a run makes the next one ready; the operator starts, pauses and completes |
| mes_product_definition | draft, approved, effective, superseded (also obsolete) | Process engineer drafts; quality approves with a signature; effective date moves the earlier revision to superseded |
The interlocks
An interlock is a rule that must be satisfied before an action is allowed. The module puts them in the database as triggers (rules that run on each insert or update), so no screen, route or script can skip one. If the database refuses an action, the route returns the rule's message to the operator. History is the one exception, and it is keyed to who inserts it, not to what a row says: a row marked ext imported_from skips the insert checks only when the importer account or the migration role that loads the seed inserts it, so the same marker on a row from an operator's route is ignored.
| Interlock | The rule | A seeded case that proves it |
|---|---|---|
| Previous operation | The run for the previous operation of the same order must be complete | OP20 cannot start while OP10 of the same order is not complete |
| Qualification | The lead operator holds a trn_qualification for the operation's required skill with status qualified, and either no expires_at or one later than the start | OPR-3 is refused on OP10 because the qualification expired on 31 January 2026; OPR-2 is refused on OP20 because SK-FORM is only in_training; OPR-1 may start both |
| Calibration | The latest cmms_calibration_record for the run's equipment is not due before the start date and not fail or out_of_tolerance; no record means no requirement | Starting with a date in 2031 is refused; with a date in 2026 it is allowed |
| Lot status | A consumed lot must be released, not on hold or in quarantine | RAW-L3 is on_hold: scanning it is refused and leaves no row |
| Bill of materials | The consumed item must be an input of that operation | WIP-BLANK cannot be consumed in OP10; it is an output there |
| Scan and quantity | A scan-mode input needs verified_by_scan true, and a lot cannot be consumed past its qty_initial | RAW-L1 has 860 KG left (1000 less 80 and 60): consuming 900 more is refused |
| Step order | A step record needs the previous step_no already recorded, and the run must be running | A record for step 3 before step 2 is refused |
| Completion | Every scan-mode input has a consumption, every critical parameter has a value, every out-of-spec critical value has a step record with a deviation, every signature step is signed (its step record's performer_signature_id is set) | Completion without the signature is refused |
| Verification | The verifier cannot be the person who performed the step | A test that sets a step's verifier to its performer is refused (an operator cannot verify at all: the role has no update right on step records) |
Two notes on how the database applies them. A role can only update rows it can read, so the operator's rights must include reading the qualification and calibration tables the interlocks consult; if they do not, every start is refused or, worse, the check finds nothing. Running as the operator, the checks also see only the operator's area, which is one reason the first scope is a single area. And a refusal leaves no trace behind: a rejected scan creates no consumption row, which is why the dispatch list and the lot balances stay true.
Parameters and steps
The operator sees one step at a time, with large targets: an instruction, a scan box, a number box with its limits and a colour for in or out of specification, a signature button and a pause button. A measured value is stored in mes_parameter_value with in_spec set by the database from the limits, inclusive of both: with limits of 119.5 and 120.5, a value of 120.5 is in specification and 120.51 is not. An out-of-spec critical value publishes mes.parameter.out_of_spec, and the run cannot complete until a deviation is recorded against it.
Material in, lots out: genealogy
Scanning a lot into a run writes a row to mes_material_consumption. Completing a run writes the lot it made to mes_material_production, and a row to the spine's core_lot_genealogy with relation consumed_into: it says the parent lot went into the child lot. Follow those links forward and you find every lot that used a material; follow them backward and you find everything that went into a lot. A lot made by a run is numbered order number, a dash and the operation code (PO-1001-OP10), so it is readable and unique, and its status is released, because this course builds no inspection hold.
A trace is a recursive query: it follows the links level by level until none are left, returns each lot with its depth and the run that linked it, and refuses to loop. The module's target is a full forward and backward trace across three levels in under one second on seeded data, and you time it in Session 4 with EXPLAIN ANALYZE (the command that runs a query and reports how long it took).
Signed step records and review by exception
The step records of a run are the module's electronic batch record or device history record. Each has a performer and, where the step requires it, a verifier, each with their own electronic signature (core_e_signature) that names the meaning (performed, verified or reviewed) and a hash that changes if one character of the signed content changes. US rules ask that electronic signatures be unique to a person and linked to their record [1], and that batch records show each significant step [2].
Reading every record of every run does not scale. Review by exception means a person reads only the runs that need it: one with an out-of-spec value or a deviation. A clean run is approved in one action. The specification also names overrides; this course builds no way to override an interlock or skip a step, so there are none to flag, and if you ever add one it must be flagged in the record like the others. The rule that makes this honest is that every exception is flagged in the record, so none can hide in a run that looks clean.
You need: Your Session 1 inventory, the interlock table in this chapter, and a text editor open on docs/mes-rules.md in your repository
Session 4 builds the triggers from this page, so write it as rules a developer could not misread. Keep to one page.
Outcome: A docs/mes-rules.md with each interlock, its message, its status moves, its lot numbering, its seeded test, and the sign-off of two people from the floor.
Knowledge check
OPR-2 holds the SK-FORM skill only as in_training and tries to start OP20, which requires it. What happens?
Knowledge check
A scan-mode input is recorded with verified_by_scan false. What should happen?
References
- eCFR: Title 21, Part 11, Electronic records; electronic signatures. https://www.ecfr.gov/current/title-21/chapter-I/subchapter-A/part-11
- eCFR: Title 21, Part 211, current good manufacturing practice for finished pharmaceuticals (batch production records are in subpart J). https://www.ecfr.gov/current/title-21/chapter-I/subchapter-C/part-211
- Siemens: ISA-95 framework and layers. https://www.siemens.com/en-us/technology/isa-95-framework-layers/
- SYMESTIC: the 11 core MES functions (MESA-11), including dispatching, labour and genealogy. https://www.symestic.com/en-us/what-is/mesa-11
Chapter 4 · States, OEE and the ERP
Measure it, connect it, cut over
Machines report counts and states, people give reasons, and the module turns both into one figure per shift. This chapter fixes the time base that makes the figure honest, sends the result to the ERP, and ends with the tests that say the old tool can go.
25 min9 machine statesOEE 0.7500 on the seed3 done-when tests
By the end of this chapter you can
- Map machine states to the module's nine states and say when a short stop is a micro-stop.
- Calculate availability, performance, quality and OEE from one time base, by hand, to two decimals.
- Describe how messages reach the ERP through the outbox, and what must be migrated at cut-over.
Machines report; the module records
Counts, states and process values reach the module through the spine's tag registry (core_data_tag). OPC UA (IEC 62541) is the standard way for a machine or gateway to publish values [1]; MQTT with Sparkplug B is a light publish and subscribe scheme with an agreed layout for industrial data [2]. A tag collector machine account posts them: counts go to mes_production_count, state changes to mes_equipment_state_event and parameter values to mes_parameter_value with source tag. Where no tag exists, the supervisor enters the shift's states on the downtime screen and its counts in a counts box (an operator may enter counts for their own run), with source manual, and the performance job calculates from those rows exactly as it does from tag rows.
The feed is safe to repeat. Every message carries an id made by the sender, which the route keeps in the row's ext as message_id; a message whose id is already stored is skipped, and a simulator that posts a fixed feed twice leaves the same rows. A tap sent twice from a phone with a poor signal behaves the same way, so counts and downtime are never doubled.
States, reasons and micro-stops
The module has nine equipment states: running, idle, starved, blocked, planned_down, unplanned_down, changeover, micro_stop and offline. A packaging line's machine publishes the PackML state model (ISA-TR88.00.02), and the module maps it as follows.
| Machine reports (PackML) | The module stores | Needs a reason? |
|---|---|---|
| Execute | running | No |
| Idle, Complete | idle | No |
| Held, Stopped, Aborted | unplanned_down | Yes, unless shorter than the micro-stop threshold |
| Suspended | starved (blocked, where the machine says its output is full) | Yes, unless shorter than the micro-stop threshold |
| Starting, Stopping, Resetting, Holding, Completing and the other transitional states (names ending in -ing) | the state stored before them, unchanged | No new reason |
| Anything else that cannot be mapped | offline | No |
In PackML, Held is a stop for a condition inside the machine, and Suspended is a wait for something outside it, such as no input or a full output. Machines differ, so read the state list of your own machine and write its mapping on the rules page; the table is a starting point.
A blocked, starved or unplanned_down stop shorter than 2 minutes is stored as micro_stop and needs no reason. Two minutes is this course's own threshold, written in docs/mes-rules.md where you may change it. Micro-stops matter because they are too short for anyone to log and too frequent to ignore, so they are where lost time can hide unnoticed. A longer stop appears on the downtime screen until someone gives it a reason from core_reason_code, which marks each reason planned or not.
OEE on one time base
OEE (overall equipment effectiveness) is availability times performance times quality. ISO 22400-2 defines the manufacturing KPIs, and names the same three factors as availability, effectiveness and quality ratio [3]. The danger is not the formula; it is mixing time bases, so that availability is measured against the shift, performance against the run, and nobody can reproduce the figure. The module fixes one base, written on the rules page, for every figure.
| Figure | Definition used in this course |
|---|---|
| Planned busy time | The shift's minutes less its planned_down minutes |
| Run time | The minutes in state running |
| Availability | Run time ÷ planned busy time |
| Performance | Ideal cycle (std_cycle_sec of the operation at that work centre, from the definition effective when the shift started) × total count ÷ run time in seconds |
| Quality | Good count ÷ total count |
| OEE | Availability × performance × quality, calculated from unrounded values |
The numbers a plant manager asks for
| KPI | Definition |
|---|---|
| OEE (ISO 22400) | Availability × performance (effectiveness) × quality ratio |
| First-pass yield | Good units without rework ÷ units started |
| Scrap rate | Scrap quantity ÷ total produced |
| Cycle time vs standard | Actual run time per unit ÷ ideal cycle time |
| Schedule attainment | Quantity produced to plan ÷ planned quantity |
| Trace time | Seconds to complete a full forward and backward trace of a lot |
Talking to the ERP
The ERP owns orders and plans. The schedule comes in as production orders (source erp, with the ERP's number in external_ref). Performance and material movements go out as B2MML-style messages: B2MML is the MESA set of schemas that carries ISA-95 messages, and a run or lot message is named ProductionPerformance [4]. A message is never sent from the middle of an operation. The completion writes an event to core_event_outbox in the same database transaction as the record it describes, so either both exist or neither does.
Cut over and retire the old tool
MES history is rarely migrated whole. Migrate the open orders, the product definitions and the last 12 to 24 months of genealogy for the traceability obligations you have; leave the rest in an export you can still open. Rows brought in this way carry ext holding imported_from. When the importer account (or the migration role that loads the seed) inserts them, they skip the signature rule, the draft-only rule and the insert checks on history, so a definition can arrive already effective with its operations; the same marker on a row from any other role is ignored, so it can never open an interlock. An import sends nothing to the ERP. Imported history (completed runs, consumptions, productions and genealogy) can never be changed afterwards; imported open orders and definitions follow the normal rules. Before cut-over check that every operation points to a real work centre and every lot link resolves.
Run the old and the new side by side for at least a week, then check three things before you cancel. A lot traces forward and backward across three levels in under one second on seeded data. An unqualified operator is blocked from starting an operation that requires a skill. OEE for a seeded shift matches a hand calculation to two decimals.
You need: Paper or a spreadsheet, and the numbers below (they are the Session 2 seed for CELL-B on Monday 2 March 2026)
The shift runs 06:00 to 14:00. State intervals: changeover 06:00 to 06:30; running 06:30 to 09:30; unplanned_down 09:30 to 09:45; running 09:45 to 11:45; planned_down 11:45 to 12:15; running 12:15 to 13:45; starved 13:45 to 14:00. Counts: good 225 with reject 9, good 150 with reject 6, good 75 with reject 3. The ideal cycle for the operation at this press is 45 seconds. Lot links (consumed_into): RAW-L1 into PO-0900-OP10 (80 KG); PO-0900-OP10 into PO-0900-OP20 (40 EA); RAW-L1 into PO-0901-OP10 (60 KG); PO-0901-OP10 into PO-0901-OP20 (30 EA).
Outcome: Written sums for planned busy time, run time, availability, performance, quality and OEE, and two traces, each lot with its depth. If your time base is the one on the rules page you will reach an OEE of 0.7500, four lots forward from RAW-L1 (two at depth 1, two at depth 2) and, backward from PO-0901-OP20, PO-0901-OP10 at depth 1 and RAW-L1 at depth 2.
Knowledge check
In the course's time base, availability is:
Knowledge check
Why must OEE be calculated from unrounded factors?
References
- OPC Foundation: OPC UA. https://opcfoundation.org/about/opc-technologies/opc-ua/
- Eclipse Sparkplug specification. https://sparkplug.eclipse.org/
- ISO 22400-2:2014, Key performance indicators for manufacturing operations management: definitions and descriptions. https://www.iso.org/standard/54497.html
- Automation World: the five parts of ISA-95 (Part 5, business-to-manufacturing transactions). https://www.automationworld.com/products/software/article/13309288/the-five-parts-of-isa-95
Chapter 5 · 12 questions · 80% passes
Final assessment
Twelve questions across the element. Score 80% (10 of 12) to pass. Your LMS records your score and each answer; you can review the chapters and try again.
15 min12 questions≈ 15 minutesRetake allowed
Your result
CivOps AI Academy
Manufacturing Execution (MES): Routings, Interlocks, Genealogy and OEE on Your Own Spine
Element M04 complete · Learner
Your LMS records this completion. For the CivOps Foundation certificate, finish the Foundation Course at https://civops.io/learn.