Why a direct PLC-to-ERP link is a bad idea
A PLC scans in milliseconds and must never wait for a database. ERP systems answer in seconds, change versions often and are reachable from office networks. Joining them directly lets an ERP outage or a slow query disturb machine control, and it exposes the control network to the IT network.
- Keep control logic and business logic separate.
- Buffer data so a network or ERP outage loses nothing.
- Keep the control network behind a firewall or DMZ.
Pick the interface
Most modern controllers offer more than one way to publish data. Choose by what your PLC supports and how the data will be used.
- OPC UA: vendor-neutral, secure and self-describing. The usual first choice for new projects. Many current PLC families include an OPC UA server, sometimes as a licensed option.
- MQTT: lightweight publish/subscribe, good for many machines sending events to one broker and for cloud or edge analytics.
- Modbus TCP: simple and widely supported, but has no built-in security or tag names. Use it for older devices behind a gateway.
- Vendor drivers or REST: some controllers and HMI/SCADA packages expose REST or a native driver. Convenient, but ties you to the vendor.
A step-by-step integration plan
- List the business events you need: part counts, good and scrap quantities, downtime reasons, batch or order numbers, machine state.
- Define a small data set in the PLC for each event, with a unique identifier and a timestamp. Do not expose raw internal tags.
- Publish that data set through OPC UA or MQTT with read-only access.
- Add an integration layer (an edge gateway, SCADA/MES or middleware) that subscribes, validates, buffers and converts the data.
- Map each field to the ERP object it updates (production order, goods receipt, maintenance notification).
- Write to the ERP through its supported API or staging tables, never directly into its core tables.
- Test with simulated values, then run in parallel with manual reporting before you switch over.
Security basics
- Use OPC UA security mode Sign & Encrypt with certificates, and disable anonymous access.
- Allow outbound connections from the control network to the integration layer, not inbound from the office network.
- Give the integration account read access only, unless the ERP must send an order back to the machine.
- Log every write and keep the system clock synchronised with NTP.
Hardware you may need
Older PLCs often need a communication module or a protocol gateway to reach Ethernet. Check the exact controller and firmware before buying, because options differ between versions of the same family.
- Ethernet or fieldbus communication modules
- Industrial edge gateways and managed switches
- Panel PCs or HMIs that act as a local data collector
Frequently asked questions
Can a PLC talk to an ERP without middleware?
Technically yes, through a database or REST driver, but it is not recommended. A middleware or edge layer buffers data, converts formats and protects the control network, so an ERP outage cannot stop production.
Is OPC UA better than MQTT for ERP integration?
OPC UA is better when you need structured, secured access to individual PLC variables. MQTT is better for lightweight event streams from many machines. Many plants use OPC UA at the machine and MQTT between sites.
Do I need to replace an older PLC to integrate it?
Not always. Many older controllers can be connected with an Ethernet module or a protocol gateway. Confirm the exact model and firmware first.
This guide is general engineering guidance. Always confirm part-specific details, ratings and compatibility against the manufacturer’s datasheet. We confirm price, stock and specifications for the exact part in a written quotation.