Monitoring Internal Bit Memory and Static Variables in PCS 7 SFC Types
To monitor internal bit memory, calculation flags, or static variables (STAT) of a SIMATIC PCS 7 SFC Type online, open the instance Data Block (DB) of the SFC block in the STEP 7 LAD/FBD/STL editor and activate online monitoring ('Spectacles' icon), or create a Variable Table (VAT) targeting the instance DB address (e.g., 'DB1050.DBX12.0'). Alternatively, if an internal bit requires frequent observation in CFC Test Mode or WinCC, expose the bit on the SFC Type interface as an Output parameter ('Q...') in the Characteristics editor.
Table of Contents
- Executive Summary
- Architecture and Fundamental Mechanics
- Step-by-Step Implementation Procedure
- Verification
- Limitations and Operational Precautions
- Engineer FAQ
- Technical References
- Related Articles
- Related Tags
Executive Summary
When troubleshooting complex SFC Type sequencers during commissioning, engineers frequently need to observe internal flags—such as step edge memories, interlock latches, or internal step counters—that are declared as static variables inside the SFC Type. Unlike standard CFC block pins, internal bit memory does not appear as watchable pins on the chart block face in CFC Test Mode. This guide explains how SFC Types store static data in instance data blocks and provides three proven methods to monitor internal variables online.
Architecture and Fundamental Mechanics
SFC Type Memory Architecture and Static Data Storage:
- SFC Type Compilation and Instance DB Generation:
- When an SFC Type is compiled, STEP 7 generates a dedicated Function Block (FB) and an associated Master Data Library block.
- When an SFC Type instance is placed in a CFC chart, CFC automatically allocates an Instance Data Block (
DB) to store all runtime data. - Internal Bit Memory Storage:
- Internal flags, sequencer states, step times, and step active bits are declared as static variables (
VAR/STAT) inside the instance DB. - Because they are internal, CFC Test Mode does not show them on the block graphical boundary.
- Monitoring Pathways:
1. Instance DB Online View: Direct inspection of the DB in the STEP 7 block editor.
2. Variable Table (VAT): Creating an S7 VAT linking to specific byte and bit offsets.
3. Interface Promotion (Output Pin): Promoting the static variable to an official Output (Q...) in Characteristics.
Step-by-Step Implementation Procedure
Methods to Monitor Internal SFC Type Bit Memory:
Method 1: Monitoring via Instance Data Block in STEP 7:
1. Identify Instance DB Number:
- In the CFC chart, right-click the SFC Type instance block -> select Object Properties.
- Note the assigned instance DB number (e.g., DB1024).
2. Open Instance DB Online:
- In SIMATIC Manager, navigate to the S7 Program -> Blocks folder.
- Double-click the instance DB (DB1024); if prompted that the DB belongs to CFC, open it in read-only mode.
- Click the Watch On (Spectacles) icon on the toolbar to observe live values.
Method 2: Monitoring via Variable Table (VAT):
1. In SIMATIC Manager, right-click the Blocks folder -> Insert New Object -> Variable Table.
2. In the VAT, add the symbolic or absolute address (e.g., "CFC_Unit1\SFC_Inst".MyInternalBit or DB1024.DBX20.0).
3. Click the yellow glasses icon to monitor cyclic updates.
Method 3: Promoting Internal Bits to Block Interface (Permanent Solution):
1. Open the SFC Type in the SFC Editor.
2. In the Characteristics tree, select Outputs.
3. Insert a new output variable (e.g., Q_PumpPermit : BOOL).
4. In your step actions, assign the internal bit to this output: SELF.Q_PumpPermit := InternalFlag;.
5. Recompile the SFC Type and update block types; the pin now appears directly in CFC Test Mode.
Verification
To verify internal variable monitoring:
1. In the Variable Table (VAT), monitor the assigned DB address while the SFC executes active steps.
2. Confirm that when the step action asserts the internal bit, the VAT displays status TRUE (1).
3. When the step completes and resets the bit, verify that the VAT status drops to FALSE (0).
Limitations and Operational Precautions
Operational precautions:
- Never modify or force instance DB values directly in the VAT while the SFC is operating; forcing internal memory can desynchronize the SFC state machine and cause sequencer crashes.
- Opening instance DBs online in the LAD/STL editor must be done strictly in read-only mode; do not save edits over auto-generated CFC instance DBs.
- Promoting variables to output pins alters the block interface, requiring a block update and potentially a CPU stop download.
Engineer FAQ
Can I see internal SFC bit memory directly on the CFC chart?
Not unless the bit is declared as an Output pin in the SFC Type Characteristics; internal static memory is hidden from chart pins by default.
Where do I find the instance DB number of my SFC?
In the Object Properties dialog of the SFC block in the CFC editor.
Can I force an internal SFC bit using a Variable Table?
You can force it temporarily, but the running SFC algorithm will overwrite the forced value on the next scan cycle.
Does promoting an internal bit to an output pin require a CPU stop?
If the interface changes, updating block types requires downloading the S7 program with the CPU in STOP mode.
What tool allows monitoring multiple instance DB bits simultaneously?
A standard STEP 7 Variable Table (VAT).
Technical References
- SIMATIC Process Control System PCS 7 SFC for SIMATIC S7
- SIMATIC STEP 7 V5.6 Programming with STEP 7 Manual
- SIMATIC Process Control System PCS 7 Advanced Process Library (APL)
Related Articles
- Troubleshooting Inactive CFC Block Inputs and Missing Output Updates in Test Mode
- Implementing Technological Actions and Step Execution in PCS 7 SFC Types
- Understanding Step Processing and Action Execution Cycles in PCS 7 SFC Types
Related Tags
- SFC Type
- Bit Memory
- Instance DB
- Variable Table
- CFC Test Mode