IMDHMIControls LibraryShop main store

Explainer

Why a PROFINET port can also poll Modbus TCP power meters

Industrial networks Published 8 min read

Short answer

Yes — with no extra hardware. PROFINET IO and Modbus TCP share the same switched Ethernet, so the CPU's onboard PROFINET port opens Modbus TCP client connections to each meter on TCP port 502 and polls energy registers every one to five seconds. PROFINET RT keeps its priority class at the switches, metering traffic stays orders of magnitude under link capacity, and the register conversion is manual number minus 40001.

On this page
  1. Can one PROFINET port poll Modbus TCP meters without extra hardware?
  2. Why do PROFINET and Modbus TCP coexist on the same Ethernet?
  3. How often should the PLC poll a power meter over Modbus TCP?
  4. How much load does Modbus TCP metering add to the network?
  5. Does Modbus TCP polling disturb the PROFINET I/O update?
  6. When is a gateway or DP expansion still the right choice?
  7. How do you convert a meter's register numbers into Modbus TCP addresses?
  8. Questions asked

You need no extra hardware, and that is the whole decision. A PROFINET network is switched Ethernet underneath, so the CPU's onboard PROFINET port can open Modbus TCP client connections to each power meter on TCP port 502 and poll its energy registers acyclically. PROFINET IO keeps its real-time behavior because RT frames keep their IEEE 802.1P priority class through every switch, while metering traffic at a sane poll rate consumes a fraction of a percent of a 100 Mbit/s link. This article gives the numbers behind that: the poll interval to use, the load arithmetic you can check, the priority mechanism that protects the IO traffic, the register-number conversion, and the two cases where gateway or PROFIBUS hardware is still the right call.

Can one PROFINET port poll Modbus TCP meters without extra hardware? #

Yes, with zero added part numbers: the CPU's onboard PROFINET port already speaks TCP/IP, so it opens one Modbus TCP client connection per meter on port 502 and polls holding registers directly, with no gateway, no serial DP module and no PROFIBUS link at any location.

The first route everyone reaches for is serial: a DP expansion module at every meter plus an IE/PB link at every location. Four meters split across two sites become six added devices to mount, parameterize and stock, against one connection defined in software the PLC already has. Port sharing is not exotic either: the same onboard port routinely carries PROFINET IO, S7 communication and Modbus TCP at once, which Can one S7 CPU PN port run Modbus TCP and S7 comms together works through in detail.

Decision: for meters that feed monitoring, trending and alarms, poll them from the onboard port and add no hardware at all.

Why do PROFINET and Modbus TCP coexist on the same Ethernet? #

They never collide because they are different frame types: PROFINET RT sends Ethernet frames with EtherType 0x8892 tagged to IEEE 802.1P priority 6 with VLAN ID 0, while Modbus TCP rides plain TCP on registered port 502 inside standard Ethernet frames, so one switch forwards both without confusion.

A Modbus TCP exchange is defined by the MODBUS Messaging on TCP/IP Implementation Guide V1.0b: a 7-byte MBAP header — transaction identifier, protocol identifier fixed at 0, length, unit identifier — followed by the function code and its data. The PROFINET side never looks at any of that: a switch sorts RT frames at Layer 2 by their 0x8892 EtherType and their priority 6 tag, and hands IP-encapsulated frames to the normal TCP path unchanged.

Switch behavior decides how cleanly the two run together. A managed industrial switch honors the IEEE 802.1P queues and keeps RT traffic in the fast lane; an unmanaged switch forwards both correctly at metering rates but adds store-and-forward jitter to RT traffic when the link runs hot. That is the same failure mode that makes a protocol gateway seize up when someone uses it as a plain hub — Why an industrial gateway locks up when used as a network hub describes the mechanism.

Decision: leave the Modbus TCP frames untagged, keep the priority handling in the switches, and use managed industrial switches wherever the RT update time actually matters.

How often should the PLC poll a power meter over Modbus TCP? #

Poll energy registers every 1,000 to 5,000 ms: a meter integrates kilowatthours over seconds, so a 2,000 ms cycle catches every change that matters while leaving the link nearly idle, and even a fast documented polling task running 200 ms to 1 s cycles adds little more.

