Resolving FB and FC Callers in Siemens STEP 7 and TIA Portal

David Krause13 min read
SiemensTIA PortalTutorial / How-to
Licensed PE Working through this on a live machine? A Maine-licensed engineer can take it from here — included with IMD hardware, by the hour for everything else. Book an engineer

Overview: Block Call Hierarchy Analysis in Siemens S7

When commissioning, debugging, or refactoring a Siemens S7 program, engineers frequently need to know which organization block (OB), function block (FB), or function (FC) is calling a specific block. This is the inverse of the typical I/O cross-reference workflow. With inputs and outputs (I/Os), the cross-reference editor answers "where is this address used?" With logic blocks, the equivalent question is "who calls FC20, and from which network?"

Siemens provides several overlapping tools that resolve this question in STEP 7 Professional in the TIA Portal and in the legacy STEP 7 V5.x (SIMATIC Manager) environment. The three primary mechanisms are Go To Location, the Call Structure tab in the program information area, and the Cross-reference editor. Each method is best suited to a specific scenario, and experienced engineers routinely use all three in a single review session.

This reference documents the menu paths, keyboard shortcuts, filter parameters, and field-proven caveats for each method, with separate procedures for STEP 7 V5.x and TIA Portal V15 through V18. It assumes S7-300, S7-400, S7-1200, and S7-1500 targets; S7-200 is not covered because it does not expose an equivalent cross-reference interface.

Block Types and Call Hierarchy Fundamentals

Before navigating call hierarchies, confirm the block numbering convention used by the project. The S7 block model defines the following user-visible block types:

Block Type Number Range Memory Callable From Instance DB Required
OB (Organization Block) 1-200 (S7-1500: 1-32767) None Operating system / cyclic interrupt / startup No
FB (Function Block) 1-65535 Instance DB OB, FB, FC Yes
FC (Function) 1-65535 Temp / global memory OB, FB, FC No
DB (Data Block) 1-65535 Static / global OB, FB, FC No
SFB / SFC (System) Fixed Per SFB/SFC OB, FB, FC For SFB only

The valid call chain always terminates at an OB. Any FB or FC is invoked by an OB, by another FB, or by another FC. When you want to find callers of a target block (for example, FC20), the search must enumerate every parent block that contains a CALL FC 20 or FC20() invocation. Reusable FCs are frequently called from a dozen or more sites, especially in libraries used by S7-1200 and S7-1500 standard programs.

Renumbering or re-creating a target block invalidates every CALL instruction that points at the old absolute number. Use the cross-reference editor to enumerate all callers before changing a block number; missing one will cause compile error 0801H "Block not found" in the CPU diagnostic buffer.

Prerequisites and Environment Setup

  1. Open the project with full read/write permissions. TIA Portal projects opened in read-only mode (compressed archives) do not support cross-reference regeneration.
  2. Compile the S7 program. Cross-reference data is generated during the last compile. In TIA Portal, use Project tree → PLC → Compile → Software (rebuild all blocks). In STEP 7 V5.x, select the S7 program node and press Ctrl+F10 or use Program → Compile All.
  3. Confirm the project language matches the call-site language. TIA Portal cross-reference returns localized text; switching the editor language (Options → Settings → General → User interface language) re-runs the cross-reference build.
  4. Open the call site of interest in the program editor. Cross-reference navigation works from any block or any tag occurrence, but a focused cursor improves the filter accuracy.

Method 1: Go To Location in STEP 7 (SIMATIC Manager)

STEP 7 V5.x exposes a context-menu command called Go To Location on almost any program element: tags, block numbers, instance-DB identifiers, and block symbols. Selecting it opens a dialog box that lists every occurrence across the offline S7 program, including caller FBs and FCs.

  1. In the SIMATIC Manager, double-click the target block (for example, FC20) to open it in the LAD/FBD/STL editor.
  2. Right-click the block header or any network title bar.
  3. Select Go To → Location from the context menu. The Go To Location dialog appears.
  4. Choose the Callers radio button. The list populates with all blocks that call FC20. Columns include the calling block number, block type, symbol (if assigned), network number, and the line/column of the CALL instruction.
  5. Double-click any row to jump directly to the calling network.

Keyboard alternative: position the cursor on the block number and press Ctrl+B. The shortcut invokes Go To → Location on the element under the cursor.

The Go To Location command respects the active filter. If the Display → Filter dialog is enabled, hidden block types are excluded from the result list. Clear filters with Options → Cross Reference → Filter before invoking Go To Location when a complete result is required.

Method 2: Call Structure Tab in TIA Portal

