Skip to content
Tutorials Center
My learning

Topics

Lesson 29 of 37 ยท Communication Protocols

PROFINET, EtherNet/IP and I/O Mapping

Learn industrial Ethernet for PLCs: PROFINET, EtherNet/IP and EtherCAT, cyclic I/O exchange, device addressing and I/O mapping, with runnable C models of process images and bit packing.

Plain Ethernet carries emails and web pages. Industrial Ethernet carries the signals that start motors and read sensors, and it must do so on schedule. Several protocols adapt standard Ethernet hardware for this job. The three you will meet most are PROFINET (Siemens and the PI organization), EtherNet/IP (Rockwell and ODVA) and EtherCAT (Beckhoff and the ETG).

Real devices and engineering tools are not available on this site. This lesson explains how they work and uses C stand-ins to model the cyclic data exchange and I/O mapping that sit under all of them.

Protocol overview

Protocol Typical ecosystem How real-time is achieved
PROFINET RT / IRT Siemens and many others Prioritized frames in standard Ethernet (RT); scheduled time slots with special hardware (IRT)
EtherNet/IP Rockwell, Omron and others Standard TCP/UDP with CIP, producer/consumer, UDP multicast for I/O
EtherCAT Beckhoff and many drives A single frame passes through all slaves, each reading and inserting data on the fly
Modbus TCP Everywhere No real-time guarantee; see Modbus

Typical update times: tens of milliseconds for standard RT, down to well under a millisecond for EtherCAT and PROFINET IRT, which matters in motion control.

Controller, device, supervisor

In PROFINET the roles are IO controller (the PLC), IO devices (remote I/O, drives, sensors) and IO supervisor (an engineering station that configures them). In EtherNet/IP the PLC is a scanner and the remote devices are adapters. The same pattern holds: the controller opens connections to devices and exchanges data cyclically.

Each device needs a unique identity:

  • A MAC address burned into the hardware.
  • An IP address (all three protocols use IP in some form).
  • A device name in PROFINET, which the controller uses to assign the IP address at start-up. This lets you replace a failed device by giving the new one the same name.

Cyclic I/O and the process image

Each cycle, the device sends its input bytes to the controller and the controller sends output bytes to the device. These byte blocks are copied into the PLC's process image: a region of memory holding a snapshot of all inputs and outputs for the current scan. At the start of a scan the inputs are frozen; at the end the outputs are written. That gives consistent logic: a bit that changes mid-scan cannot confuse the program.

flowchart LR
    D["IO device<br/>(sensors, valves)"] -- "inputs, every cycle" --> PI["Process image<br/>inputs"]
    PI --> L["PLC program<br/>(scan)"]
    L --> PO["Process image<br/>outputs"]
    PO -- "outputs, every cycle" --> D

The program works only on the image, never directly on the wires.

Modelling a process image

The next program keeps an input image and an output image as byte arrays. A device writes a snapshot of its inputs at the start of the "scan"; the program logic reads the image and fills the outputs; at the end the outputs are sent to the device. It is a stand-in for the mechanism.

C C stand-in: a PLC process image and I/O mapping

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with scanf or fgets), it gets the next line from this box.

The program only touches inputs and outputs. In a real PLC the I/O map (here the two enums) is created in the hardware configuration, and symbolic names like Motor replace addresses such as %Q0.0.

Packing and unpacking data

Besides single bits, devices exchange words and floats. Cyclic telegrams often pack mixed data into a byte array, so you must agree on offsets and byte order. PROFINET and EtherNet/IP both send multi-byte values with a defined order (Siemens uses big-endian; CIP uses little-endian), which is why a gateway sometimes needs to swap bytes.

C C stand-in: packing a mixed telegram, big-endian and little-endian

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with scanf or fgets), it gets the next line from this box.

Reading a big-endian field with the little-endian routine gives a completely different number. Always check a device's data sheet and test with a known value.

Practical guidance

  • Use managed industrial switches. They provide VLANs, prioritization, diagnostics and redundancy protocols.
  • Segment the network. Keep control traffic apart from office traffic and restrict access.
  • Document the map. Keep a table of device names, IPs and I/O addresses; it saves hours during commissioning and repair.
  • Plan redundancy. Rings with MRP (PROFINET) or DLR (EtherNet/IP) survive a single cable break.
  • Mind update times. Set the cycle to what the process needs, not the fastest possible; more traffic means more load on devices and network.
  • Diagnose with the tools. Device LEDs, the controller's diagnostic buffer and a network scan reveal most issues; see troubleshooting.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What is the PLC's process image?

    Inputs are copied into the image at the start of a scan and outputs are written from it at the end, so the logic sees consistent values.
  2. 2. In PROFINET, what is the PLC's role called?

    The controller exchanges cyclic data with IO devices; the supervisor is an engineering tool.
  3. 3. A 16-bit speed value arrives as bytes 05 C8 but your program reads it as 51205. What is the likely issue?

    05C8 is 1480 as big-endian; reading it little-endian swaps the bytes and gives 0xC805 = 51205.
  4. 4. Why give PROFINET devices unique names?

    A device name lets the controller find and configure the right device even after a hardware swap.

Summary

  • PROFINET, EtherNet/IP and EtherCAT adapt Ethernet for deterministic control traffic.
  • A controller (scanner) exchanges cyclic input and output data with devices (adapters).
  • The process image gives each scan a consistent view of the I/O; an I/O map names the bits and words.
  • Byte order and offsets must match between devices; document the map and use managed switches.
  • The C programs are stand-ins that model the process image and data packing.

Next: PLC Safety Fundamentals