How to Locate Hidden Digital IO to Data Block Mappings in STEP 7 and PCS 7
When digital I/O addresses configured in HW Config cannot be located in user logic using 'Go to location' or standard cross-references because all logic reads from a Data Block, the program uses byte-, word-, or block-level peripheral transfers rather than individual bit instructions. In classic STEP 7 and PCS 7, developers frequently mirror entire I/O cards into shared DBs using block instructions like 'L IB 0 / T DB3.DBB 0' or 'SFC 20 BLKMOV'. Filtering the Cross-Reference table for peripheral bytes/words (IB, IW, QB, QW) or searching for BLKMOV immediately reveals where physical signals bind to DB variables.
Table of Contents
- Engineering Paradigms: Direct Bit Addressing vs. Buffered DB Mirroring
- Diagnostic Procedures to Trace Hidden I/O Transfers in STEP 7
- Step-by-Step Cross-Reference and Assignment Analysis
- Verification
- Limitations and Operational Precautions
- Engineer FAQ
- Technical References
- Related Articles
- Related Tags
Engineering Paradigms: Direct Bit Addressing vs. Buffered DB Mirroring
Engineers analyzing unfamiliar SIMATIC S7-300 or S7-400 programs frequently encounter a frustrating troubleshooting dilemma:
* Hardware Configuration (HW Config) shows digital input cards occupying addresses I 0.0 through I 7.7.
* Physical sensors toggle input LEDs on the hardware rack, and dynamic variables inside Data Block 3 (DB3.DBX 0.0 to 0.7) toggle in synchronization.
* Yet right-clicking I 0.0 and selecting Go to location reports The address is not used in the program, and cross-reference tables show no write access to DB3.
This occurs because of a common design pattern known as Buffered I/O Mirroring:
* Instead of referencing physical bit addresses (I 0.0) across dozens of separate program blocks, the original developer copies the entire input image table into a central Data Block (DB3) in a single consolidated routine.
* All functional blocks throughout the program read exclusively from the DB variables (DB3.DBX 0.0).
* If hardware wiring changes during plant commissioning, the engineer only updates the single transfer block, leaving the rest of the application code untouched.
Diagnostic Procedures to Trace Hidden I/O Transfers in STEP 7
The "Go to location" function fails because it performs strict bit-level string matching. If the logic copies an entire byte or word at a time, bit addresses like I 0.0 do not exist as discrete operands in the compiled bytecode.
The four most common programmatic transfer mechanisms:
1. Load and Transfer Statements (Word / Byte Level):
* Logic executed in Organization Block 1 (OB1) or a cyclic interrupt (OB35):
stl
L IB 0 // Load Input Byte 0 (covers I 0.0 to I 0.7)
T DB3.DBB 0 // Transfer to Data Block 3 Byte 0
L IW 2 // Load Input Word 2 (covers I 2.0 to I 3.7)
T DB3.DBW 2 // Transfer to Data Block 3 Word 2
2. Block Move (SFC 20 BLKMOV):
* Uses an ANY pointer to copy a block of memory:
CALL SFC 20 (SRCBLK := P#I 0.0 BYTE 16, DSTBLK := P#DB3.DBX 0.0 BYTE 16).
3. Consistent Peripheral Read (SFC 14 DPRD_DAT):
* Used for distributed I/O modules requiring data consistency across multiple bytes.
4. Process Image Partition (PIP) Updates:
* Executed via SFC 26 UPDAT_PI or automated hardware cyclic image assignments.
Step-by-Step Cross-Reference and Assignment Analysis
Follow this sequence to pinpoint the exact transfer routine:
- Generate and Filter the Cross-Reference Table:
* In SIMATIC Manager, open the offline block folder.
* Select Options -> Reference Data -> Display.
* In the dialog, select Cross-References.
* In the filter settings, do not search for bit addresses (I 0.0). Instead, search for:- Input Bytes:
IB 0,IB 1,IB 2... - Input Words:
IW 0,IW 2... - Data Block Bytes:
DB3.DBB 0...
- Input Bytes:
- Inspect the Address Assignment List:
* In the Reference Data window, switch to Assignment List.
* Select the Inputs (I) tab.
* Look for rows showingB(Byte),W(Word), orD(DWord) access indicators across inputs0through7.
* Double-click the accessing instruction to jump directly to the block and network where the transfer executes. - Search for System Function Calls (SFC 20):
* If byte/word cross-references show nothing, open the Program Structure view in Reference Data.
* Search for calls toSFC 20 (BLKMOV)orSFC 14 (DPRD_DAT).
* Inspect theSRCBLKparameter of each call to locate the source memory range covering your inputs.
Verification
- In SIMATIC Manager, navigate to the identified transfer network (e.g.,
FC 50, Network 1). - Open the block in dynamic monitor mode (
Glassesicon). - Toggle a physical field switch on channel
I 0.0. - Confirm that:
- The raw input byte (
IB 0) changes its binary bit pattern in the accumulator. - The target byte (
DB3.DBB 0) updates simultaneously. - Downstream logic evaluating
DB3.DBX 0.0receives the state change in the same CPU execution cycle.
Limitations and Operational Precautions
- Buffering I/O into Data Blocks adds one scan cycle of processing latency if the transfer routine executes after the consuming logic within the same OB cycle. Always place I/O copy routines at the very beginning of the scan.
- In PCS 7 APL architectures, manual DB mirroring is strongly discouraged; PCS 7 natively utilizes standardized channel driver blocks (
Pcs7DiIn,Pcs7DiOu) that manage hardware diagnostics and NAMUR quality codes automatically. - Modifying transfer offsets in running production controllers requires verifying that neighboring variables are not accidentally overwritten.
Engineer FAQ
- Why did the original programmer use DB variables instead of direct inputs?
To decouple software logic from physical I/O mapping. If an I/O card burns out or wiring is reassigned during commissioning, only the single transfer block is updated, avoiding changes across hundreds of rungs. - Can I see bit addresses in the Symbol Table if bytes are used?
Yes. You can define symbolic names for both the individual bits (I 0.0 = Emergency_Stop) and the parent byte (IB 0 = DI_Card_1_Byte_0) in the Symbol Table. - How are Digital Outputs traced?
Apply the reverse logic: search for writes to Output Bytes/Words (QB 0,QW 0) or look for blocks that copy fromDB4to the output peripheral table.
Technical References
- SIMATIC STEP 7 V5.6 Reference Manual: System and Standard Functions (SFC 20 BLKMOV).
- SIMATIC S7-300 / S7-400 CPU Memory Architecture and Addressing Guidelines.
- Siemens Industry Online Support Entry ID 109801081: Cross-Reference and Address Tracking in STEP 7.
Related Articles
- Tracing Indirect Memory Pointers and S7 ANY Pointers in Legacy STEP 7 Programs.
- Replacing Legacy DB Mirroring with Standard PCS 7 APL Channel Driver Blocks.
Related Tags
Step 7, S7-300, S7-400, Cross Reference, BLKMOV, Digital Inputs, Data Blocks, Troubleshooting