PROFINET Connector
Overview
Section titled “Overview”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 devicesProfinetWriter- Writes record data to PROFINET IO devices
Features
Section titled “Features”- ✅ 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
Basic Configuration
Section titled “Basic Configuration”PROFINET Reader
Section titled “PROFINET Reader”{ "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 } ]}PROFINET Writer
Section titled “PROFINET Writer”{ "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 } ]}Configuration Parameters
Section titled “Configuration Parameters”Endpoint
Section titled “Endpoint”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.
Polling Rate
Section titled “Polling Rate”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.
Timeout
Section titled “Timeout”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
Variables
Section titled “Variables”Each variable describes one record address and its on-the-wire encoding.
Variable Structure
Section titled “Variable Structure”{ "key": "temperature", "slot": 1, "subslot": 1, "index": 100, "dataType": "Float32", "length": 4}| Field | Type | Required | Description |
|---|---|---|---|
key | string | Yes | Meddle payload key |
slot | uint16 | Yes | PROFINET slot number |
subslot | uint16 | Yes | PROFINET subslot number |
index | uint16 | Yes | Record index |
dataType | string | Yes | Encoding (see below) |
length | uint16 | Yes | Number of bytes to read/write |
Slot / Subslot / Index Addressing
Section titled “Slot / Subslot / Index Addressing”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.
Data Types
Section titled “Data Types”The connector decodes record bytes using big-endian byte order (PROFINET convention):
{ "dataType": "Bool", "length": 1 }1 byte; 0x00 → false, anything else → true.
{ "dataType": "Int8", "length": 1 }{ "dataType": "UInt8", "length": 1 }{ "dataType": "Int16", "length": 2 }{ "dataType": "UInt16", "length": 2 }{ "dataType": "Int32", "length": 4 }{ "dataType": "UInt32", "length": 4 }All multi-byte integers are big-endian.
{ "dataType": "Float32", "length": 4 }{ "dataType": "Float64", "length": 8 }IEEE 754 floating point, big-endian.
{ "dataType": "OctetString", "length": 32 }Raw bytes interpreted as a UTF-8 string. The length controls the maximum bytes read; the device’s actual response length governs how many are returned.
Supported types:
| Type | Bytes | Go output type |
|---|---|---|
Bool | 1 | bool |
Int8 | 1 | int8 |
UInt8 | 1 | uint8 |
Int16 | 2 | int16 |
UInt16 | 2 | uint16 |
Int32 | 4 | int32 |
UInt32 | 4 | uint32 |
Float32 | 4 | float32 |
Float64 | 8 | float64 |
OctetString | variable | string |
Data Flow
Section titled “Data Flow”Reader Data Flow
Section titled “Reader Data Flow”PROFINET Device → ProfinetReader (RPC ReadRecord) → decoded values → Meddle PayloadExample:
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}Writer Data Flow
Section titled “Writer Data Flow”Meddle Payload → ProfinetWriter (encode + RPC WriteRecord) → PROFINET DeviceExample:
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.
Common Use Cases
Section titled “Common Use Cases”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 } ]}2. Sending Setpoints to a Drive
Section titled “2. Sending Setpoints to a Drive”{ "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 } ]}3. Reading from Multiple Submodules
Section titled “3. Reading from Multiple Submodules”{ "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 } ]}Troubleshooting
Section titled “Troubleshooting”ErrProfinetConnect at Startup
Section titled “ErrProfinetConnect at Startup”Problem: Cannot establish an Application Relation (AR) with the device
Solutions:
- Verify the device IP and port:
ping 192.168.0.50andnc -zv -u 192.168.0.50 34964 - Confirm the device’s PROFINET stack is running and not in fault state
- Check that the device is not already in an AR with another controller (PROFINET devices typically allow a limited number of concurrent ARs)
- 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:
- Verify the slot/subslot/index against the device’s GSDML file
- Check the configured
lengthmatches the actual record size on the device - Some indexes are write-only or protected — consult the device documentation
insufficient data for <type>
Section titled “insufficient data for <type>”Problem: Device returned fewer bytes than the data type requires
Solutions:
- Increase
lengthfor the variable to match the device’s response size - For OctetString,
lengthis a maximum; for fixed-width types it must equal the type’s byte count - Some devices pad responses — ensure
lengthis at least the minimum required (e.g. 4 for Float32)
Connection Lost Mid-Read
Section titled “Connection Lost Mid-Read”Problem: ErrProfinetDisconnected errors appear after a period of normal operation
Solutions:
- The connector automatically reconnects on the next poll cycle — expect a brief gap and resume
- If disconnections are frequent, check the PROFINET network for cable issues, switch overload, or duplicate IP addresses
- Increase
timeoutfor high-latency networks
Wrong Values for Multi-Byte Types
Section titled “Wrong Values for Multi-Byte Types”Problem: Int32/Float values are obviously wrong (huge magnitudes, NaN, wrong sign)
Solutions:
- 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) - Confirm the data type matches the GSDML declaration
Best Practices
Section titled “Best Practices”1. Always Consult the GSDML
Section titled “1. Always Consult the GSDML”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
3. Be Conservative with Polling Rates
Section titled “3. Be Conservative with Polling Rates”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.
5. Encode Writes Defensively
Section titled “5. Encode Writes Defensively”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.
Example Workflows
Section titled “Example Workflows”PROFINET Drive Monitoring Pipeline
Section titled “PROFINET Drive Monitoring Pipeline”ProfinetReader → Validation → Reshape → Predictive → InfluxDb2Writer └→ Isa182 → Alert- ProfinetReader: Reads
temperature,current,vibrationfrom a drive at 1Hz - Validation: Ensures all signals are present and numeric
- Reshape: Tags with
asset_id,line,area - Predictive: Computes trends and RUL for
temperatureandvibration - InfluxDb2Writer: Long-term storage
- Isa182: Triggers alarm on degrading health score
- Alert: Notifies maintenance
Closed-Loop PROFINET Setpoint Control
Section titled “Closed-Loop PROFINET Setpoint Control”ScriptReader (control logic) → ProfinetWriterProfinetReader → 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.
Related Connectors
Section titled “Related Connectors”- 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
Additional Resources
Section titled “Additional Resources”- PROFINET Specification (PI)
- IEC 61158 - PROFINET protocol standard
- GSDML Specification - General Station Description Markup Language
- Wireshark PROFINET Dissector