Split the interval by quantity, not by meter. Demand power in kW moves on a one-second scale, voltage and current can go faster when you need them for diagnostics, and an energy counter barely moves inside five seconds — set one interval per register block. Trigger each poll from a step chain so one request sits in flight per meter, and keep the TCP connection open between polls; reconnecting every cycle spends a handshake per read and wears out servers that accept a limited number of connections.

Each meter is one server, so each one gets its own connection and its own client instance; sharing an instance across two servers is a documented way to kill reads, as Why two MB_CLIENT instances stop Modbus TCP reads from one server explains. TCP also permits genuine parallelism across meters — unlike one serial line — which is why parallel Modbus TCP clients beat one sequential poller once the meter count climbs.

Decision: poll energy and demand registers every 2,000 ms, go faster only for diagnostic values, keep one open connection with one instance per meter, and stagger or parallelize polls but never multiplex them through a shared instance.

How much load does Modbus TCP metering add to the network? #

Roughly 3.5 kbit/s: four meters polled every 2 s, one 20-register read each, move 868 bytes per cycle with TCP, IP and Ethernet headers included, which is 0.0035 percent of a 100 Mbit/s link and noise next to any PROFINET IO traffic.

Here is the arithmetic for that example — four meters, 20 holding registers each, at the poll period above:

  • Request: MBAP header 7 bytes + function code 1 byte + start address 2 bytes + register count 2 bytes = 12 bytes.
  • Response: 7 + 1 + byte count 1 byte + 20 registers × 2 bytes = 49 bytes.
  • Overhead per frame: TCP 20 bytes + IPv4 20 + Ethernet header 14 + FCS 4 + preamble 8 + interframe gap 12 = 78 bytes.
  • Per meter per poll: (12 + 78) + (49 + 78) = 217 bytes.
  • All four meters: 4 × 217 = 868 bytes per 2 s = 434 bytes/s = 3,472 bit/s.
  • Share of the 100 Mbit/s (100BASE-TX) link: 3,472 ÷ 100,000,000 ≈ 0.0035 percent.

Servers that pad short frames to Ethernet's 60-byte minimum move the total by a few hundred bytes per second; the magnitude holds. Forty meters at this rate stay under 0.15 percent of link capacity.

Decision: bandwidth never sizes this design — a poll rate that serves the data also sits orders of magnitude under the wire, so the real resource limit is the CPU's documented connection count.

Does Modbus TCP polling disturb the PROFINET I/O update? #

Not at these rates: the switches queue the tagged RT frames ahead of Modbus TCP at every hop, and 3.5 kbit/s of metering never builds a queue — the side that degrades under congestion is Modbus TCP, whose own timeout and retry recover it.

IEEE 802.1P gives an Ethernet frame three priority bits, and the PROFINET RT profile fixes its class at VLAN ID 0 with priority 6. A switch that honors the tag drops RT frames into the high queue and lets Modbus TCP use what remains; at 0.0035 percent occupancy there is no queue to wait in. The realistic way to trouble the IO traffic is a saturated or misconfigured fabric, not the coexistence itself.

Set the client's response timeout well above any plausible switch delay — 1 to 3 s for metering data — and alarm on stale values instead of trusting the last read forever. One safety note: a polled register carries no cyclic watchdog, so never drive an interlock or an actuator from metered values read this way; anything that must trip belongs on PROFINET IO data with its watchdog behind it.

Decision: one switch fabric carries both protocols for metering; move the meters to their own VLAN or switch group only when the IO update time runs at 1 ms or faster on a busy segment.

When is a gateway or DP expansion still the right choice? #

Only when the program needs the meter as cyclic, watchdog-monitored I/O data rather than polled values: a protocol gateway turns the meters into PROFINET IO devices, while DP modules plus IE/PB links do the same job over PROFIBUS, and both exist for logic that must react within one IO update.

Approach Added hardware What the PLC sees Where it wins
Onboard PROFINET port as Modbus TCP client none acyclic polled registers monitoring, energy trending, alarms
Protocol gateway to PROFINET one gateway device cyclic IO data under watchdog logic that must react inside one IO update
DP module per meter plus IE/PB link per location six devices for four meters across two sites a DP slave behind a link the site already runs a PROFIBUS DP spine with spare slots

