How Is Data Read from a PLC?

How Is Data Read from a PLC?

Reading data from a PLC is the process of transferring status bits, counters, alarm codes and process values from the programmable logic controller’s memory to an MES, SCADA or data collection system through a communication protocol. Done correctly, machine data can be monitored in real time without the need for operator input.

In brief

  • Routes: built-in OPC UA server, Modbus TCP, EtherNet/IP, brand protocols (Siemens S7, Mitsubishi MC, Omron FINS), gateway.
  • Requirements: PLC IP address, address/tag map, network access, read permission.
  • Priority data: running bit, part counter, alarm code.
  • Rule: the MES only reads; write permission is defined separately.

How Is PLC Data Structured?

PLC memory consists of input (I), output (Q), flag/marker (M) and data block (DB) or register areas. The machine’s “running” information sits in these areas as a bit, the production count as a counter and the target temperature as a floating-point value. In modern PLCs these areas can also be presented as named tags (“Machine.Running”). The first step in reading data is to obtain the map showing which information is at which address and of which type.

Reading Methods

MethodSuitable PLCsProsCons
OPC UA (built-in server)Siemens S7-1500, Beckhoff, B&R, newer RockwellSecure, typed, named dataNot available on older PLCs
Modbus TCPAlmost all brands (enabled in the program)Simple, widespreadRaw registers, no security
EtherNet/IPRockwell/Allen-Bradley, Omron NJ/NXReading by tag nameBrand-focused
Siemens S7 (ISO-on-TCP)S7-300/400/1200/1500DB reading without programmingAccess permission must be enabled on the 1500
Mitsubishi MC, Omron FINSThe respective brandsBuilt-in, fastBrand-dependent
Gateway / edge deviceSerial or older PLCsConverts any protocol to OPC UA/MQTTExtra hardware, extra latency

Step-by-Step Implementation

  1. Inventory: Machine, PLC model, firmware, existing communication card and IP address.
  2. Address map: Extract the addresses of the running bit, counter, alarms and recipe from the machine builder or the PLC program. If there is none, define a small “MES interface block” with the PLC programmer: all required data gathered in a single DB or register block.
  3. Network access: Open a firewall rule only for the required port from the OT segment where the PLC sits to the data collection server.
  4. Test read: Verify the values with a client tool by observing them at the machine: does the counter increase by one per part, does the bit really drop when the machine stops?
  5. Scanning and subscription: 500 ms–1 s for status bits, a few seconds for counters; prefer change subscriptions in OPC UA.
  6. Putting it in context: The count and status read are matched in the MES with the work order, product and shift; only then are OEE and downtime analysis produced.

Common Mistakes

  • Not accounting for counter overflow (16 bit → 65535); negative values appear when calculating differences.
  • Planning a project without access to the machine builder’s locked PLC program; request the address map at the contract stage.
  • Deriving “running” from the motor output and counting idle running as production.
  • Not noticing that addresses shifted after a firmware update; verify read values periodically.

Frequently Asked Questions

Can data be read without touching the PLC program?
In most cases, yes. Protocols such as Modbus TCP, OPC UA, EtherNet/IP, Mitsubishi MC and Omron FINS read memory areas directly; no change in the PLC program is needed. However, if the desired information is not collected in a single variable, a small program addition may be needed, for example to derive the “running” bit from several conditions.
Does reading data from a PLC slow down the machine?
Not at a reasonable scan interval. The PLC’s communication processor works separately; problems usually come from trying to read hundreds of variables every 100 ms. With block reads and event-based subscriptions, the load stays negligible. On older PLCs with serial connections, however, the scan time should be taken into account.
Which PLC data is enough for MES?
Three pieces of data are enough to start: the running status bit, the cycle/part counter and the active alarm code. From these, availability, performance and downtime reasons are derived automatically. Recipe number, mould code and process parameters are added in a second phase.

PLC Data Reading in EFFIX MES

EFFIX MES connects directly to PLCs with the OPC UA, Modbus, EtherNet/IP, Mitsubishi MC and Omron FINS protocols; MTConnect is used for CNC machines and Euromap 63/77 for injection moulding machines. On machines without protocol support, Inolink wireless IoT nodes collect data at signal level. The status and counter values read are turned into automatic downtime records, OEE and work order progress; from the HMI terminal, the operator only completes information the machine cannot know, such as the downtime reason. For details, see the EFFIX MES page or request a demo.