IMDHMIControls LibraryShop main store

Explainer

What PROFINET communication between a PC and a PLC needs

Industrial networks Published 8 min read

Short answer

Cyclic PROFINET IO between a PC and a PLC works only when one side is the IO controller, the other an IO device matched by GSDML description, device name and identical cyclic transfer areas; a ping or a link light proves none of that. If you only need tag values, run OPC UA instead.

On this page
  1. Complementary roles decide whether a connection can exist
  2. The device description is the contract
  3. Cyclic transfer areas and who produces each byte
  4. Worked example: matching a 4-byte cyclic area between an S7 and a PC stack
  5. The device name binds configuration to hardware
  6. What the PC side has to run
  7. When you only need tag values, run OPC UA
  8. The decision, case by case
  9. Questions asked

Cyclic PROFINET IO between a PC and a PLC works only when the two stacks hold complementary PROFINET roles: one end is the IO controller that owns the connection, the other is an IO device that matches it byte for byte. Each side must also be able to load the other's device description, and the IO device must carry the device name the controller project expects. A link light, a ping reply or an open TCP socket proves none of that. This page gives the four requirements in order, works a byte-level mapping example, and ends with the decision for each case, including what to run when you only need tag values.

Complementary roles decide whether a connection can exist #

PROFINET IO, the real-time profile carried in the IEC 61158 and IEC 61784 family, moves cyclic process data between exactly two roles. The IO controller establishes the connection, provides the output data and consumes the input data. The IO device consumes those outputs and produces the inputs. A third role, the supervisor, attaches for diagnostics and commissioning records; it does not carry the cyclic process data.

Because the roles are defined as a pair, a PC stack and a PLC can exchange IO data only when the PC stack's documented role is the complement of the role you configure on the PLC interface. The application environment on the PC — LabVIEW, for example — is not itself the stack: PROFINET is implemented by the stack or library that environment loads, and that component is what carries a documented role. An example that shows a drive talking PROFINET to a PC library proves the stack speaks the protocol and that the PC held the controller role there; it does not prove a PLC interface can take the drive's place as IO device, nor that the stack can flip roles.

PC stack role The PLC interface must be Where each side is configured
IO controller IO device, on an interface documented to support IO-device operation The PC project holds the PLC interface's device description
IO device IO controller The PLC hardware project holds the PC stack's GSDML and declares the transfer areas
TCP or OPC UA client only No PROFINET IO role at all No IO configuration on either side

Roles are not interchangeable inside one connection, which is the same reasoning that keeps a PROFINET IO-device gateway from acting as a controller (why a PROFINET IO-device gateway cannot be a controller). One physical interface can hold two roles at once, though: the I-Device function lets a PROFINET interface be an IO device toward one controller and an IO controller toward further devices at the same time, which is how chained S7 data exchange projects are built (I-Device or PUT/GET data exchange between an S7-1200 and an S7-300).

The device description is the contract #

A GSDML file is the standardized, machine-readable description of a PROFINET device: its identification, its slot and submodule structure, its communication features and its process data layout. Vendors of PROFINET devices supply it, and the specification is maintained by the PROFIBUS and PROFINET international body.

The IO controller's engineering tool builds the connection from that description, so the file must describe the device that will actually answer. A drive's GSDML cannot stand in for a PC stack, and a general Ethernet claim in a library brochure is not a description. When the PC end runs as the IO device, its stack ships a GSDML of its own: install that file into the PLC's engineering tool, place the PC as a device in the hardware project, and fill its slots with the submodules whose lengths the PC stack actually declares. How the file is installed decides what the tool then offers you — the same mechanism that makes the GSDML install route decide CODESYS device repository entries (why the GSDML install route decides CODESYS device repository entries) applies in every engineering tool.

Cyclic transfer areas and who produces each byte #

PROFINET IO does not expose arbitrary PLC variables. It moves the bytes of the transfer areas declared in the configuration, nothing else, so the two projects must declare matching areas and split them into fields the same way. Direction names come from the controller's viewpoint: controller outputs are bytes the controller sends and the device receives; controller inputs are bytes the device produces and the controller consumes.

For every field, write one row in a mapping table before any code: producer, consumer, direction, byte offset, length in bytes, data type. The test of the table is simple — every transmitted field has exactly one receiving field, and no field exists on one side only.

One safety note: a standard PROFINET IO connection between a PC and a PLC is not a safety channel. Any stop that protects a person must run as a validated safety function on safety-rated hardware, not through these transfer areas.

Worked example: matching a 4-byte cyclic area between an S7 and a PC stack #

Inputs — an example configuration you declare in both projects, not a vendor default. The S7 PROFINET port is the IO controller, with one submodule declaring 4 output bytes and 4 input bytes. The PC stack is the IO device, described by its own GSDML, declaring one submodule of the same shape. The output area carries a control word of 2 bytes at offset 0 and a speed setpoint of 2 bytes at offset 2. The input area carries a status word of 2 bytes at offset 0 and an actual speed of 2 bytes at offset 2.

Rule: every producer field maps to exactly one consumer field, the field lengths must sum to the declared submodule length, and the direction labels follow the controller's viewpoint.

Arithmetic: outputs, 2 + 2 = 4 bytes, equal to the declared output length; inputs, 2 + 2 = 4 bytes, equal to the declared input length.

Result: both engineering tools accept the projects and the controller establishes the connection. Prove the wiring of the bytes with a known pattern: write 16#1234 into the speed setpoint from the PLC. PROFINET carries process data in big-endian order, so the PC stack reads 16#12 at offset 2 and 16#34 at offset 3. Raw equality proves transport only — both applications must still apply the same scaling and signedness to that word.

