Overview
Siemens TIA Portal auto-generates system constants (HW identifiers such as HW_IO, HW_Interface, HW_Device, HW_SubModule, HW_Any, and OB_ANY) when a device configuration is compiled for an S7-1200 or S7-1500 station. Those constants give the standard user program a symbolic handle to every I/O channel, PROFINET interface, and module in the device view. In a safety program (F-program) running on an F-CPU such as CPU 1516F-3 PN/DP, CPU 1515F-2 PN, or one of the S7-1200 FC variants, those same system constants are not visible in the F-symbol table. The safety compiler rejects any reference to a standard PLC tag type from inside an F-runtime group, and it does so for architectural reasons rooted in EN ISO 13849-1 and IEC 61508, not for IDE convenience. The approved way to read the equivalent process and diagnostic information from the F-program is the F-I/O DB, the RTGx_SysInfo block, and the F-shared DB (F_GLOBDB) generated by the TIA Portal Safety compiler. This reference explains the architectural reason for the restriction, the approved data sources, the step-by-step procedure to read channel and diagnostic data in F-LAD or F-FBD, and the acceptance test required before the modified safety program may be commissioned in a SIL 3 / PL e installation.
System Constants in TIA Portal: Definition and Scope
When the TIA Portal hardware catalog is compiled against an S7-1500 or S7-1200 station, the project editor produces a set of system constants for every configurable object in the device view. They are visible in the PLC tag table under the System Constants tab and appear as named identifiers of data type HW_IO, HW_Interface, HW_Device, HW_SubModule, HW_Any, or OB_ANY. Typical use cases inside the standard program include:
- Calling
RDREC/WRRECwith a hardware identifier passed to theHARDWAREinput. - Evaluating
IOXS_FAULTfrom the PROFINET diagnostics blocks. - Performing module-level passivation with
DPSAon PROFINET IO. - Determining which port became disconnected through
PNDPwith record0x802A.
The complete enumeration and the meaning of each identifier are documented in the official Siemens support FAQ ID 78782835 – Meaning of the system constants in STEP 7 (TIA Portal) with S7-1200/S7-1500. That FAQ is the authoritative reference for the standard symbol table.
Safety Program Architecture and the F-Symbol Table
An F-CPU executes two programs in parallel: the standard user program and one or more F-runtime groups. Each F-runtime group contains F-blocks (F-OB, F-FB, F-FC, F-DB) compiled with the F-Compiler, and it runs under a hardware watchdog. The F-Compiler generates a private symbol table for each F-runtime group. Tags in that table are the only identifiers an F-block can legally reference. The runtime group interface is a set of automatically generated data blocks that form the only data exchange point between the standard program and the safety program.
The data blocks that the safety compiler generates and the rules for accessing them are summarized in the table below.
| Block | Generated by | Visibility | Purpose |
|---|---|---|---|
F_OB (e.g. Main_Safety_RTG1) |
Safety compiler | F-program only | Entry point of the F-runtime group; scheduled by the F-CPU at the configured cycle time. |
| F_GLOBDB | Safety compiler | Standard + F-program | Bidirectional handshake area. Tags defined here are accessible from both sides. |
| RTGx_SysInfo (x = 1..8) | Safety compiler | F-program only | Runtime-group status interface (Mode bits, Restart, Acknowledge, Error, Passivation, etc.). |
| F-I/O DB (one per F-I/O) | Safety compiler | F-program only | Process image, quality flags (QBAD, ACK_REQ), and channel diagnostics for the F-module. |
| F-DB (instance or background) | User | F-program only | User-defined safety DBs; can be instanced by F-FBs only. |
The F-I/O DB is the direct replacement for the HW_IO system constant in a safety context. It exposes the same channel and diagnostic information that the standard program would read from a standard DI/DO module, but it does so through an F-certified data interface that the F-Compiler can statically verify.
Why HW_IO Constants Are Rejected in F-Programs
The F-Compiler enforces a closed-world rule: every input of an F-block that consumes a process value, every tag used in a safety-relevant comparison, and every channel address referenced by an F-FB must be resolvable to a fixed address at compile time, and it must originate from a safety-aware data source. Standard PLC tags and system constants fail this rule for two reasons.
- Namespace separation. The F-program lives in its own symbol table. System constants are added to the standard symbol table; they are not visible inside the F-symbol table and therefore cannot be referenced from F-LAD, F-FBD, or F-SCL.
-
Diagnostic semantics. Many HW_IO constants are consumed by
RDREC,WRREC, or the standard PROFINET diagnostics blocks. Those blocks are not on the F-certified block list. Reading a PROFINET port status throughPNDPfrom inside an F-runtime group would make the F-CPU a witness to non-safety data without the runtime guarantee that the value is consistent with the safety process image.
The reference manual that lists the allowed and forbidden operations in F-LAD and F-FBD is the S7-1500 / ET 200MP – SIMATIC Safety – Configuring and Programming function manual, available on the Siemens support portal under entry ID 109751824. The Restrictions in the programming languages FBD/LAD section of that manual is the authoritative source for what is and is not permitted inside an F-runtime group.
BOOL from the F-I/O DB Input structure, but the dragged symbol is of type HW_IO. The drop is rejected silently. Open the F-I/O DB and drag the channel bit instead of the system constant.Approved Data Sources for F-Logic
Inside an F-runtime group the engineer is restricted to three classes of data source. The mapping from the standard-program use case to the F-program equivalent is shown below.
| Standard use case | Typical constant used | Approved F-program equivalent |
|---|---|---|
| Read a digital input channel |
%I0.0 or "DI16_1".I0
|
"F-I/O DB".Input[0..7] |
| Evaluate module passivation / quality | Standard QBAD
|
"F-I/O DB".QBAD |
| Acknowledge module fault |
ACK_REQ via ACK instruction |
Set "F-I/O DB".ACK in F-logic; trigger HMI button in standard program |
| Detect PROFINET device failure |
PNDP with HW_Device
|
Use "F-I/O DB".QBAD + "RTGx_SysInfo".Passivation
|
| Handshake a mode bit to standard | Tag in standard DB | Tag in F_GLOBDB (F-shared DB) |
| Detect runtime-group state | (not applicable) |
"RTGx_SysInfo".Mode, .ReadyToRestart, .Ack, .OpGroupAck
|
| Identify which port was disconnected |
PNDP with HW_Interface + record 0x802A
|
Set a corresponding bit in F_GLOBDB from the F-I/O DB; the standard program runs PNDP outside the F-program for HMI detail |
F_GLOBDB: The Safety-Standard Handshake Area
The F-shared DB (F_GLOBDB) is the only DB that the safety compiler allows to be read and written from both worlds. The default name assigned by the Safety administration editor is F_GLOBDB; it can be renamed, but the name must start with F_ to be visible to the safety compiler. Typical user-defined content:
// F_GLOBDB - edited by the user, visible to both worlds
DATA_BLOCK "F_GLOBDB"
{ S7_Optimized_Access := 'TRUE' }
VERSION : 0.1
NON_RETAIN
VAR
// Standard -> F: mode selections
Cmd_StartAck : BOOL; // Operator command from HMI, debounced in standard
Cmd_AutoMode : BOOL; // TRUE = automatic, FALSE = manual
Cmd_Muting1 : BOOL; // Muting pair 1 enable
Cmd_Muting2 : BOOL; // Muting pair 2 enable
// F -> Standard: status to display
Status_SafeStopActive : BOOL; // TRUE while safe stop is enforced
Status_EStopActive : BOOL; // TRUE while E-Stop chain is open
Status_Port1Lost : BOOL; // PROFINET port 1 disconnect
Status_Port2Lost : BOOL; // PROFINET port 2 disconnect
// Word-level aggregate for HMI efficiency
StatusWord : WORD; // B0=EStop, B1=SafeStop, B2=Muting, B3..7=diag
END_VAR
END_DATA_BLOCK
Inside the F-runtime group every write to F_GLOBDB is a candidate for safety review; inside the standard program every read of F_GLOBDB is non-safety and can be displayed, archived, or used for control flow without affecting the safety integrity.
RTGx_SysInfo: Runtime-Group Status Interface
The safety compiler generates one RTGx_SysInfo DB per F-runtime group (x = 1 to 8). The block exposes the runtime group interface defined by the SIMATIC Safety specification. The default TIA Portal V17 / V18 symbol layout for RTG1_SysInfo:
| Tag | Type | Direction | Meaning |
|---|---|---|---|
Mode |
BYTE | In | 0 = deactivated, 1 = active. Drives the F-CPU safety mode register. |
ReadyToRestart |
BOOL | In | Set by the standard program when the process is ready to leave the safe state. |
ResetRequest |
BOOL | Out | F-runtime group requests a reset or restart from the standard program. |
OpGroupAck |
BOOL | Out | Operator-group acknowledgment required (HMI must display prompt). |
Ack |
BOOL | In | Operator acknowledge from HMI to the F-runtime group. |
Passivation |
BOOL | Out | TRUE if at least one F-I/O has been passivated in this cycle. |
Diag |
DWORD | Out | Bit-coded diagnostic summary (bit 0 = group error, bit 1 = passivation, etc.). |
The exact bit assignment of Diag is documented in the SIMATIC Safety – Configuring and Programming function manual; it changes between TIA Portal major versions, so always consult the manual that ships with the installed TIA Portal version (V15.1, V16, V17, V18).
F-I/O DB: Channel and Quality Data
For every F-I/O module placed in the device view (for example an ET 200SP 6ES7136-6BA00-0CA0 F-DI 8x24V HF, or a 6ES7136-6DB00-0CA0 F-DQ 4x24V/2A), the safety compiler generates an F-I/O DB whose default name is the F-I/O's HW identifier followed by _DB. The relevant tags vary by module type, but the common surface is:
// Generated F-I/O DB for a 6ES7136-6BA00-0CA0 (F-DI 8x24V HF)
DATA_BLOCK "F-DI8_1_DB"
{ S7_Optimized_Access := 'TRUE' }
VERSION : 0.1
NON_RETAIN
VAR
Input : ARRAY[0..7] OF BOOL; // Channel process values
QBAD : BOOL; // Quality: 1 = value invalid
ACK_REQ : BOOL; // 1 = user must acknowledge fault
Diag : WORD; // Channel-level diagnostics
PASS_ON : BOOL; // Passivation output state
ACK : BOOL; // Acknowledge from F-program
END_VAR
END_DATA_BLOCK
The Diag WORD bit assignment for the F-DI 8x24V HF module is module-specific. Bits 0 to 7 map to channels 0 to 7; a set bit means "channel fault active" (wire break, short circuit, discrepancy error). Bits 8 to 15 are module-level (sensor supply, internal comms, etc.). Refer to the F-I/O Modules – Device Manual for the specific catalog number, available on the Siemens support portal under the article ID for the module.
Mapping Standard Diagnostics to Safety-Approved Sources
The following table covers the diagnostic values that standard programs typically read from PROFINET or PROFIsafe modules, together with the F-program equivalent.
| Diagnostic value | Standard source (not allowed in F) | F-program source |
|---|---|---|
| Channel value (digital) | PII of the standard DI | "F-I/O DB".Input[ch] |
| Channel value (analog 0..10 V) | PII of the standard AI |
"F-AI_DB".Input (F-AI module required) |
| Channel passivated | Standard module status QBAD
|
"F-I/O DB".QBAD |
| Module needs acknowledgment | Standard status ACK_REQ
|
"F-I/O DB".ACK_REQ |
| PROFINET port disconnected |
PNDP record 0x802A on HW_Interface
|
Set bit in F_GLOBDB from the F-I/O DB Diag field; the standard program reads F_GLOBDB and runs PNDP for HMI detail |
| Module removed under voltage | Diagnostic interrupt (OB82) | Standard program logs OB82; F-program reads "F-I/O DB".QBAD
|
| Group restart required | LED on the CPU |
"RTGx_SysInfo".ResetRequest displayed on HMI |
Step-by-Step: Reading a PROFINET Port Disconnect in F-Logic
The following procedure demonstrates how to read a PROFINET port diagnostic from the F-program without calling PNDP directly. The pattern keeps the F-runtime group F-certified while still giving the HMI the port-level detail that Siemens displays in Online & Diagnostics.
-
Create the F-shared DB. In the Safety administration editor, add an F-shared DB named
F_GLOBDBand declare the bitsStatus_Port1LostandStatus_Port2LostasBOOL. -
Build the F-runtime group. Add an F-OB (for example
Main_Safety_RTG1) and a user F-FB (for exampleFB_SafeDiag) called from the F-OB. Place the F-runtime group on the F-CPU's task list at the cycle time mandated by your safety calculation, typically 5 ms to 50 ms. -
Read module-level diagnostics. Inside
FB_SafeDiag, open the F-I/O DBs in symbolic mode and readQBADandDiag. Use the module's device manual to map the bits to the physical port. -
Map the bit to F_GLOBDB. Assign the result of the bit decoding to
F_GLOBDB.Status_Port1Lost. Wrap the assignment in a direct F-CPU:=operation; do not use any pointer orVARIANTin the F-program. -
Have the standard program call PNDP. In the standard cyclic OB (e.g.
OB1), readF_GLOBDB.Status_Port1Lostand callPNDPwith the originalHW_Interfacesystem constant. The result is forwarded to the HMI; the F-program remains untouched. -
Display on HMI. On a WinCC Unified or WinCC Professional screen, bind an indicator to the standard tag that holds the
PNDPresult. The F-CPU, the safety compiler, and the certificate remain unaffected. -
Run the acceptance test. Disconnect each PROFINET cable in turn; verify that the F-runtime group records the passivation, that the corresponding
Status_PortxLostbit inF_GLOBDBbecomes TRUE within one watchdog cycle, and that the HMI shows the correct port.
Firmware and TIA Portal Version Compatibility
The symbol names, the data types, and the F-Compiler error messages change between major versions. The table below captures the configurations in which the F-shared DB, RTGx_SysInfo, and F-I/O DB are generated in their current form. The article assumes the TIA Portal V17 / V18 conventions unless explicitly noted.
| F-CPU | Catalog number | Min FW | Min TIA Portal | Max F-runtime groups | F-I/O DB generated? |
|---|---|---|---|---|---|
| CPU 1214FC | 6ES7214-1AF40-0XB0 | V4.2 | V14 SP1 | 1 | Yes (simplified tags) |
| CPU 1215FC | 6ES7215-1AF40-0XB0 | V4.2 | V14 SP1 | 1 | Yes |
| CPU 1511F-1 PN | 6ES7511-1FK02-0AB0 | V2.6 | V15.1 | 1 | Yes |
| CPU 1515F-2 PN | 6ES7515-2FM02-0AB0 | V2.6 | V15.1 | 2 | Yes |
| CPU 1516F-3 PN/DP | 6ES7516-3FN02-0AB0 | V2.6 | V15.1 | 4 | Yes |
| CPU 1517F-3 PN/DP | 6ES7517-3FP00-0AB0 | V2.5 | V15 | 6 | Yes |
| CPU 1518F-4 PN/DP | 6ES7518-4FP00-0AB0 | V2.5 | V15 | 8 | Yes |
| ET 200SP CPU 1510SP F-1 PN | 6ES7510-1SJ02-0AB0 | V2.6 | V15.1 | 1 | Yes |
| ET 200SP CPU 1512SP F-1 PN | 6ES7512-1SK02-0AB0 | V2.6 | V15.1 | 2 | Yes |
For S7-1200 F-CPUs, only a single F-runtime group is allowed; the F-shared DB and the F-I/O DB are generated, but RTGx_SysInfo is delivered as RTG1_SysInfo only. Check the device manual of the specific catalog number before depending on a particular tag layout.
Verification, Acceptance Test, and Troubleshooting
A change that touches the F-program, the F-shared DB, or any F-I/O DB requires a partial or full safety acceptance test in accordance with EN ISO 13849-1:2023 (PL e) and IEC 61508 (SIL 3). The minimum verification steps are:
- Compile clean. The Safety editor must report "Safety program generation completed without errors" in the Safety administration log. Any warning about non-safety blocks being referenced must be resolved.
- Compare F-CPU signature. Read the F-CPU's safety signature with Online → Safety → Show F-signature. The value must match the value stored in the project.
- Online & Diagnostics. Open the F-runtime group in online mode. Confirm that the cycle time, the watchdog time, and the passivation count match the design.
-
Force / watch table. Use a watch table on the F-I/O DB to set
QBAD = TRUE(simulate passivation) and verify thatRTGx_SysInfo.Passivationlatches, thatResetRequestis set, and thatF_GLOBDBstatus bits react as designed. - Functional test of E-Stop / safe stop. Trigger every safety input (E-Stop, light curtain, guard door) and confirm the safety output de-energizes within the calculated response time.
- Sign-off. Update the safety validation matrix and have the safety engineer and the machinery integrator sign the change record.
Troubleshooting Matrix
| Symptom | Likely cause | Resolution |
|---|---|---|
| Drag of system constant into F-LAD is rejected | The symbol is of type HW_IO; the F-symbol table has no matching entry |
Drag the corresponding Input[ch] or QBAD from the F-I/O DB instead |
| F-Compiler error: "Tag 'X' is not declared in the F-symbol table" | A standard PLC tag was referenced from an F-block | Move the tag into the F-shared DB (F_GLOBDB) or read it via an F-I/O DB |
| F-Compiler error: "The tag may not be used in a safety-relevant expression" | Standard IEC_TIMER / IEC_Counter / SCL constructs in the F-program |
Replace with the F-certified equivalents; consult the Restrictions in FBD/LAD section of the safety manual |
RTGx_SysInfo is missing from the project tree |
No F-runtime group has been created on the F-CPU | Open the Safety administration editor and add an F-runtime group, then recompile the program |
Status_PortxLost in F_GLOBDB never sets, even though a cable is unplugged |
The F-I/O DB Diag WORD is being read, but the bit-to-port mapping is wrong for the module's manual |
Open the device manual for the catalog number; locate the Diagnostic data record 0x802A mapping and re-decode the bit |
Online value of QBAD shows TRUE on a healthy module |
Module has not finished initialization, or PROFINET name / IP mismatch | Assign the PROFINET device name from the device view; restart the module; re-check with Online & Diagnostics → PROFINET |
Standard program cannot read F_GLOBDB
|
The DB was not created as an F-shared DB, or its name does not start with F_
|
Re-create the DB from the Safety administration editor; the safety compiler renames it on regeneration |
| HMI shows port 2 instead of port 1 after disconnect | The bit assignment in F_GLOBDB.StatusWord was inverted in the standard program |
Add a comment in the F-program and the standard program to lock down the mapping; re-test |
Field-Proven Patterns and Caveats
From a controls-engineering perspective, four patterns appear repeatedly in real installations.
1. The F-shared DB must be the only handshake. Do not write a standard DB from the F-program "because the standard tag table is more convenient." The safety compiler will either reject the write or, worse, accept it under an F-DB and break the symbol-table separation. The only DB that crosses the boundary is the F-shared DB whose name starts with F_.
2. Do not read standard PROFINET diagnostics from the F-program. A PROFINET diagnostic block such as PNDP, DPNRMV, or DPRD_DAT / DPWR_DAT is not on the F-certified block list. The TIA Portal safety compiler will refuse to compile a call to those blocks inside an F-runtime group.
3. Plan the F-I/O DB before you commission the F-I/O. Renaming an F-I/O after first compilation may rename the F-I/O DB. If the F-program references the old name, the next compile will fail. Re-synchronize the project, then re-run the acceptance test.
4. F-programmers do not need PROFINET topology data. The F-CPU exchanges PROFIsafe frames with the F-I/O over PROFINET, but it does so through the F-I/O DB, not through PROFINET system constants. The standard program continues to use the system constants for the topology view; the F-program stays isolated.
Can I use a system constant such as HW_IO inside an F-runtime group?
No. System constants of type HW_IO, HW_Interface, HW_Device, and HW_SubModule are not visible in the F-symbol table. The safety compiler rejects any reference to a system constant from an F-block. Use the F-I/O DB channel tag, the F-shared DB, or the RTGx_SysInfo tags instead.
Where can I read the same diagnostic value inside the F-program that I would normally read with PNDP from the standard program?
Read the Diag WORD and the QBAD bit from the relevant F-I/O DB. If port-level detail is required, decode the bit in F-logic and write a corresponding BOOL into the F-shared DB; the standard program then calls PNDP using the original HW_Interface system constant and forwards the result to the HMI.
Why is the drag-and-drop of a system constant into an F-LAD network silently rejected?
The F-block expects a safety-aware data type, but the system constant is of type HW_IO. The F-symbol table does not contain the symbol, so the drop fails. Open the F-I/O DB and drag the channel bit (e.g. Input[0]) or a tag from the F-shared DB into the network instead.
How many F-runtime groups can an S7-1500 F-CPU host?
CPU 1511F supports one, CPU 1515F supports two, CPU 1516F supports four, CPU 1517F supports six, and CPU 1518F supports eight. The S7-1200 FC variants (CPU 1212FC, 1214FC, 1215FC, 1217FC) support exactly one. The number of F-runtime groups is fixed by the F-CPU safety certificate and cannot be increased by project options.
Does replacing a system constant with the F-I/O DB change the safety integrity level of my function?
No. The F-I/O DB is generated by the safety compiler, is part of the safety data interface, and is included in the F-CPU's signed safety program. The F-Compiler performs the same static checks (type compatibility, range, and process-image consistency) on F-I/O DB references as it does on F-FB inputs. Replacing a system constant with the F-I/O DB channel tag is the certified way to read the same physical value from the F-program.