Locating Data Blocks in TIA Portal by Number and Name
When a WinCC tag references a PLC Data Block (DB) by absolute number—e.g. DB1122—and the TIA Portal project contains hundreds of program blocks, the locate operation can take longer than the actual engineering task. TIA Portal offers a number of project-tree search paths, cross-reference tools, and structural views that make this a one-minute operation once you know where to look. This reference documents every supported method, the conditions under which each one succeeds, and the steps to confirm that the located block is in fact the one the WinCC tag is reading or writing.
1. Background: Why the Search Sometimes Fails
Data Blocks in TIA Portal have two distinct identifiers:
-
Block number — the absolute address used in the PLC program (e.g.
DB1122) and exposed to HMI/scada systems such as WinCC through the OPC UA / S7 symbol server. -
Symbolic name — the human-readable name declared in the DB header (e.g.
iFace_Recipe_DB,Motor_Data). The symbolic name is what most engineers use inside the SCL, LAD, or FBD editor.
When a WinCC tag is configured with absolute addressing, the HMI only sees the number. If the same DB is configured as an optimized data block on the PLC, the symbolic name is the only stable reference and the number can shift under some compile conditions. The combination of "I know the number, I want the name" is the most common case that prompts the searches documented below. The combination of "I know the name, I want the number" is the reverse, but identical tools apply.
2. Prerequisites
Before searching, confirm the following so the locate operation is not affected by filters:
- The TIA Portal project is open and the relevant PLC device folder is expanded in the project tree (left pane).
- The PLC is at the same firmware version that compiled the running program—otherwise the cross-reference may be regenerated and you could see two copies of the same DB.
- The HMI connection is published: the WinCC tag list is generated from the same TIA Portal project (single-project integration) or from a separately compiled HMI symbol set.
- The Compile step has been run at least once on the PLC device. If you have never compiled, the cross-reference and dependency views will be empty.
3. Method 1 — Project Tree Text Search
The fastest path when you only have the block number is the integrated project-tree search.
- Click in the project tree (left pane) and press Ctrl+F to open the search bar at the top of the tree.
- Type the block number with the
DBprefix, e.g.DB1122. Without the prefix, the search will also match FCs, FBs, and OBs that happen to contain the same number in their comment or instance name. - Press Enter. TIA Portal highlights every block in the project tree whose name or number contains the string.
- Right-click the highlighted entry and choose Open editor to open the DB directly.
For symbolic-name searches, type the name (e.g. Recipe_DB) without quotes. The search is case-insensitive but uses substring matching, so searching for Recipe will also return Recipe_Params, Recipe_Data, and any FC that has Recipe in its comment.
4. Method 2 — Call Structure View
The Call structure is a static analysis built by the compiler. It lists every block in the program and how each one is invoked. It is the best tool when the search is meant to answer the question "is this DB actually called from somewhere?"
- Right-click the PLC in the project tree and choose Call structure (alternatively, double-click Program info under the device).
- In the Call structure editor, the left column lists Resources. Click the Resources tab at the top, or use the dropdown to switch to Resources.
- Expand the DB node. Every compiled DB in the program appears here, indexed by both number and symbolic name.
- Use the filter field at the top-right of the editor (the small magnifier icon) and type
DB1122. The matching row is highlighted. - Right-click the row and choose Open editor. The DB opens at its declaration table.
When the program contains an Instance DB (one created from an FB template) the row is prefixed with DB-Inst rather than DB. Searching for 1122 without the DB prefix will also match instance DBs.
5. Method 3 — Dependency Structure
The Dependency structure is the inverse of the call structure. It is useful when you want to see which FBs, FCs, and other DBs reference the target DB, or when the project is so large that the call structure itself is hard to scan.
- Right-click the PLC in the project tree and choose Call structure (the entry point is the same editor; the view is selectable).
- At the top of the editor, change the dropdown from Call structure to Dependency structure.
- The full list of program blocks appears. Locate
DB1122in the list—use the filter field with theDBprefix to narrow the result. - Right-click the entry and choose Open editor.
The dependency structure is also where you can see whether a DB is used or unused. A DB marked unused can safely be deleted before recompiling—this is sometimes how a "ghost" DB with a number that does not match any actual code comes into existence.
6. Method 4 — Cross-References (Inside TIA Portal)
The Cross-references editor is the canonical Siemens tool for tracing the use of a block, a tag, or an address anywhere in the project. Unlike the call/dependency structure, cross-references also include HMI references, so a DB used by a WinCC tag will appear in the result list.
- Open the project tree and locate Program blocks under the PLC device.
- Right-click Program blocks and choose Cross-references.
- Click the column header Name to sort alphabetically, or click Number to sort by block number.
- Locate the target row. For a known number, sort by Number first.
- Right-click and choose Go to usage to jump to the first reference, then use F4 (Go to next) and Shift+F4 (Go to previous) to walk through every occurrence.
The Access column tells you whether the reference is a read (R), write (W), or both (RW). For an HMI reference the access type matches the tag direction configured in WinCC: an input tag shows R, an output tag shows W.
7. Method 5 — Cross-References from the WinCC Tag List
When the goal is to confirm that the WinCC tag you are troubleshooting really points to the PLC DB you opened in TIA Portal, the most reliable path starts from the HMI side.
- Open the WinCC device in the project tree and select HMI tags.
- Click the tag that references
DB1122. - Switch to the Cross-references tab in the inspector window (lower half of the portal).
- TIA Portal lists every PLC block, FB, FC, and DB that the tag touches. The DB row shows the symbolic name and absolute number.
- Double-click the row to jump to the DB in the project tree.
8. Method 6 — System Resources Folder
If Methods 1–5 all return zero results, the DB is almost certainly located under System Resources. This folder is hidden by default because it is intended to hold compile-generated and protected blocks, but it can also be expanded manually to inspect any DB that is otherwise invisible to the project-tree search.
- In the project tree, scroll to the bottom of the PLC device.
- Expand System resources → Program blocks.
- Open DBs. All system-side data blocks are listed here by number.
- Locate
DB1122in the list. The Type column shows DB for user data blocks and Instance DB for FB instances. - Right-click and choose Open editor to view the declaration table.
Blocks in the System resources folder are read-only by default. To make a block editable, right-click and choose Edit > Block properties and uncheck Know-how protection if it is set. A DB that is marked "Generated from type" is a system-internal copy of a typed DB and should not be edited manually.
9. Method 7 — F7 Go-To Block
For engineers who already have a block open and want to jump to a different one without leaving the editor, TIA Portal supports a global Go-To function bound to F7.
- Open any program block (FC, FB, or DB).
- Press F7. The Go to dialog opens.
- Type the block number with prefix, e.g.
DB1122. - Press Enter. TIA Portal opens the target block in a new tab.
F7 also accepts symbolic names. The dialog is fuzzy, so typing Recipe will offer a list of every block whose name starts with Recipe—pick the right one with the arrow keys and press Enter. F7 is the fastest way to switch between blocks when you have several open tabs and want to cross-check their declaration tables.
10. Optimized vs Non-Optimized Data Blocks
The single most common reason a DB cannot be found is that it is configured as optimized and the search field is not looking in the right place. The differences that matter for the search are summarized below.
| Attribute | Optimized DB | Non-Optimized (Standard) DB |
|---|---|---|
| Symbolic access only | Yes | No (absolute and symbolic) |
| Visible in WinCC tag list by number | No (only by name) | Yes |
| Cross-reference from HMI resolves | Only if WinCC tag uses symbolic addressing | Always |
| Project-tree Ctrl+F search | Finds by name only | Finds by name and number |
| Memory layout | Compiler-assigned, may shift | Fixed, declared order |
| Typical use case | User-defined structures, retain variables | HMI-visible data, hand-off to non-S7 systems |
If a WinCC tag references a DB by number and the DB is optimized, the tag will be flagged in WinCC as Invalid after the next compile. The fix is to either set the WinCC tag to symbolic addressing (recommended) or switch the DB to standard access. To switch, right-click the DB in the project tree, choose Properties → Attributes, and uncheck Optimized block access. Recompile and re-download.
11. Verification Steps
After locating the DB, perform the following checks to confirm that you opened the right one and that it is the source of the WinCC tag in question.
- Number check: Open the DB and confirm the block number in the title bar or in Properties → General → Number matches the expected value (e.g. 1122).
- Symbolic name check: In Properties → General → Name, confirm the symbolic name matches the one the WinCC tag points to.
-
WinCC tag cross-reference: Open the WinCC tag that uses
DB1122, switch to the Cross-references tab, and confirm the row that resolves to the DB. - Compile consistency: Right-click the PLC → Compile → Software (rebuild all blocks). If the block number changes after a full rebuild, the project has either a duplicate DB or a typed-DB conflict. Resolve before downloading.
- Online check: Go online with the PLC, open the DB, and enable Monitor. The values should reflect the live process state. If they read 0 across the board, the wrong DB is online and the build on the controller is older than the project on the engineering station.
12. Troubleshooting Matrix
| Symptom | Likely Cause | Resolution |
|---|---|---|
| Ctrl+F returns no hits for DB1122 | DB is in System Resources, or the project tree filter is set to "User-defined blocks only" | Expand System Resources, or clear the filter dropdown at the top of the project tree |
| Call structure shows the DB as "Unused" | DB exists but is not referenced by any FB/FC/HMI | Right-click the DB and choose Delete block, or add a reference to keep it active |
| DB number in WinCC differs from TIA Portal | WinCC tag was created against an older project version | Right-click HMI → Compile → Software (rebuild all), then re-check the tag |
| Cross-reference tab is empty for the WinCC tag | DB is optimized and the WinCC tag uses absolute addressing | Change the tag to symbolic addressing, or switch the DB to standard access |
| Two DBs with the same number | Project was migrated from STEP 7 Classic and a duplicate was created | Compare Properties → Created by on both; delete the older, re-compile |
| F7 says "Block not found" | Number was mistyped, or DB was deleted after last compile | Run Compile → Software (rebuild all blocks) and retry |
| DB visible in tree but greyed out | Know-how protected, or marked as Generated from type | Open from a typed-DB source if you need to modify; otherwise leave read-only |
| HMI shows quality "Bad" on all DB1122 tags | Connection interrupted, or the HMI is pointed at a different PLC | Right-click HMI → Connections, confirm the IP and rack/slot |
13. Field-Engineering Notes
A few practical caveats observed in production projects:
- Multi-project environments: If the HMI is in a separate TIA project from the PLC, the cross-reference from WinCC to PLC will not resolve. Open both projects, or consolidate into a single project for the duration of the search.
- Library DBs: A DB that comes from a global library (e.g. Siemens_LHmi_DB) lives in the master copy under Libraries → Master copies and the instance lives in the project tree. Searching only the project tree will not find the master; if you intend to edit the type, open the library editor.
- Generated blocks from PLC types: In projects that use PLC type / PLC instance separation, the DB is defined once in the type and instantiated multiple times. The instance number is what appears in WinCC, but the type itself is in the type library. Searching by the instance number will find the instance; searching by the type's symbolic name will not.
- Firmware-dependent behavior: On S7-1200 firmware V4.0 and below, optimized DBs are not supported. If the PLC firmware was upgraded after the project was created, TIA Portal may have silently moved the DB from standard to optimized. The DB number remains, but the WinCC tag configuration needs to be revisited.
14. Summary
Five practical methods reliably locate a Data Block in a TIA Portal project:
- Project-tree Ctrl+F for the block number or symbolic name—fastest for simple cases.
- Call structure → Resources → DBs, filtered by number—best when verifying the DB is actually used.
- Dependency structure, opened from the same editor as the call structure—best for understanding references.
- Cross-references on the Program blocks folder—only method that includes HMI usage in the same view.
- WinCC tag cross-reference—best when starting from the HMI side of the link.
Add the System-resources inspection and the F7 Go-To shortcut, and the locate operation takes under a minute even on a 500-block project. If the search returns nothing, the cause is almost always an optimized DB, a stale project tree filter, or a WinCC tag pointing at a deleted DB number from a previous compile. The troubleshooting matrix in Section 12 covers the recurring field cases.
How do I find a DB in TIA Portal when I only know the number from a WinCC tag?
Click in the project tree and press Ctrl+F, then type the block number with the DB prefix (e.g. DB1122). If no result appears, expand System resources → Program blocks → DBs in the project tree; many older or system-generated DBs live there.
Why is my WinCC tag showing the wrong DB number after a recompile?
The DB is most likely configured as optimized and the WinCC tag uses absolute addressing. Either change the WinCC tag to symbolic addressing, or open the DB, go to Properties → Attributes and uncheck Optimized block access, then recompile.
What is the fastest way to jump to a DB while editing a program block?
Press F7 inside any open program block, type the DB number with prefix (e.g. DB1122) or the symbolic name, and press Enter. TIA Portal opens the target in a new editor tab.
How can I see every program that reads or writes a specific DB?
Right-click Program blocks in the project tree and choose Cross-references. Sort the resulting table by the Number column, locate the DB, and use F4 / Shift+F4 to walk through every reference. The Access column distinguishes reads (R) from writes (W).
Why does the call structure show a DB as "Unused" even though the HMI references it?
The call structure only lists program-level callers (FCs, FBs, OBs). HMI references are visible in the cross-reference editor instead. If the DB is unused in code but used by WinCC, it will appear in cross-references with an HMI entry in the Location column.
Can I search the entire project for a symbolic name, not just the currently selected folder?
Yes. Click the project root in the project tree before pressing Ctrl+F, and ensure the small filter dropdown at the top of the tree is set to All rather than User-defined blocks. The search will then cover every device, every library instance, and the System resources folder.