Decision: the threshold is zero bytes of difference. If the PC stack declares 6 output bytes where the PLC submodule declares 4, the engineering tool rejects the download or the controller tears the connection down with a configuration mismatch. The fix is identical declarations on both sides, never padding.

The device name binds configuration to hardware #

A PROFINET IO device is identified on the network by a device name that commissioning assigns to the port, using the engineering tool's discovery function; the IP settings travel with the same step or follow from the project. The controller begins each connection by looking for the device that answers to the name in its project.

An IP address that replies to a ping therefore proves nothing about the IO connection. The wrong device with the right address, a duplicate name on a second interface, or a project never written to the device all leave the controller searching or refusing to connect. Keep the PC stack's adapter binding in the same check: a stack that opens the wrong network adapter fails the name lookup no matter how healthy the cable is.

When the PLC rejects the connection with a parameter or configuration error, work through the checklist for connect errors between a controller and an S7-1200 (fixing PROFINET connect errors between a controller and an S7-1200); its items — project against device name, address conflicts, description versions — are the same items a PC stack has to pass.

What the PC side has to run #

The stack, not the application environment, sets the hardware requirements: a supported network adapter, a driver or runtime service with the rights it needs, and a license obtained through the manufacturer's channels. Confirm three things before building logic: the stack's documentation names its role explicitly, as IO controller or IO device; the PC operating system and adapter are on its support list; and its own initialization diagnostic opens the intended adapter without a driver or interface error.

If this PC is not a temporary laptop but the machine's permanent gateway or OPC UA host beside the PLC, that is the job of an industrial mini PC specified for the cabinet, not an office tower balanced on a workbench.

When you only need tag values, run OPC UA #

If the requirement is supervisory — reading and writing tags, logging, alarming — PROFINET IO is the wrong tool: it is a configured process-data interface, not variable access. Run an OPC UA client against the OPC UA server of the controller, or of a gateway in the cabinet, and skip GSDML, device names and transfer areas entirely.

The OPC Foundation's PROFINET companion specifications exist for exactly the boundary case where OPC UA must reach PROFINET device data: OPC 30140 maps PROFINET IO data access and OPC 30144 maps the GSD generic model into the OPC UA address space. The same pattern, fieldbus addresses becoming named OPC UA symbols, is what makes it possible to expose Modbus coil addresses as named OPC UA symbols (exposing Modbus coil addresses as named OPC UA symbols).

The decision, case by case #

  • The PC must exchange cyclic process data with the PLC: decide which end is the IO controller, confirm the other end's interface or stack documents the complementary role, load the device description that matches the real device, declare byte-identical transfer areas, assign the device name, then prove the mapping with a known test pattern.
  • The PC only reads or writes tags: skip PROFINET IO and run OPC UA instead.
  • The example you found uses a drive as the IO device: it proves the stack speaks PROFINET, not that the PLC can take that role — check the roles before reusing its code.
  • A role is undocumented on either side: that is a stop, not a small risk. The pairing cannot be commissioned until one side's role is documented, so read the stack's role statement and the PLC interface's operating modes first.

Questions asked

Does PROFINET IO traffic work through a router?

No. The device name lookup and the cyclic real-time frames are not routed, so the PC adapter and the PLC port must sit on one machine network or subnet. Ordinary managed switches between them are fine; put an IP router in the path and name assignment and cyclic data both fail.

Can the PLC run other Ethernet services while it exchanges PROFINET IO?

Yes. A PROFINET interface carries its cyclic real-time frames and its standard TCP/IP traffic as separate channels on the same cable, so OPC UA, web diagnostics or socket communication keep running while an IO connection is established. The cyclic connection does not depend on those TCP services, and an IO fault does not by itself stop them.

Can one IO controller talk to several PC stacks at once?

Yes. An IO controller maintains its own connection to each configured IO device, so two PC stacks can each be an IO device to the same PLC. Every device needs its own device name and its own declared transfer areas, and a connection fault on one of them leaves the others running.

If I only need tag values, what should the PC run instead?

OPC UA needs no GSDML, device name or transfer areas; it reaches tags by name over request-response communication. The standard TCP port is 4840 unless the server is configured differently, and the server's security policy and its certificates are the commissioning you do instead.

Keep reading

  • Explainer

    Why a PROFINET IO-device gateway cannot be a controller

    No. A PROFINET IO device cannot open the cyclic exchange with the Wago 750-8215, because every cyclic exchange is established by an IO controller. Use a gateway whose PROFINET side is an IO controller that imports the machine's GSDML, and the machine program stays unchanged.

    Industrial networks

  • Comparison

    Why PROFINET RT and IRT need different PC hardware

    HSE, EtherNet/IP and PROFINET NRT run on a stock PC Ethernet NIC because they ride on IP and TCP or UDP. PROFINET RT also runs on stock hardware if the stack sends raw Ethernet frames and the PC stays on one segment. Only IRT needs dedicated time-scheduled hardware, and a PC connects to an IRT cell through ordinary Ethernet ports only.

    Industrial networks

  • Troubleshooting

    Fix robot Profinet output writes over OPC UA

    Set the Profinet Internal Device Input Size and Output Size to 64 bytes each, under Controller tab, Configuration, I/O System, Profinet Internal Device, and robot output writes reach the PLC array. The failing direction, not the OPC UA status number, identifies the cause: a Bad-class write with the other direction working means the output byte image is missing.

    Industrial networks

Reach a safety PLC over EtherCAT EoE from a Windows PC