A textile factory in the Vale do Ave installs a new MES. Six months later, OEE rises on the screen. The operating margin doesn't budge. The COO is pleased with the charts; the CFO still can't work out where the money is going. The problem isn't the MES — it's that the MES never spoke to the ERP. And that separation has a price that doesn't show up in either system.

This article argues a position that most MES vendors avoid saying out loud: an MES installed without integration with the ERP is, at best, an incomplete investment. At worst, it creates an illusion of control that delays correct decisions for years. What follows are the real costs of that separation and the concrete trade-offs of each integration architecture available today for Portuguese industry.

The illusion of isolated OEE

According to Siemens data (2024), unplanned production downtime costs the world's 500 largest companies around 1.4 trillion dollars per year — the equivalent of 11% of their turnover. But that figure assumes the company can even measure the cost of each stoppage in financial terms. Without integration between the MES and the ERP, that connection never happens.

The MES records that line 3 stopped for 47 minutes on Tuesday. The ERP records that production order 8821 was left incomplete. Nobody puts the two pieces together. The real cost — wasted labour hours, tied-up raw material, customer delivery penalties — stays scattered across three Excel files that nobody reconciles before the monthly close.

An MES without an ERP is a speedometer without an instrument panel. You know how fast you're going. You don't know whether there's fuel, whether the engine is overheating, or whether you've reached the right destination.

What the COO sees — and what they don't

The COO sees consolidated OEE by shift, the rejection rate by line, the average cycle time. These are real data. The problem is what's missing: the real unit cost per production order, which requires allocation of labour, energy and overhead coming from the ERP; the impact of a production delay on the dispatch date committed to the customer; the real consumption of components against what was planned and the resulting stock deviation; the relationship between line efficiency and the margin of the item being produced. These four points require data from the ERP. Without integration, the COO makes capacity decisions with half the information — and the other half is in the ERP, where nobody cross-references it.

The standard mistake that keeps recurring in Portugal

There is a specific pattern that keeps recurring in medium-sized Portuguese factories: the MES is bought as an operational improvement project, with the production department's budget, without involvement from the IT director or the CFO. Integration with the ERP is left "for phase 2". Phase 2 never gets its budget approved because the benefits of phase 1 — measured only in OEE — seem enough to justify the investment already made.

What happens next is predictable: two systems grow in parallel, each with its own master data for items, cost centres and production orders. After 18 months, the divergence is so great that integration ends up costing more than it would have from the start. We have seen this cycle repeat in garment factories in Famalicão and in finishing plants in Guimarães. The detail that implementation manuals don't mention: the moment when the company's "IT hero" — the person with 15 years in the house who knows where all the files are — finally admits that the two systems are irreconcilable is always the moment when the cost of integration has tripled.

What made this problem more expensive over the last three years

Two factors have decisively changed the calculus.

The first is regulatory. Monthly SAF-T (Portaria 195/2020) requires production data to be traceable and auditable alongside financial data. A factory with the MES disconnected from the ERP does that reconciliation manually every month — or risks inconsistencies in the SAF-T file that the tax authority (AT) may question. This is not a theoretical risk: it is recurring manual work that consumes hours from people who have other duties.

The second is structural. The INE (2025) indicates that only 53.7% of companies in Portugal used an ERP and 45% carried out data analysis. Many factories that installed an MES over the last three years did so on top of an immature ERP base — without stable APIs, without a normalised data model, without an IT team capable of maintaining an integration. The MES was left floating over an ERP that was not ready to receive it.

The EU Strategy for Sustainable and Circular Textiles changes the game in textiles

For the textile sector — which accounts for around 11% of the Gross Value Added of national manufacturing, according to the ATP — European regulatory pressure adds a new layer, with a deadline. The digital product passport (DPP) will require batch traceability from raw material to finished product. That is impossible unless the MES and the ERP share the same batch reference, in real time.

A finishing plant in Guimarães that today records the batch in the MES and the invoice in the ERP with different references will have to resolve this problem before the DPP becomes mandatory — or will resolve it in a rush, at a far greater cost, with the international buyer asking questions that have no answer in the system.

The available integration architectures: real trade-offs

There is no single way to integrate MES and ERP. There are four architectures with distinct trade-offs. The right choice depends on IT maturity, transaction volume and latency tolerance — not on what the MES vendor recommends by default.