TIA Portal consolidates the legacy "Program Structure" view into a dedicated tab called Call structure within the program-information area. It shows the static call hierarchy of the entire S7 program and is the fastest way to find every caller of a target block in projects targeting S7-1200 and S7-1500.

  1. Open the program block list (Project tree → PLC → Program blocks) and select the root Program blocks node.
  2. At the bottom of the editor area, locate the inspector tabs: Properties, Diagnostics, Cross-reference, and Call structure. If the tab strip is hidden, drag the splitter upward to reveal it.
  3. Click the Call structure tab. A tree view loads with the cyclic OB (typically OB1 or MainOB) at the root and its direct calls one level below.
  4. Expand the tree by clicking the arrow next to any FB or FC node. Recursive calls display a recursion warning icon; an FC with no callers shows as an unconnected leaf only when the Show unused blocks checkbox is enabled.
  5. Locate the target block (for example, FC20) in the tree. The path from the root to this node enumerates every caller in hierarchical order. Each parent block above the target is a direct or transitive caller.
  6. Right-click FC20 and choose Go to usage to open every network that contains a call to FC20, or Open & Monitor to jump to the online view.

The Call structure tab honors the active filter. The toolbar contains a Display dropdown that controls block-type visibility (OB only, FB+FC, all blocks, with or without system blocks). Select All blocks including system blocks to ensure SFBs and SFCs are also expanded when the target block is a system function.

Method 3: Cross-Reference Editor in TIA Portal

