Overview
The Siemens SIMATIC S5 FB 176 (Modular PID Controller) is a function block used to implement closed-loop control in S5-115U, S5-135U, and S5-155U programmable logic controllers. Unlike a single-function FC, FB 176 is a parameterized, instance-style block that requires a dedicated data block (DB) per controller instance to hold setpoints, process variables, tuning parameters, I/O addresses, and internal state. In a typical process plant retrofit or service task it is common to inherit a STEP 5 program containing 40 to 60+ FB 176 instances with the original DB numbers undocumented. Identifying the controller data DB for each loop is a prerequisite to online monitoring, parameter tuning, controller replacement, or migration to S7-300/S7-400/PCS 7.
This article documents the call structure of FB 176, the role of the supporting blocks (PB 100 ms, PB Sampling, DB ODAT, DB INTER), and the exact procedure for resolving the DB number assigned to each controller using STEP 5 cross-reference tools, the KY display format, and DW-pattern recognition inside the ODAT data block.
Prerequisites
- STEP 5 programming software version 6.x or later (STEP 5 V7.23 is the last release supporting the full S5-155U instruction set). Available from Siemens legacy support channels.
- S5D/STL source file for the target CPU, or online connection via the COM 115/155 / CP 525 / CP 527 interface.
-
FB 176 documentation: the "Modular PID and Fuzzy Control" manual (Siemens order number
6ES5 998-1SH51) which describes the control structure, the data block layout, and the calling convention. - CPU firmware compatibility: confirm the target CPU supports FB 176. The block is standard on S5-115U (CPU 941B/942/943/944/945), S5-135U, and S5-155U. The block is not present in S5-90U or S5-95U firmware.
- Read-only access rights to the program file. Do not perform online edits until the DB map is fully verified.
FB 176 Modular PID Controller Architecture
FB 176 implements a modular PID algorithm with the following functional sections selectable via the controller mode word:
| Section | Function | Default Setting |
|---|---|---|
| Setpoint processing | Setpoint ramp, filtering, ratio block | Direct setpoint |
| Process variable processing | PV scaling, square-root extraction, linearization | Linear |
| Error generation | SP-PV with dead band | Dead band = 0 |
| PID algorithm | P, I, D, or PI with anti-windup | PI |
| Output processing | Output limiting, ramp, hold | ±100% |
| Manual/Automatic | Bumpless transfer, tracking | Auto |
Each FB 176 instance consumes one DB INTER (interface data block) and shares one DB ODAT (operator data block) across the entire CPU. The OB that calls FB 176 must also call a periodic interrupt OB (typically OB 13 on S5-115U, OB 34 on S5-135U/155U) which in turn calls the PB 100 ms and PB Sampling auxiliary blocks.
Block Structure and DB Layout
The complete call chain for one FB 176 instance follows the pattern below. The naming is conventional; actual block numbers depend on the original programmer's allocation.
OB 1 (Cyclic) or OB 13/34 (Time-Of-Day interrupt, 100 ms)
|
+-- C DB <ODAT> ; Open shared operator data DB
+-- C DB <INTER> ; Open this controller's interface DB
+-- JU FB 176 ; Execute modular PID
+-- C DB <ODAT> ; Reopen ODAT for output update
+-- JU PB 100ms ; Trigger 100 ms scheduler
+-- JU PB Sampling ; Acquire PV / drive output
The DB ODAT is a single shared block that stores:
- Reference to each controller's DB INTER (block number list)
- Reference to PB 100 ms and PB Sampling block numbers
- Status words, alarm limits, and operator entry points for all loops
The DB INTER (one per controller) stores the live controller data: process variable, setpoint, manipulated variable, gain, integral time, derivative time, sample time, output limits, mode word, and alarm thresholds. Typical DB INTER length is 32 to 64 data words depending on options enabled.
Locating the ODAT Block Number
The ODAT DB is the single entry point for resolving all other block numbers. The reliable way to find it is to inspect the cyclic OB that drives the time interrupt for the PID task.
Procedure A - Cross-reference from OB 13/OB 34
- In STEP 5, open the program file and select File > Blocks > Overview.
- Locate the time-of-day interrupt OB. On S5-115U this is OB 13; on S5-135U/155U the default 100 ms interrupt is OB 34. The interval is configured in the system data (SD 1002/1003) and can be inspected with COM 115 or STEP 5 > PLC > System Data.
- Open the OB. The first executable STL statement is typically
C DB xxwherexxis the ODAT DB number. This is the master ODAT block for all FB 176 instances on the CPU.
Procedure B - Reference Table Scan
If the OB is too long to scan visually, use the Cross Reference tool (Ctrl+Shift+F7 in classic STEP 5):
- Select Edit > Cross Reference.
- Filter for operand type
DBand set the search range to the OB. - Note the first
C DBoperand; this is ODAT. SubsequentC DBcalls in the same OB or in PB 100 ms / PB Sampling are DB INTER candidates.
C DB operand either in the calling OB or in the PB that wraps FB 176. If the OB does not contain a C DB for ODAT, inspect the PBs that the OB calls. Each PB typically begins with C DB <ODAT> followed by C DB <INTER>.Inspecting the ODAT Data Block
Once the ODAT DB number is known, the per-controller block assignments are read directly from the data block contents. The ODAT block uses a fixed DW layout that the FB 176 manual documents on page 18 of the Modular PID and Fuzzy Control reference.
- Open the ODAT DB in STEP 5.
- Switch the display format to KY using View > Display Format > KY. KY is a 16-bit format that splits a data word into two bytes, displayed as
K = constant byte, Y = constant byte. It is the conventional way to read block numbers from a data word because Siemens uses the high byte for the block type and the low byte for the number. - Locate DW 31, DW 32, and DW 33. In the standard ODAT layout these contain:
| DW Address | Content (KY format) | Meaning |
|---|---|---|
| DW 30 | KC, KY, or KM depending on version | Header / status |
| DW 31 | KY = (PB type, PB number) | PB 100 ms block |
| DW 32 | KY = (PB type, PB number) | PB Sampling block |
| DW 33 | KY = (DB type, DB number) | DB INTER for loop #1 |
| DW 34 | KY = (DB type, DB number) | DB INTER for loop #2 |
| ... | ... | ... |
| DW (33 + 2N) | KY = (DB type, DB number) | DB INTER for loop #N |
The PB type and DB type bytes are constants defined by the FB 176 standard layout. Typical constants are 0x04 for PB and 0x0A for DB, but the exact constant must be confirmed against the project's manual revision. The variable byte holds the actual block number assigned by the programmer.
Step-by-Step Procedure to Build the DB Map
Step 1 - Confirm the ODAT DB
From OB 13/34 or via cross-reference, record the ODAT DB number. In the reference example given for the S5-115U the ODAT DB is DB 40. Record this as the master reference.
Step 2 - Open DB ODAT in KY format
- From the STEP 5 block menu, choose Open Block > Data Block.
- Enter the ODAT number, e.g.
40. - Press F7 to toggle the display format until KY is shown in the status bar.
Step 3 - Read DW 31 through DW 33
Scroll to DW 31. The first word holds the PB 100 ms block, the second word the PB Sampling block, the third word the first DB INTER. An example output appears as:
DW 31: KY = 060, 004 ; PB type 60, PB 100 ms = PB 60
DW 32: KY = 056, 004 ; PB type 56, PB Sampling = PB 56
DW 33: KY = 042, 010 ; DB type 10, DB INTER loop 1 = DB 42
DW 34: KY = 043, 010 ; DB INTER loop 2 = DB 43
DW 35: KY = 044, 010 ; DB INTER loop 3 = DB 44
...
Note: the displayed numbers are interpreted as decimal byte values. KY = 060, 004 means the high byte equals 60 (PB type code) and the low byte equals 4 (PB number 4). However, in the FB 176 reference layout the constant bytes for PB and DB identification are sometimes stored in KM (bit pattern) or KH (hex) format. If the layout does not match, switch the format to KH and re-read.
Step 4 - Cross-validate against the source STL
For each candidate DB INTER, open the DB and verify it begins with a recognizable FB 176 interface signature. Typical signatures include:
- DW 0 = control word (KM format) with the high bit set for "controller enabled"
- DW 1-DW 6 = setpoint, process variable, manipulated variable, gain, integral time, derivative time
- DW 7-DW 10 = limits, sample time, alarm thresholds
- DW 11-DW 14 = status and diagnostics
If a DB INTER contains the expected layout, the assignment is correct. If the layout does not match, the candidate is a different DB type and must be rechecked against the ODAT constant codes.
Step 5 - Document the map
Build a project-specific reference table:
| Loop # | Tag | DB INTER | PB 100 ms | PB Sampling | ODAT DB |
|---|---|---|---|---|---|
| 1 | TIC-101 | DB 42 | PB 60 | PB 56 | DB 40 |
| 2 | FIC-201 | DB 43 | PB 60 | PB 56 | DB 40 |
| 3 | LIC-301 | DB 44 | PB 60 | PB 56 | DB 40 |
| ... | ... | ... | ... | ... | ... |
Working Example - S5-115U with 60 Loops
The following workflow was used on a representative S5-115U program with 60 FB 176 controllers. The CPU firmware is CPU 944B release -3UA12 and the STEP 5 project contains 1 ODAT DB (DB 40), 1 PB 100 ms (PB 60), 1 PB Sampling (PB 56), and 60 DB INTER blocks (DB 42 through DB 101).
- Open OB 13. The first STL statement is
C DB 40. ODAT = DB 40. - Open DB 40 with format KY. The first 63 DWs form the ODAT header and the loop table begins at DW 33. The first three entries are:
DW 31 = KY 060,004 → PB 100 ms = PB 4 (note: PB 60 from the manual example uses constant 004 to mean "type PB")
DW 32 = KY 056,004 → PB Sampling = PB 56
DW 33 = KY 042,010 → DB INTER loop 1 = DB 42 - Continue reading DW 33 + 2N to enumerate all 60 loops: DB 42, DB 43, ..., DB 101.
- Open any DB INTER candidate, switch to View > Display Format > Float (KF or KH as appropriate), and confirm the parameter structure.
Handling Non-Standard ODAT Layouts
Not all installations follow the canonical page-18 layout. Variations encountered in the field include:
- Loop table starting at DW 25 — some projects shift the PB 100 ms and PB Sampling entries to the header and begin the DB INTER list earlier.
- Two-byte block numbers — for projects with more than 255 controllers the low byte alone is insufficient. In this case the ODAT entry uses KF format with a 16-bit block number; switch the display format accordingly.
- Multiple ODAT blocks — if the system uses more than 200 controllers the original programmer may have split the loops across two ODAT DBs. Both ODAT numbers must be identified from the OB.
- FB 176 with fuzzy extension — installations that enable the fuzzy logic add-on allocate a separate DB FUZZ block. The FUZZ DB number is stored in a separate ODAT region and is not part of the standard DB INTER list.
Verification
After building the DB map, perform the following verifications before making any online changes:
- Online PV check. Connect STEP 5 to the CPU. Open one DB INTER and switch the display to KF (fixed-point). The PV should reflect the live process variable from the field transmitter. If the value is frozen at 0 or 100%, the DB INTER assignment is wrong.
- Setpoint bump test. With the controller in manual, change the setpoint by 5%. If the manipulated variable responds, the controller is bound to the correct DB INTER and I/O addresses are valid.
- Cross-reference audit. Run the cross-reference tool for the first five DB INTER numbers and confirm each is referenced from exactly one OB 13/34 call site. A DB INTER referenced from multiple call sites is either shared (intentional for redundant controllers) or misconfigured.
- Mode word consistency. The mode word (typically DW 0 of DB INTER) must be consistent with the controller role. A flow controller should not have an integrator-only mode word (KM 0x0002 set without 0x0001).
- Sample time alignment. The sample time field in DB INTER must match the OB 13/34 interval. Mismatches cause integral windup or sluggish response.
Troubleshooting Matrix
| Symptom | Likely Cause | Resolution |
|---|---|---|
| No PID execution; outputs frozen | Wrong ODAT DB in OB 13 | Trace OB 13, identify C DB statement, correct ODAT number |
| PV reads 0% on all loops | DB INTER numbers swapped with PB Sampling | Re-read ODAT DW 31-33 with format KY, separate PB and DB constant codes |
| Loop responds but tuning is wrong | DB INTER points to another controller's DB | Cross-check DW 33 + 2N list against physical loop tag list |
| Controller goes to manual unexpectedly | Mode word overwritten by another instance | Confirm each DB INTER is opened with C DB before FB 176 call |
| Display format shows garbage | Block uses KM or KF instead of KY | Cycle through KH, KM, KY, KF formats and identify the layout |
| Some loops work, others not | Loop table in ODAT has a gap or duplicate | Walk the full table length, verify sequential or expected DB numbers |
| Integral windup on every loop | PB 100 ms block is wrong type or has wrong sample time | Confirm PB 100 ms is the FB 176-supplied scheduler block |
Migration Considerations to S7
When migrating an FB 176 project to S7-300/400 (TIA Portal or STEP 7 Classic), the DB INTER numbers must be re-mapped to the S7 instance DB concept. The Siemens migration tool "SIMATIC S5 to S7 Converter" automatically generates a DB for each FB 176 instance, but the user must reconcile the per-loop tag list with the new instance DB names. The ODAT pattern in the S7 equivalent is replaced by the "PID Control" block parameter interface (FB 41 / FB 42 / FB 43 / FB 58) which does not require a shared operator data block. Preserve the ODAT DB number (DB 40 in the example) in migration notes for traceability.
Safety and Lockout
FAQ
What is the difference between FB 176 and FC 176 in S5?
FB 176 is the Modular PID Controller, a parameterized function block that requires an instance data block (DB INTER) per controller. FC 176 is a different function (not a PID block) and operates without instance data. Confirm the block type by inspecting the block header in STEP 5: FB 176 has "FB 176" in the first line; FC 176 has "FC 176".
How do I find the ODAT DB number if OB 13/34 is encrypted or missing?
Use the STEP 5 cross-reference tool on the symbol "ODAT" or scan the program for the C DB statement immediately preceding the first JU FB 176 call. The block opened with C DB just before the first FB 176 call is the ODAT DB. In S5-155U projects the ODAT may be defined in a separate FB that initializes the controller list.
Can multiple FB 176 controllers share one DB INTER?
No. Each FB 176 instance must have its own DB INTER to store setpoint, process variable, manipulated variable, and tuning parameters independently. Sharing a DB INTER causes parameter corruption across loops. Verify uniqueness with the cross-reference tool: every DB INTER should be referenced from exactly one OB call site.
Why does the KY display show values that look like ASCII characters?
KY format splits the 16-bit data word into two bytes, but those bytes are block-type constants, not ASCII. A value such as KY 042,010 means the high byte equals decimal 42 (block type code for DB) and the low byte equals decimal 10 (the multiplier or DB constant). Use the FB 176 manual page 18 table to translate the constant codes. If the value still does not make sense, switch to KH (hex) format and compare against the documented hex codes.
What is the typical DB INTER size for an FB 176 controller?
A standard FB 176 instance with PID, setpoint ramp, output limiting, and alarms uses 32 data words. Enabling the fuzzy logic add-on increases the size to 48 to 64 data words. The exact length is documented in the FB 176 reference manual section on the DB INTER layout.