Skip to content

PROFINET Connector

The PROFINET connector enables communication with PROFINET IO devices using slot/subslot/index addressing as defined by IEC 61158. It speaks the PROFINET DCE-RPC protocol over UDP, establishing an Application Relation (AR) with the target device and exchanging record-data reads and writes.

Connector Types:

  • ProfinetReader - Polls record data from PROFINET IO devices
  • ProfinetWriter - Writes record data to PROFINET IO devices
  • ✅ PROFINET IO record data read/write via slot/subslot/index addressing
  • ✅ DCE-RPC over UDP transport
  • ✅ Application Relation (AR) management with automatic reconnection
  • ✅ Big-endian binary decoding for all primitive types
  • ✅ Wide data type support: Bool, Int8/16/32, UInt8/16/32, Float32/64, OctetString
  • ✅ Configurable polling rate and per-call timeout
{
"type": "ProfinetReader",
"config": {
"endpoint": "192.168.0.50:34964",
"pollingRate": 1000,
"timeout": 5000
},
"variables": [
{
"key": "temperature",
"slot": 1,
"subslot": 1,
"index": 100,
"dataType": "Float32",
"length": 4
},
{
"key": "running_state",
"slot": 1,
"subslot": 1,
"index": 101,
"dataType": "Bool",
"length": 1
}
]
}
{
"type": "ProfinetWriter",
"config": {
"endpoint": "192.168.0.50:34964",
"timeout": 5000
},
"variables": [
{
"key": "setpoint",
"slot": 1,
"subslot": 1,
"index": 200,
"dataType": "Float32",
"length": 4
},
{
"key": "enable_output",
"slot": 1,
"subslot": 1,
"index": 201,
"dataType": "Bool",
"length": 1
}
]
}

The IP address and PROFINET DCE-RPC port of the target device.

{ "endpoint": "192.168.0.50:34964" }

Format: host:port. The default PROFINET DCE-RPC port is 34964. Some devices listen on alternate ports — consult the device GSD file.

Required for the reader. The interval in milliseconds between successive reads.

{ "pollingRate": 1000 }

Recommended values:

  • Fast diagnostic data: 100-500ms
  • Process variables: 500-2000ms
  • Slow telemetry: 5000ms+

PROFINET IO devices are generally tolerant of high polling rates, but the LAN and the device’s response budget are real limits.

Optional. Per-call RPC timeout in milliseconds. Default is implementation-defined.

{ "timeout": 5000 }

Recommended values:

  • Local-LAN devices: 1000-3000ms
  • Devices behind a NAT or relay: 5000-10000ms

Each variable describes one record address and its on-the-wire encoding.

{
"key": "temperature",
"slot": 1,
"subslot": 1,
"index": 100,
"dataType": "Float32",
"length": 4
}
FieldTypeRequiredDescription
keystringYesMeddle payload key
slotuint16YesPROFINET slot number
subslotuint16YesPROFINET subslot number
indexuint16YesRecord index
dataTypestringYesEncoding (see below)
lengthuint16YesNumber of bytes to read/write

PROFINET IO devices model their I/O as a hierarchy:

  • Slot: A logical “card” inside the device. Slot 0 is reserved for the device itself (DAP)
  • Subslot: A submodule within the slot. Subslot 1 is typically the primary I/O
  • Index: A specific record on that submodule, defined in the device’s GSDML file

Refer to the GSDML (General Station Description Markup Language) file shipped with the device for the addressing map.

The connector decodes record bytes using big-endian byte order (PROFINET convention):

{ "dataType": "Bool", "length": 1 }

1 byte; 0x00false, anything else → true.

Supported types:

TypeBytesGo output type
Bool1bool
Int81int8
UInt81uint8
Int162int16
UInt162uint16
Int324int32
UInt324uint32
Float324float32
Float648float64
OctetStringvariablestring
PROFINET Device → ProfinetReader (RPC ReadRecord) → decoded values → Meddle Payload

Example:

Reader configuration:

{
"variables": [
{ "key": "temperature", "slot": 1, "subslot": 1, "index": 100, "dataType": "Float32", "length": 4 },
{ "key": "running", "slot": 1, "subslot": 1, "index": 101, "dataType": "Bool", "length": 1 }
]
}

Output payload:

{
"temperature": 24.7,
"running": true
}
Meddle Payload → ProfinetWriter (encode + RPC WriteRecord) → PROFINET Device

Example:

Input payload:

{
"setpoint": 75.0,
"enable_output": true
}

Each key matching a configured variable.key is encoded according to its dataType and written via WriteRecord. Keys not in the variables list are ignored.

1. Reading Diagnostic Data from a PROFINET IO Module