Architecture Mechanism Typical latency Implementation complexity Maintenance cost Suitable for
Scheduled flat file (FTP/CSV) Periodic export/import 15 min – 24h Low High (fragile) Factories <50 employees, legacy ERP
Synchronous REST API Direct call between systems <1 second Medium Medium Factories with modern ERP and in-house IT
Middleware / ESB Central integration bus Seconds High High Industrial groups, multiple factories
MQTT / asynchronous messaging Event-driven publish-subscribe Milliseconds High Medium-low (if well designed) Lines with PLCs and IoT sensors

Flat file: the invisible cost of the "cheap" option

Integration via scheduled CSV file is the most common in medium-sized Portuguese factories. It is also the one with the highest long-term maintenance cost — and the most invisible, because it never appears on a budget line. Every time the ERP changes version, the export format changes. Every time the MES adds a new field, the import script breaks. The person who maintains this is usually the company's IT hero — the person who can't take holiday in August because that's when the system fails.

Audit how many hours per month your IT team spends fixing import/export errors between MES and ERP. In factories where we have tracked this pattern, that number is rarely less than 8 hours per month — and frequently exceeds 20. At 40 euros/hour of internal cost, that is 800 to 4,000 euros per month on work that creates no value whatsoever.

REST API: the right balance for most medium-sized factories

For an industrial factory with a modern ERP — such as ERP MULTI or QAD Adaptive ERP — integration via REST API is the architecture with the best balance between cost, latency and maintainability. It allows the MES to query and write to the ERP in real time, without intermediate files, without fragile scripts, without the IT hero running in on a Saturday morning.

The critical requirement, which many projects ignore at the evaluation stage: the ERP must expose documented and versioned APIs. An ERP that only exports data via reports or files does not support this architecture without significant additional development — and that development has a cost that is rarely in the initial budget.

MQTT and messaging: when the shop floor has PLCs

When integration involves physical equipment — PLCs, sensors, industrial terminals — the MQTT protocol is the de facto standard for low-latency machine-to-machine communication. OPC-UA integration with PLCs, described in detail in the article KORA Productivity: OPC-UA integration with PLCs on the shop floor, shows how this layer connects with the MES level before reaching the ERP.

The most common mistake is treating MQTT as a substitute for MES-ERP integration. It isn't. MQTT resolves communication between machines and the MES. MES-ERP integration is a separate layer, with distinct business requirements — and confusing the two layers is one of the reasons why Industry 4.0 projects stall halfway through.

The trade-offs by dimension: a decision matrix

Dimension Flat file REST API Middleware/ESB MQTT + messaging
Initial cost Very low Medium High High
Cost over 3 years High (maintenance) Medium Medium-high Low-medium
Data latency High (15 min to 24h) Low (<1 s) Low (seconds) Very low (ms)
Risk of breakage High Medium Low (if well managed) Low
Requires in-house IT No (but it helps) Yes Yes (specialised) Yes (specialised)
Compatible with monthly SAF-T With manual effort Yes Yes Yes (with ERP layer)
Scalable to multiple factories No With limitations Yes Yes

The factor no table captures: the quality of the master data

No integration architecture works if the master data is inconsistent between systems. This is the most frequent cause of failure in MES-ERP integration projects — and the least discussed at the evaluation stage, because nobody wants to be the bearer of the bad news that the data is wrong before the project even begins.

Before choosing the architecture, check five points without exception: whether the item codes are exactly the same in the MES and the ERP, with no local prefixes or department variants; whether cost centres and work centres have the same hierarchical structure in both systems; whether units of measure are consistent (metres, kilograms, units — not a mix that "everyone knows"); whether there is a single batch reference field that both systems recognise without transformation; and, finally, whether it is documented which is the system of record for each entity. If the answer to any of these questions is "it depends" or "more or less", the integration will fail regardless of the chosen architecture. Fix the master data first — it is the only sequence that works.

The hidden costs that the CFO also doesn't see

The COO doesn't see the operational costs of disintegration. The CFO doesn't see the financial costs. They are different — and equally real.

Incorrect cost allocation

Without real-time integration, the ERP allocates production costs based on standards — what should have happened, not what did happen. When the line stops for 47 minutes and the operator doesn't record the cause in the system, that cost disappears. The production order closes at standard cost. The variance goes into a "production differences" account that the CFO analyses once a quarter, when it's already too late to act.

In the Portuguese apparel sector, where subcontracting margins are often very tight, this distortion can make the difference between a profitable item and one that destroys value without anyone knowing. The factory keeps producing the item because the system says it's profitable — and the system says that because it doesn't have the real data.