The Cross-reference tab in the inspector window provides a flat, table-style view of every usage of a selected element. Unlike the Call structure tree, the cross-reference view also enumerates tag-level and address-level occurrences in addition to block calls.

  1. Open the target block in the program editor and place the cursor on the block name in the block interface or on the block number in the interface header.
  2. Switch to the Cross-reference tab in the inspector window. The result list refreshes automatically and shows every occurrence.
  3. Filter the result set with the toolbar dropdowns:
    • Object: limits the search to blocks, tags, or all objects.
    • Access type: restricts the listing to Read, Write, or Call access. Select Call to list only the FB/FC call sites.
    • Block: filters by calling block type (OB, FB, FC, SFB, SFC).
  4. Right-click any row to access Go to (jump to the call network), Go to caller (jump to the parent block), and Cross-reference of selection (drill down into the calling block's references).

For project-wide searches without opening a specific block, use Project tree → PLC → Cross-reference. The offline cross-reference opens in a separate editor window and supports multi-block search, multi-project search, and CSV export. Search syntax supports wildcards: FC* matches all FCs, FC2? matches FC20 through FC29, and "FC20" with quotes enforces an exact-number match.

Method 4: Program Structure Window (Legacy)

STEP 7 V5.x also exposes a dedicated Program Structure window. It functions as a graphical hierarchy viewer and is preferred when the caller depth is large (more than four levels) and a tree visualization aids comprehension.

  1. Select the S7 program node in the SIMATIC Manager.
  2. Open Options → Program Structure or use the toolbar button Program Structure.
  3. The Program Structure window opens with the OB at the top. Click Refresh View to rebuild the structure from the current offline program.
  4. Click the + next to any block to expand it. Right-click the target block (FC20) and select Go To → Block to open it, or Show Callers to highlight the parent chain.
The Program Structure window reflects the static (compile-time) call structure. It cannot resolve dynamic block calls made through indirect addressing on S7-300/400, nor can it resolve calls to function blocks whose instance DB is referenced indirectly. See Edge Cases below for mitigation.

Searching with the Symbol Browser

When the target block has a symbolic name, the symbol table becomes another navigation path. Both TIA Portal and STEP 7 V5.x index block symbols in the project-wide symbol table.

  1. Open Project tree → PLC → PLC tags → Show all tags in TIA Portal, or the Symbols table in SIMATIC Manager.
  2. Locate the row whose Address column contains the block number (for example, FC 20).
  3. Right-click and select Cross-reference. The cross-reference list opens in the editor area, identical in behavior to the inspector cross-reference tab.
  4. Filter by Access type = Call to isolate block callers.

This workflow is especially useful in plants with standardized tag-naming conventions (for example, FC_MotorCtrl, FC_ValveSeq) where engineers search by name rather than by absolute block number.

Multi-Project and Library Block Searches

Large S7 programs are frequently split across master projects, sub-projects, and reusable libraries. The static cross-reference inside a single project does not see library types unless the type is instantiated within the project. To search across all instances:

  1. Open Project tree → Global libraries in TIA Portal, or the Libraries node in SIMATIC Manager.
  2. Select the library and right-click the master copy of FC20.
  3. Use Find usages to list every instance across all subordinate projects that use this library. The result list shows each instance DB number and parent block path.

For S7-1500 projects using typed FBs and FCs, the cross-reference editor includes a Type usage column that lists every type-instance relationship, including implicit calls through array of FB instances and through DB_ANY dereferencing. This is the only way to enumerate all callers when an FC is invoked through an array element access pattern (a common SCL idiom for modular recipe handling).

Online vs Offline Cross-Reference Considerations

The cross-reference editor operates on the offline project database by default. When the online program differs from the offline program (a common situation during commissioning or after a CPU firmware update has changed built-in block versions), the offline cross-reference can disagree with the actual runtime call chain.

  1. Establish an online connection to the target CPU (Online → Go online).
  2. Right-click the target block in the project tree and select Compare → Online/offline. The comparison view highlights blocks whose online version differs from the offline version.
  3. Use Online → Cross-reference (online) to load the online call structure into the inspector. TIA Portal V16 and later support this; earlier versions fall back to the offline view with a status warning.

Discrepancies between offline and online cross-references usually indicate one of the following: a download was performed with a different program version, a library was updated without re-downloading dependents, or the CPU was flashed with a newer firmware that altered system block versions. Resolve the discrepancy before drawing conclusions about caller scope.

Edge Cases: Indirect Calls and SCL Multi-Instance Patterns

Several common S7 patterns defeat the static cross-reference. Recognize them in advance and apply the listed workaround.

Pattern Where It Appears Static Cross-Reference Behavior Workaround
Indirect FC call via STL: CALL SFC 0 with parameter block on the stack Legacy S7-300/400 STL code Not resolved; only SFC 0 appears in the caller list Search the project for the parameter word feeding SFC 0; the literal FC number must be enumerated manually.
Indirect FB call via array index in SCL: "MyFB"[i](...) Modular S7-1500 recipe code Not resolved at the index level; the type itself is reported Open the array of FB instances; the cross-reference lists every index expression. Use Find usages on the array variable.
Multi-instance call: an FB is called from another FB's static section Reusable FBs with composition Resolved; the calling FB is shown in the call chain No workaround needed; the call structure shows the full nesting.
Library type called only through HMI or OPC UA Operator-control-driven FBs Not in the static cross-reference Search the HMI tag list or OPC UA server interface for the DB name and back-trace manually.
System block SFB/SFC called by a user FB that is also called by another user FB Standard user code Resolved; the chain is shown Enable Show system blocks in the call structure filter.

When a project mixes SCL and LAD/FBD, the cross-reference editor reports every call site uniformly, but the network number returned for an SCL call refers to the SCL source line, not a graphical network. Use the editor's Go to command rather than the network counter to navigate.

Verification Workflow and Field Checklist

Use the following procedure at the end of any refactor or block-rename task to confirm that no caller has been orphaned.

  1. Open Project tree → PLC → Cross-reference in TIA Portal (or Options → Cross Reference → Display in STEP 7 V5.x).
  2. Set Object filter to the target block (for example, FC20).
  3. Set Access type filter to Call.
  4. Count the rows in the result list. This is your baseline caller count.
  5. Perform the planned refactor (rename, renumber, repackage).
  6. Recompile the project. Resolve every compile warning related to unresolved block calls.
  7. Reopen the cross-reference and reapply the same filter. The row count must match the baseline. If it does not, locate the missing call with Project-wide find (Ctrl+F).
  8. Download the modified program to the CPU. Use Online → Cross-reference to verify that the online cross-reference agrees with the offline one before placing the CPU in RUN.

As a final sanity check, open the CPU diagnostic buffer (Online → Diagnostics → Diagnostic buffer). Search for entries with event ID 0801H (block-not-found) or 4580H (OB-not-found). Either indicates a missed caller.

FAQ

What is the keyboard shortcut for Go To Location in STEP 7 V5.x?

Press Ctrl+B with the cursor on the block number or tag. The Go To Location dialog opens; select Callers to list every block that calls the element under the cursor.

Where is the Call structure tab in TIA Portal?

The Call structure tab is one of the inspector tabs at the bottom of the program editor. If it is not visible, drag the horizontal splitter upward to expand the inspector area. The tab appears alongside Properties, Diagnostics, and Cross-reference after a successful program compile.

Why does the cross-reference show zero callers for a block I know is called?

The most common cause is an uncompiled project: the cross-reference database is regenerated at compile time. Run Project tree → PLC → Compile → Software (rebuild all blocks), then refresh the cross-reference view. The second most common cause is an indirect call (STL SFC 0, SCL array index) that the static analyzer cannot resolve.

Can the cross-reference find calls in an S7-300 program from within an S7-1500 project?

No. Each CPU target maintains its own cross-reference database, and TIA Portal does not merge cross-references across heterogeneous CPU families in the same project. Open the S7-300 sub-project independently and run the cross-reference there.

How do I export the cross-reference list to CSV for documentation?

In TIA Portal, right-click anywhere in the cross-reference table and select Export → CSV. In STEP 7 V5.x, use Options → Cross Reference → Save As; the native format is *.SEQ, which can be opened in Excel with a comma-delimited import. Include the export in the project's functional specification to record the call surface before any refactor.

Back to blog