Section titled “1. Reading Diagnostic Data from a PROFINET IO Module”
{
"type": "ProfinetReader",
"config": {
"endpoint": "192.168.0.50:34964",
"pollingRate": 2000,
"timeout": 5000
},
"variables": [
{ "key": "module_status", "slot": 1, "subslot": 1, "index": 1000, "dataType": "UInt16", "length": 2 },
{ "key": "temperature_c", "slot": 1, "subslot": 1, "index": 1001, "dataType": "Float32", "length": 4 },
{ "key": "uptime_seconds", "slot": 0, "subslot": 1, "index": 2000, "dataType": "UInt32", "length": 4 },
{ "key": "device_name", "slot": 0, "subslot": 1, "index": 3000, "dataType": "OctetString", "length": 64 }
]
}
{
"type": "ProfinetWriter",
"config": {
"endpoint": "192.168.0.60:34964",
"timeout": 3000
},
"variables": [
{ "key": "speed_rpm", "slot": 1, "subslot": 1, "index": 100, "dataType": "Int32", "length": 4 },
{ "key": "torque_limit", "slot": 1, "subslot": 1, "index": 101, "dataType": "Float32", "length": 4 },
{ "key": "enable", "slot": 1, "subslot": 1, "index": 102, "dataType": "Bool", "length": 1 }
]
}
{
"type": "ProfinetReader",
"config": {
"endpoint": "192.168.0.50:34964",
"pollingRate": 1000,
"timeout": 5000
},
"variables": [
{ "key": "input_card_1_value", "slot": 1, "subslot": 1, "index": 100, "dataType": "Int16", "length": 2 },
{ "key": "input_card_2_value", "slot": 2, "subslot": 1, "index": 100, "dataType": "Int16", "length": 2 },
{ "key": "input_card_3_value", "slot": 3, "subslot": 1, "index": 100, "dataType": "Int16", "length": 2 },
{ "key": "device_temp", "slot": 0, "subslot": 1, "index": 200, "dataType": "Float32", "length": 4 }
]
}

Problem: Cannot establish an Application Relation (AR) with the device

Solutions:

  1. Verify the device IP and port: ping 192.168.0.50 and nc -zv -u 192.168.0.50 34964
  2. Confirm the device’s PROFINET stack is running and not in fault state
  3. Check that the device is not already in an AR with another controller (PROFINET devices typically allow a limited number of concurrent ARs)
  4. Use a tool like Wireshark with the PROFINET dissector to inspect the connect handshake

ErrProfinetReadFailed on a Specific Variable

Section titled “ErrProfinetReadFailed on a Specific Variable”

Problem: One variable returns an error while others succeed

Solutions:

  1. Verify the slot/subslot/index against the device’s GSDML file
  2. Check the configured length matches the actual record size on the device
  3. Some indexes are write-only or protected — consult the device documentation

Problem: Device returned fewer bytes than the data type requires

Solutions:

  1. Increase length for the variable to match the device’s response size
  2. For OctetString, length is a maximum; for fixed-width types it must equal the type’s byte count
  3. Some devices pad responses — ensure length is at least the minimum required (e.g. 4 for Float32)

Problem: ErrProfinetDisconnected errors appear after a period of normal operation

Solutions:

  1. The connector automatically reconnects on the next poll cycle — expect a brief gap and resume
  2. If disconnections are frequent, check the PROFINET network for cable issues, switch overload, or duplicate IP addresses
  3. Increase timeout for high-latency networks

Problem: Int32/Float values are obviously wrong (huge magnitudes, NaN, wrong sign)

Solutions:

  1. PROFINET wire format is always big-endian. There is no byte-order toggle. If your device documentation claims little-endian, check whether it’s a vendor-specific record (vendor records may use other encodings — decode externally with a Transform)
  2. Confirm the data type matches the GSDML declaration

Slot, subslot, and index assignments are device-specific. The GSDML is the canonical source — don’t infer addressing.

2. Use Slot 0 / Subslot 1 for Device-Level Records

Section titled “2. Use Slot 0 / Subslot 1 for Device-Level Records”

Conventionally:

  • Slot 0 = DAP (Device Access Point) — device identity, diagnostics, system records
  • Slot N, Subslot 1 = primary I/O of the Nth I/O submodule

PROFINET IO devices process record data via the application layer, not the cyclic I/O channel — so polling too aggressively can starve the cyclic path. 500-2000ms is typical for record polling.

4. Handle Reconnects Gracefully Downstream

Section titled “4. Handle Reconnects Gracefully Downstream”

Use a Filter or Validation connector after the reader to gate further processing during reconnection windows.

When publishing setpoints, pre-clamp values upstream with a Transform or Reshape so out-of-range data never reaches the writer. PROFINET devices may reject (or worse, accept) extreme values inconsistently.

ProfinetReader → Validation → Reshape → Predictive → InfluxDb2Writer
└→ Isa182 → Alert
  1. ProfinetReader: Reads temperature, current, vibration from a drive at 1Hz
  2. Validation: Ensures all signals are present and numeric
  3. Reshape: Tags with asset_id, line, area
  4. Predictive: Computes trends and RUL for temperature and vibration
  5. InfluxDb2Writer: Long-term storage
  6. Isa182: Triggers alarm on degrading health score
  7. Alert: Notifies maintenance
ScriptReader (control logic) → ProfinetWriter
ProfinetReader → ScriptReader (feedback loop)

A Script connector reads PROFINET inputs, computes a control output, and writes it back via the PROFINET writer — a classic supervisory loop.

  • Modbus - Alternative industrial fieldbus
  • Siemens S7 - Direct S7 protocol for Siemens PLCs
  • OPC UA - Modern abstraction over PROFINET/S7 data
  • Validation - Gate downstream during reconnects
  • Predictive - Predictive analytics on PROFINET signals