Safety stock calculated on wrong data

The safety stock calculated by the ERP uses the historical consumption recorded in the ERP. If the MES consumes components without communicating to the ERP in real time, the ERP sees stock that doesn't exist. The practical result: component shortages that the system didn't foresee, because the consumption data arrived late — 24 hours later, in the best case.

The worst stock is phantom stock: the system says it exists, the warehouse confirms it doesn't. The cause is almost always an MES-ERP integration that runs every 24 hours.

Batch traceability and regulatory compliance

The NIS2 Directive (EU Directive 2022/2555, transposed into Portuguese law by DL 65/2025) imposes requirements for operational continuity and traceability of critical systems for operators in essential sectors. A factory that cannot reconstruct the production chain of a defective batch — because the MES and the ERP have different batch references — has a compliance problem, not just an operational one.

For the food and pharmaceutical sectors, this risk is immediate and carries direct legal consequences. For textiles and footwear, the pressure comes from international buyers — who demand batch traceability as a contractual condition, even before any European regulation formally imposes it. A German buyer who visits a footwear factory in Felgueiras twice a year already asks this question. The answer "it's in the MES and in the ERP, but they aren't connected" is not acceptable.

What works in practice

Pattern 1: incremental integration with API and validation in real production

A footwear factory in Felgueiras with around 120 employees that adopts a two-phase approach has a concrete advantage that "big bang" approaches don't have: errors appear in low-risk transactions, not in month-end closes. In the first phase, it integrates via API only the critical flows — opening production orders, confirming operations and component consumption. In the second phase, it adds the secondary flows: non-quality costs, setup times, batch traceability. Sixty days of real operation between phases is the minimum needed to validate the quality of the master data before scaling. Less than that is project optimism, not risk management.

Pattern 2: MES as the capture layer, ERP as the system of record

The most robust pattern we see in mature industrial factories is a clear separation of responsibilities: the MES captures what happens on the shop floor in real time; the ERP is the system of record for everything with a financial impact. The integration flows in one direction (MES → ERP) for production confirmations and consumption, and in the other (ERP → MES) for production orders and cost standards. There is no ambiguity about who owns each piece of data — and that clarity avoids data conflicts in production which, without it, always appear at the worst possible time.

This architecture is compatible with what KORA Productivity implements — real-time production capture feeding the ERP, without duplicating master data. The article KORA Productivity on the shop floor: from paper to validated OEE details how this capture works operationally, including the cases where the operator doesn't record and the system has to infer.

Pattern 3: the warehouse as the entry point for those who don't know where to start

For factories where MES-ERP integration seems too complex to begin with, the most pragmatic entry point is often the warehouse. Integrating warehouse management — raw material receipts, issues to production, finished product receipts — immediately resolves the phantom stock problem and creates the integration infrastructure that the MES can then use. It is a sequence that has operational logic: the warehouse is the point where physical data and financial data meet most naturally.

The KORA Inventory Suite and the article KORA Inventory: configuring voice and batch picking in the warehouse show how this warehouse layer connects with the ERP — and can serve as a basis for subsequent MES integration, without starting from scratch.

How to measure success after integration

Defining metrics before integration is the only way to prove the value afterwards. The right metrics are not those of the isolated MES — they are the ones that cross MES and ERP and show what changed financially.

On the financial side: the variance of real production cost against standard, per production order, should decrease with integration; the monthly production close time should decrease when reconciliation is automatic; the value of stock diverging between MES and ERP should tend towards zero. On the operational side: the time between a stoppage event in the MES and a cost record in the ERP measures the real latency of the integration; the rate of production orders closed automatically versus those requiring manual intervention shows the maturity of the process; the number of manual stock adjustments per month is the most honest indicator of integration quality — if it doesn't go down, the integration isn't working as it should. On the compliance side: the time to reconstruct the batch chain of a finished product and the number of inconsistencies detected in the monthly SAF-T before submission are the two numbers the CFO and the IT director should track together.

If after integration the monthly close time hasn't decreased and manual stock adjustments haven't dropped, the integration isn't working — it's just appearing to work.

