How to Extract Diagnostic and Range Signals from F_CH_AI AL_STATE in S7 F-Systems
To dismantle the structured diagnostic output AL_STATE on an F_CH_AI fail-safe channel driver in SIMATIC S7 F-Systems, use certified fail-safe type conversion blocks (such as F_DW_W and F_W_BO) within the safety runtime group, or read the dedicated discrete output pins directly. S7 F-Systems forbids uncertified Step 7 data blocks or non-fail-safe CFC unpackers inside safety programs. Primary operational flags—such as QBAD, QSIM, and QUALITY—are already exposed as top-level pins on F_CH_AI, while internal range limit states (OVHRANGE, OVLOWRANGE) can be extracted using bitwise F-blocks.
Table of Contents
- Structure and Signal Composition of F_CH_AI AL_STATE
- Safety-Compliant Signal Extraction: Discrete Pins vs. F-Conversion Blocks
- Verification
- Limitations and Operational Precautions
- Engineer FAQ
- Technical References
- Related Articles
- Related Tags
Structure and Signal Composition of F_CH_AI AL_STATE
In SIMATIC S7 F-Systems, the fail-safe analog input channel driver F_CH_AI (FB 377) interfaces with safety-rated analog input modules (such as ET 200SP HA F-AI 8xI 2-/4-wire HART or ET 200M F-AI 6x0/4...20mA).
The output parameter AL_STATE is a structured diagnostic output (or packed double-word / DWORD) containing comprehensive channel and sensor health indicators:
* OVHRANGE: Analog input signal has exceeded measuring range limits ($> 21.0 ext{ mA}$).
* OVLOWRANGE: Analog input signal has fallen below live-zero underflow limits ($< 3.6 ext{ mA}$).
* QBAD: Channel passivated due to hardware defect, discrepancy timeout, or communication loss.
* QSIM: Channel is currently operating in simulation mode.
Engineers frequently seek to dismantle this structure to use individual Boolean states in custom safety interlocks or to forward diagnostic indicators to standard non-safety operator graphics.
Safety-Compliant Signal Extraction: Discrete Pins vs. F-Conversion Blocks
Because S7 F-Systems enforces strict functional safety boundaries, how you unpack signals depends on where the data is consumed:
Approach 1: Use Native Top-Level Output Pins on F_CH_AI (Recommended)
Before attempting complex structure dismantling, inspect the formal pin list of F_CH_AI:
* QBAD: Available directly as a discrete BOOL pin indicating channel passivation.
* QSIM: Available directly as a discrete BOOL pin indicating active simulation.
* QUALITY: Available as a discrete BYTE pin outputting the NAMUR signal status.
* In most plant designs, checking QBAD and V directly in CFC satisfies 95% of safety trip logic requirements without touching AL_STATE.
Approach 2: Certified Bitwise Extraction Within the Safety Program (F-Run Group)
If range limit bits (OVHRANGE, OVLOWRANGE) must be evaluated inside the safety logic:
1. In the safety CFC chart, insert F_DW_W (Convert Fail-Safe DWORD to Two Words).
2. Connect F_CH_AI.AL_STATE to F_DW_W.IN.
3. Insert F_W_BO (Convert Fail-Safe Word to 16 Discrete Boolean Bits).
4. Connect the output of F_DW_W to F_W_BO.IN.
5. The output pins BIT0 through BIT15 provide certified, SIL 3 compliant Boolean signals representing individual diagnostic flags, fully verifiable by the F-Compiler.
Approach 3: Forwarding to Non-Safety Standard Data Blocks
If the diagnostic signals are needed strictly for standard WinCC HMI displays or non-safety reporting:
* Use the safety-to-standard gateway block F_SWC_BO or connect directly to a standard global DB outside the safety runtime group. Standard DB variables can then be accessed by SCADA systems without impacting safety CRC signatures.
Verification
- In SIMATIC CFC, open the safety chart in dynamic test mode.
- In the field or test rack, simulate an out-of-range sensor condition ($< 3.6 ext{ mA}$).
- Verify that:
F_CH_AI.QBADtransitions to1.- The corresponding bit output on
F_W_BO(representingOVLOWRANGE) assertsTRUE. - Compiling the safety program produces zero signature mismatch warnings.
Limitations and Operational Precautions
- Never use non-fail-safe blocks (such as standard STEP 7
WORD_TO_BLOCK_DBor custom uncertified SCL unpackers) to process signals within the safety runtime group. The safety compiler will abort. - Do not bypass fail-safe shutdown logic based solely on individual
AL_STATEbits without evaluatingQBAD.QBADremains the primary fail-safe authority. - Any modification to safety chart connections recalculates the Safety Program Collective Signature, requiring safety re-validation and documentation.
Engineer FAQ
- Can I create a custom struct in a DB and connect it to AL_STATE?
Only in standard non-safety programs. In S7 F-Systems, data structures exchanged inside the F-runtime group must utilize strict fail-safe data types managed by F-Library blocks. - Why does F_CH_AI output 0.0 when QBAD is 1?
By design, a passivated fail-safe analog channel substitutes the configured safe value (SubsV, typically0.0 mAor lower range value) to ensure downstream safety actuators de-energize safely. - What does AL_STATE stand for?
AL_STATEstands for Alarm State, representing the packed bit array of channel-specific alarm and limit flags generated by the fail-safe peripheral driver.
Technical References
- SIMATIC S7 F/FH Systems - Configuring and Programming Manual (A5E00278788).
- SIMATIC S7 F-Systems Library: F_CH_AI Block Reference Guide.
- IEC 61508: Functional Safety of Electrical/Electronic/Programmable Electronic Safety-Related Systems.
Related Articles
- Best Practices for Sizing Safety Watchdogs and Discrepancy Times in S7 F-Systems.
- Safely Bridging Fail-Safe Signals to Standard WinCC HMI Displays in PCS 7.
Related Tags
PCS 7, S7 F-Systems, F_CH_AI, AL_STATE, Safety Integrated, SIL 3, Channel Drivers, CFC