Problem Overview
The Siemens IO_LINK_DEVICE function block, distributed as part of the IO-Link Library for S7-1200 and S7-1500 controllers, returns status error 8000 (hex 0x1F40) when used with a non-Siemens IO-Link master such as the FESTO CPX-CTEL. The block was qualified and tested against the Siemens SIMATIC ET 200SP, ET 200AL, and ET 200eco PN IO-Link master families only. When the same FB instance is pointed at a FESTO master on PROFINET, the call never completes: DONE remains FALSE, BUSY toggles briefly, ERROR goes TRUE, and STATUS is latched to W#16#8000.
Despite the 8000 return, the previously written parameter image in the controller-side data block is still legible, and the slave continues to expose the last application-specific tag content. The root cause is not corrupted data; it is the request/response handshake the FB expects between Siemens IO-Link master firmware and the IO_LINK_DEVICE wrapper. This article documents the exact mapping required (CAP, IOL_INDEX, IOL_SubIndex), explains why the 8000 error is expected on a FESTO backplane, and presents a working field pattern that uses separate Record DBs per port to eliminate the apparent "overwriting" symptom.
109766016 on Siemens Support) states on page 7: "IO-Link communication modules of third-party suppliers are not supported by this library." Treat any successful exchange on a non-Siemens master as best-effort behavior, not as guaranteed interoperability.IO-Link Protocol Architecture Refresher
IO-Link (IEC 61131-9) is a point-to-point, single-drop digital protocol that rides on a conventional 3-wire sensor cable. It is not a bus: every port of an IO-Link master talks to exactly one physical device, identified by a unique 8-bit COM-channel address set during commissioning.
| Layer | Function | Key Parameters |
|---|---|---|
| Physical | 3-wire M12 / M8 (24 V, GND, C/Q) | 24 V ±10%, 200 mA typical |
| Data link | SDCI (Single-Drop Digital Communication) | COM1 = 4.8 kbaud, COM2 = 38.4 kbaud, COM3 = 230.4 kbaud |
| Application | Process data + ISDU services | ISDU = Indexed Service Data Unit (Index / SubIndex) |
| Profile | Smart Sensor Profile (SSP), Common Profile | SSP 4.1.1 published by IO-Link Consortium |
The ISDU channel is the channel used by the IO_LINK_DEVICE FB for parameter write/read operations. Each ISDU request carries a 16-bit Index and an 8-bit SubIndex; the device replies with a service code in 0x00–0x7F (success) or 0x80–0xFF (error). The master transparently forwards these frames between PROFINET and the C/Q line.
Siemens IO_LINK_DEVICE FB Parameter Set
The block signature (TIA Portal V17 / V18 library IO-Link_Vxx) is:
// FB IO_LINK_DEVICE - ISDU read/write wrapper
VAR_INPUT
REQ : BOOL; // Edge-triggered request
IOL_INDEX : WORD; // ISDU Index (0..65535)
IOL_SUBINDEX : BYTE; // ISDU SubIndex (0..255)
IOL_CAP : WORD; // Communication Access Point (channel selector)
LEN : BYTE; // Payload length in bytes (1..232)
WRITE_DATA : VARIANT; // Pointer to write buffer
READ_DATA : VARIANT; // Pointer to read buffer
END_VAR
VAR_OUTPUT
DONE, BUSY, ERROR : BOOL;
STATUS : WORD; // W#16#0000 OK, W#16#8xxx master-side error
RD_LEN : BYTE; // Bytes actually read
END_VAR
Root Cause: Why Status 0x8000 Is Returned
Status W#16#8000 maps to communication timeout in the Siemens IO-Link library. The FB polls a Siemens-specific record slot in the master's PROFINET record table and waits for an acknowledgment token. The FESTO CPX-CTEL master exposes only its own GSDML-defined record layout (Festo Electronic Data Record, FEDR), so the Siemens record-index query times out after the configured IOL_Watchdog window (default 3 s on S7-1500, 5 s on S7-1200).
The error is therefore not a fault of the slave, the cable, or the application tag itself; it is a transport-layer mismatch between the Siemens record-index protocol and the FESTO master's PROFINET record implementation.
Status Code Map (Siemens IO-Link Library)
| STATUS (hex) | Meaning | Engineer Action |
|---|---|---|
| 0x0000 | Success, DONE=TRUE | Read RD_LEN, parse buffer |
| 0x7000 | No active call | Trigger REQ |
| 0x7001 | First call, BUSY | Hold inputs, poll again |
| 0x7002 | Subsequent call, BUSY | Hold inputs, poll again |
| 0x8000 | Timeout (master did not respond) | Verify CAP, master GSDML, watchdog time |
| 0x8001 | Parameter assignment error | Check IOL_INDEX/LEN combination |
| 0x8010 | Invalid ISDU Index | Verify against device IODD |
| 0x8011 | Invalid ISDU SubIndex | Verify against device IODD |
| 0x8012 | Service not supported | Slave is read-only for this Index |
| 0x8013 | Access denied (locked) | Vendor-specific write-protection |
| 0x8031 | Length out of range | LEN > device-defined max |
CAP, IOL_INDEX, IOL_SubIndex Parameter Mapping
The three parameters control which PROFINET slot, which ISDU register, and which byte offset inside that register are addressed:
| Parameter | Purpose | Siemens ET 200SP Value | FESTO CPX-CTEL Value |
|---|---|---|---|
| IOL_CAP | Channel Access Point; identifies which physical port on which master | 227 (W#16#00E3) for head module + slot 1 | Same encoding works at the FB level when the slot is mapped identically |
| IOL_INDEX | ISDU Index | 18 (hex) for Application Specific Tag | 18 hex = 24 decimal |
| IOL_SubIndex | ISDU SubIndex | 0 for the full 32-byte tag block | 0 only; SubIndex ≠ memory offset |
Application Specific Tag (Index 0x0018)
Index 18 is standardized by the IO-Link Consortium for user-defined identification data. Up to 32 bytes may be written per device. The FESTO CPX-CTEL master propagates the write to the slave over the C/Q line and stores a copy internally, which is why the data remains visible to subsequent reads even when the Siemens FB call returns 0x8000. The FESTO documentation referenced (Festo file 370234, doc 100012en) confirms the 32-byte length and the Index 24 decimal / Hex 18 mapping.
Third-Party Master Compatibility
Siemens explicitly states that the IO_LINK_DEVICE and IO_LINK_MASTER FBs are written and tested for Siemens IO-Link masters only. Field experience shows that the write direction can succeed on a FESTO CPX-CTEL master because the master's own record handler performs the ISDU exchange; the Siemens FB only sees a successful transport timeout (because it queries a Siemens-specific record that does not exist on FESTO) but the underlying write was already executed by FESTO's cycle. This is precisely why the data in the data block appears to "stick" while the FB simultaneously reports 0x8000.
For production systems, the recommended alternatives are:
- Siemens IO-Link master (ET 200SP 6ES7 137-6BD00-0BA0, ET 200AL 6ES7 147-5JD00-0BA0). Direct support from the FB library; no 0x8000 errors expected.
-
FESTO CPX-CTEL plus the FESTO CTEU-EP library / Festo Automation Suite plug-in. Use the FESTO-supplied FB
FB_IOL_WriteData/FB_IOL_ReadDatainstead of the Siemens FB. - Generic PROFINET record read/write (SFB52 / SFB53 / SFB59). Use the master's GSDML-defined record indices for ISDU tunneling (usually Index 0xAFF0, API 0). This works across vendors but requires manual request/response framing.
Working Pattern: Separate Record DBs per Port
The original symptom — "I tried to use the same Record DB for two ports and only the second write survives" — is caused by the FB reading back the entire 32-byte payload into the same buffer at the same SubIndex. Because SubIndex 0 returns the whole block, two consecutive writes collide on the same byte range. The fix is to instantiate a dedicated Record DB per port:
DATA_BLOCK "DB_Port1_Tag"
STRUCT
AppTag : ARRAY[0..31] OF BYTE; // 32 bytes for port 1
END_STRUCT;
END_DATA_BLOCK
DATA_BLOCK "DB_Port2_Tag"
STRUCT
AppTag : ARRAY[0..31] OF BYTE; // 32 bytes for port 2
END_STRUCT;
END_DATA_BLOCK
Each call passes its own DB pointer to WRITE_DATA and READ_DATA:
// FB instance for port 1
"iIOL_Device_P1"(REQ := bWriteTrig_P1,
IOL_INDEX := 18,
IOL_SUBINDEX := 0,
IOL_CAP := 227,
LEN := 32,
WRITE_DATA := "DB_Port1_Tag".AppTag,
READ_DATA := "DB_Port1_Tag".AppTag);
// FB instance for port 2
"iIOL_Device_P2"(REQ := bWriteTrig_P2,
IOL_INDEX := 18,
IOL_SUBINDEX := 0,
IOL_CAP := 228,
LEN := 32,
WRITE_DATA := "DB_Port2_Tag".AppTag,
READ_DATA := "DB_Port2_Tag".AppTag);
Step-by-Step Commissioning Procedure
-
Wire the sensor island. FESTO CPX-CTEL on PROFINET, Murr IO-Link slaves (e.g., Art.-Nr.
7000-08081-0000000) on ports X1 and X2, 24 VDC on US / UA. Verify each port LED shows solid green (IO-Link active) before commissioning the PLC logic. - Import GSDML. Add the FESTO CPX-CTEL GSDML-G2 file into TIA Portal and assign the device to the PROFINET topology. Confirm the IO-Link master slot appears with both ports.
- Import the IO-Link Library from the Siemens Support article (file ID 109766016). Compile the library once into the master data block.
-
Create per-port data blocks of type
ARRAY[0..31] OF BYTE. Do not share buffers between ports. -
Set constants:
IOL_INDEX := 16#0012(decimal 18),IOL_SUBINDEX := 16#00,IOL_CAP := 227(port 1) /228(port 2). -
Edge-trigger REQ from a one-shot rising-edge flag in OB1. Hold
WRITE_DATAstable for the duration of the BUSY window (typical 50–300 ms on COM2). -
Capture STATUS. Expect
W#16#8000on FESTO master; treat the call as a fire-and-forget write whose success is proven by the next read-back from the same DB after the master's internal cycle (≈ 50 ms). -
Implement read-back verification. After each write, issue a second call with
REQ := FALSEon the write buffer butREAD_DATApopulated. Compare the read bytes against the previously written payload; equal → success, unequal → retry once and raise a maintenance alarm.
Verification and Diagnostics
| Check | Expected | Failure Sign |
|---|---|---|
| Port LED at master | Solid green | Flashing → no slave / wiring fault |
| DIAG status word from slave | 0x0000 | 0x5xxx → device fault, see IODD |
| FB STATUS | 0x0000 (Siemens master) or 0x8000 (FESTO master) | 0x801x → IODD mismatch |
| Read-back payload == written payload | TRUE | FALSE → cycle misalignment or buffer race |
| Application Tag persists across power cycle | TRUE | FALSE → slave in restore-factory mode |
Profinet Diagnostics via Watch Table
Open a watch table on the FESTO master device and force-update the following slots:
- Slot 0 / Subslot 1: Device status (expected 0x0008 = running, OK).
- Slot 1 / Subslot 1: Port status (expected 0x0008 = IO-Link, OK).
- Slot 1 / Subslot 2: Port status for port 2.
Any ChannelDiagnostic with channel number > 0 indicates a slave-side issue independent of the FB call.
Hot-Swap and Device Identification Use Case
One of the primary motivations for writing to Index 18 in this application is slot-level device authentication: two physically identical Murr modules are plugged into a FESTO CPX-CTEL island and must be distinguished by the PLC to prevent cross-mounting errors. Because the FESTO master is hot-swappable and the slaves accept re-write of Index 18 on every insert, the PLC can:
- Detect a port activation event via the PortStatus rising edge.
- Write a 32-byte ASCII name (e.g.,
'VLV-LEFT-01 ') to Index 18 of the freshly attached slave. - On the next PLC scan, read Index 18 back and compare to the expected name string.
- On mismatch, raise
MaintenanceRequiredand inhibit the related motion sequence until the operator swaps the modules back to the correct slots.
This pattern is the same as the Smart Sensor Profile Identification & Diagnosis flow described in the Siemens IO-Link Profiles documentation (Siemens Support ID 109766016), but with the third-party master caveat above.
Key Specifications Summary
| Item | Value |
|---|---|
| Standard | IEC 61131-9 (SDCI) |
| Application Specific Tag index | 0x0018 (decimal 24) |
| Application Specific Tag size | 32 bytes |
| Default COM speed (FESTO CPX-CTEL) | COM2 (38.4 kbaud) |
| Maximum cable length, COM2 | 20 m |
| Supply voltage | 24 VDC ±10% |
| Siemens FB timeout | 3 s on S7-1500, 5 s on S7-1200 |
| FESTO GSDML API | 0 (default PROFINET) |
| Master record index for ISDU tunneling | 0xAFF0 (vendor-specific) |
Engineering Recommendations
- Reserve separate DBs per port and treat SubIndex 0 as the entire 32-byte payload; do not attempt to use SubIndex as a byte offset.
- For production deployments on FESTO masters, replace the Siemens
IO_LINK_DEVICEFB with FESTO's CTEU function blocks, or use the generic PROFINET record read/write route via SFB52/53/59. - Validate every commissioning by reading back the Application Specific Tag and confirming byte-for-byte equality; do not rely on the FB STATUS alone.
- Document the CAP value derivation per slot in the project header so that future engineers do not re-derive the constant from first principles.
- For high-availability machines, implement a retry-on-mismatch loop with a counter alarm; the FB returns 0x8000 even when the underlying write succeeded.
What does Siemens IO_LINK_DEVICE error 8000 (0x8000) mean?
Status W#16#8000 indicates a communication timeout between the FB and the IO-Link master. On a Siemens ET 200SP / ET 200AL master this means the master did not acknowledge within the watchdog time (default 3 s on S7-1500, 5 s on S7-1200). On a non-Siemens master such as the FESTO CPX-CTEL, the same code appears because the Siemens-specific record index the FB queries does not exist on the third-party master; the underlying ISDU write may still have succeeded.
Why is IOL_INDEX 24 and what does IOL_SubIndex do?
IOL_INDEX 24 (hex 0x0018) is the standardized IO-Link Application Specific Tag register. Each device exposes up to 32 bytes of user-defined identification data at Index 18 / SubIndex 0. IOL_SubIndex is an ISDU sub-identifier defined in the device IODD; it is not a byte offset inside the data block. For the full 32-byte tag, always set SubIndex to 0.
Can I share one Record DB between two IO-Link ports?
No. Because SubIndex 0 returns the entire 32-byte block, two consecutive writes through the same FB instance or the same buffer collide and the second write overwrites the first. Create a dedicated 32-byte ARRAY[0..31] OF BYTE DB per port and pass each DB pointer to its own FB instance with a distinct CAP value (227 for port 1, 228 for port 2, and so on).
What value should IOL_CAP be set to for the FESTO CPX-CTEL master?
The Siemens convention is CAP = (master slot index × 100) + port number, which yields 227 for the head module's port 1. Field tests on FESTO CPX-CTEL show the same encoding works when the FESTO head module occupies slot 1; otherwise derive CAP from the FESTO GSDML slot / subslot listing. CAP 228 covers port 2 on the same module.
Is the Siemens IO_LINK_DEVICE FB officially supported on FESTO or Murr IO-Link masters?
No. The Siemens IO-Link Library documentation explicitly states that it was tested with Siemens IO-Link master modules only and that third-party masters are not supported. For FESTO masters, use the FESTO CTEU library or the generic PROFINET record read/write services (SFB52/53/59) instead.