Five steps to escape disintegration without wrecking the budget

  1. Audit the master data before touching the integration. Map the item codes, work centres and batch references in both systems. Identify divergences. Correct them in the ERP — which is the system of record — before any integration development. This step takes longer than expected. Plan for double the estimated time.
  2. Document the system of record for each entity. Items: ERP. Production orders: ERP creates, MES confirms. Operation times: MES captures, ERP receives. Without this document signed by all three parties — production, finance and IT — the integration will create data conflicts in production, and nobody will know whose responsibility it is to resolve them.
  3. Start with the flows of greatest financial impact. Production order confirmation and component consumption have a direct impact on cost and stock. Integrate these two flows first, validate over 60 days, then move on to the rest. The temptation to integrate everything at once is the most common cause of projects that stall halfway.
  4. Instrument the integration from day one. Configure automatic alerts for integration failures — don't find out that the MES stopped communicating with the ERP three days later, at month-end. A transaction log with email alerts is enough to start with. What isn't monitored fails in silence.
  5. Record the baseline before switching on the integration. Without the current values of the metrics defined above, there is no argument for the next investment — nor to prove to the CFO that this one was worth it. The institutional memory of "how it was before" disappears surprisingly quickly.

To go deeper into the shop floor layer before tackling integration with the ERP, the articles KORA Productivity: OPC-UA integration with PLCs on the shop floor and KORA Productivity on the shop floor: from paper to validated OEE provide the operational context that is missing in most integration evaluations.

Productivity per hour worked in Portugal was around 67% of the EU average in 2022 (Eurostat). Part of that gap is structural — company size, human capital, R&D investment. Another part is information that already exists in the systems but is never brought together for anyone to use. An MES integrated with the ERP does not resolve the structural gap. But it eliminates the part that is pure data inefficiency — and that part, unlike the structural gap, has a solution this week, with the systems the factory already has.

Sources

  • Siemens, The True Cost of Downtime 2024, Siemens Digital Industries Software, 2024.
  • INE — Instituto Nacional de Estatística, Survey on the Use of Information and Communication Technologies in Enterprises 2025, INE, 2025.
  • Eurostat, Labour Productivity per Hour Worked, Eurostat, 2022 data (code: nama_10_lp_ulc).
  • ATP — Associação Têxtil e Vestuário de Portugal, Exports of the Portuguese textile and clothing industry in 2025 (provisional INE data, Feb 2026), via ATP.
  • Portaria no. 195/2020, of 13 August — monthly submission of the SAF-T (PT) file to the Tax and Customs Authority, Diário da República.
  • Directive (EU) 2022/2555 of the European Parliament and of the Council (NIS2), Official Journal of the European Union, December 2022; transposed into Portuguese law by Decree-Law no. 65/2025.

Frequently asked questions

What is the hidden cost of an MES without ERP integration?

It is the set of expenses that don't appear in either system: wasted labour hours, tied-up raw material, delivery penalties and recurring manual reconciliations. The MES records production stoppages, the ERP records incomplete orders, but nobody cross-references the data to calculate the real financial impact of each incident.

Why does OEE rise but the operating margin not change?

Isolated OEE measures only the efficiency of the production line. To relate that efficiency to the real margin, you need to allocate labour, energy and overhead costs that come from the ERP. Without integration, the COO sees correct production figures but makes capacity decisions with half the necessary information.

What is the most common mistake in medium-sized Portuguese factories?

The MES is bought as an operational improvement project, without involvement from IT or the CFO. Integration with the ERP is deferred to a "phase 2" that never receives budget. After 18 months, the divergence between the two systems is so great that integration costs more than it would have from the start.

How does monthly SAF-T affect a factory with the MES disconnected from the ERP?

Portaria 195/2020 requires joint traceability and auditability of production and financial data. A factory without integration does that reconciliation manually every month, consuming recurring work hours, or risks inconsistencies that the AT may question.

What is the digital product passport and how does it affect Portuguese textiles?

It is a European regulatory requirement that will mandate batch traceability from raw material to finished product. This is impossible unless the MES and the ERP share the same batch reference in real time. Factories that today record batches with different references will have to resolve the problem before the DPP becomes mandatory.

What is the difference between an MES and a speedometer without an instrument panel?

An isolated speedometer tells you how fast you're going, but not whether there's fuel, whether the engine is overheating or whether you've reached the right destination. An MES without an ERP records production speed, but not the real unit cost, the impact on delivery dates, the stock deviation or the margin of the item produced.

What integration architectures exist to connect MES and ERP?

There are four architectures with distinct trade-offs: scheduled flat file (suitable for small factories with legacy ERP), synchronous REST API (for modern ERP with in-house IT), middleware/ESB (for complex environments) and real-time integration (for critical operations). The choice depends on IT maturity, transaction volume and latency tolerance.