The split is data semantics, not capability: polled values are snapshots with no watchdog and no guaranteed arrival time, while IO data is cyclic and monitored — Why Modbus polling is not the same as remote I/O works through that difference. Energy data is the forgiving case: it changes over seconds and feeds displays, logs and alarms, all of which tolerate a poll.

Decision: buy gateway or DP hardware only when the consuming logic treats the meter as IO data; every dashboard, energy log and alarm report runs fine on the polled client with zero added devices.

How do you convert a meter's register numbers into Modbus TCP addresses? #

Subtract 40001: meter manuals number holding registers in the 4xxxx convention, with 40001 as the first register, while the client instruction takes the zero-based address, so manual register 40257 becomes address 256 and any register n becomes n minus 40001.

The subtraction in full: 40257 − 40001 = 256, so the manual's register 40257 is polled at start address 256 with function code 03 and a length of however many consecutive registers the value spans. Registers listed in the 3xxxx block are input registers and go out as function code 04.

Two more checks come from the device, not the convention. A 32-bit energy total occupies two consecutive 16-bit registers, and which word arrives first is a property of that meter — read a value you can check against the meter's own display and swap the words in the PLC if the decode is nonsense. The MBAP protocol identifier must be 0, and the unit identifier is whatever the meter's documentation demands; some servers answer only one specific unit ID, so take it from the register map.

Decision: address = manual register number − 40001, function code 03 for 4xxxx and 04 for 3xxxx, first decoded value verified against a reading visible on the meter before trusting the rest of the map.

Questions asked

What happens when a power meter stops answering Modbus TCP?

The client reports a response timeout for that poll and the step chain moves on, so one dead meter never stalls the others. Store each meter's values in its own data block with a timestamp and alarm in the SCADA when the timestamp stops advancing. The TCP connection can hang half-open, so set an application timeout of a few seconds and close and reopen the socket after repeated failures.

Do the Modbus TCP polls need any tagging or VLAN of their own?

No. The IEEE 802.1P priority 6 marking belongs to PROFINET RT alone; Modbus TCP goes out as plain TCP traffic and carries no tag. Configure the queueing in the switches, not in the poller: a managed industrial switch that honors priority keeps the real-time frames first, while the metering polls use whatever bandwidth is left, which at these rates is nearly all of it.

How many Modbus TCP meters can one PROFINET port poll?

Bandwidth is never the limit; the controller's connection resources are. Each meter holds one TCP connection and needs its own client instance in the program. At the poll period used in the load example, even a hundred meters stay near 0.1 percent of a 100 Mbit/s link, so size the installation from the CPU's documented connection count and your scan budget.

Which function codes read energy and power registers?

Manuals list holding registers as 4xxxx and input registers as 3xxxx. Read a 4xxxx block with function code 03 and a 3xxxx block with function code 04; the client instruction picks the function through its mode parameter, not a separate code input. Energy totals sit in either block depending on the family, so take the block, offset and length straight from that meter's own register map.

Keep reading

  • How-to

    Setting up a CODESYS Modbus TCP client to talk through a gateway

    In CODESYS, Modbus TCP is an application library, not a fieldbus add-on: reference the Modbus TCP Client SL library, point the client at the gateway's IP on port 502 with the gateway's unit ID, and split the map into contiguous blocks of at most 125 registers per request. Every value is a cached copy whose worst-case age is the gateway poll cycle plus your client's map refresh time, so budget both against the freshness the process needs.

    Industrial networks

  • Troubleshooting

    Why an FX3U-ENET cannot serve Modbus TCP on port 502

    Modbus TCP on an FX3U needs the FX3U-ENET-P502: only that module can open TCP port 502. The standard FX3U-ENET reserves every port below 1024 for its own protocols, so a Modbus TCP client cannot connect to it and no GX Works2 setting changes that. Read the module label first; if it lacks the P502 suffix, the fix is a module swap or a gateway, not ladder edits.

    Industrial networks

  • Explainer

    Why parallel Modbus TCP clients beat one sequential poller

    Give each Modbus TCP slave its own client on the PLC and start every next request from the previous completion. A reported bench test held about 85 updates per second per client at a 10-register read, and raising the payload from 1 to 100 registers only dropped the rate to about 80 per second, because transaction count and scan scheduling — not register count — set the polling speed.

    Industrial networks