Consolidating Multi-DB Array Data into Unified Tabular Views in SIMATIC PCS 7 and WinCC
To view data records spread across three separate S7 Data Blocks (such as Timestamp, Parameter 1, and Parameter 2, each containing 200 array lines) in a consolidated tabular view displaying matching lines side-by-side, use one of three standard methods: 1. In STEP 7 on the Engineering Station, create a Variable Table (VAT) with rows interleaving matching indices (e.g. DB1.DBD0, DB2.DBD0, DB3.DBD0) for simultaneous online monitoring; 2. In WinCC, implement a WinCC User Archive table linked to an operator screen using the WinCC User Archive Control, allowing the controller to write records directly into relational rows; or 3. Restructure the S7 program into a single Data Block containing an Array of User-Defined Types (UDT) for unified tabular visualization.
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
In event-driven process monitoring and logging applications within SIMATIC PCS 7, automation programs frequently store historical event logs, batch dosings, or quality audit samples across multiple Data Blocks organized as parallel arrays (e.g. DB_Time[200], DB_Param1[200], and DB_Param2[200]). A common operational challenge is that the standard STEP 7 Data Block editor can only display a single DB at a time in online data view, forcing engineers to flip between separate windows to correlate an event's timestamp with its associated process parameters. This article outlines three DCS solutions: configuring interleaved STEP 7 Variable Tables, implementing relational WinCC User Archives, and restructuring parallel arrays into structured User-Defined Types (UDT).
Architecture and Fundamental Mechanics
Data Block Structure, Variable Table Mechanics, and WinCC User Archive Integration:
- The Limitation of Native DB Declaration View:
- The STEP 7 DB editor displays only the active Data Block's internal memory allocation.
-
It cannot join or aggregate columns from multiple independent DBs into a multi-column spreadsheet.
-
Solution 1: STEP 7 Variable Table (VAT) Multi-DB Monitoring:
- A Variable Table allows arbitrary mixing of operands: inputs, outputs, memory flags, and addresses across any number of DBs.
- By organizing the VAT with three adjacent columns or consecutive rows:
- Row 1:
DB1.DBD0(Timestamp), Row 2:DB2.DBD0(Parameter 1), Row 3:DB3.DBD0(Parameter 2) - Row 4:
DB1.DBD4, Row 5:DB2.DBD4, Row 6:DB3.DBD4
- Row 1:
-
The engineer can monitor all three datasets simultaneously in real time with continuous polling.
-
Solution 2: Restructuring Parallel Arrays into an Array of UDTs:
- Instead of three independent DBs with 200 elements each, create a User-Defined Type (
UDT_EventRecord):EventTime:DATE_AND_TIMEParam1:REALParam2:REAL(orSTRING)
- Instantiate a single Data Block (
DB_EventLog) containingEvents : ARRAY[1..200] OF UDT_EventRecord. -
In the STEP 7 DB editor, opening this single DB in Data View displays each event line with all three fields grouped together.
-
Solution 3: WinCC User Archive and Table Control (Operator Solution):
- In WinCC Explorer, the User Archives editor allows defining custom relational tables (Fields:
ID,EventTime,Param1,Param2). - On an operator graphic, insert the WinCC User Archive Control.
- The S7-400 CPU writes an event record to a communication buffer and triggers the WinCC User Archive communication block (
UA_Send/FB_UA). WinCC automatically inserts a new row containing the unified event record.
Step-by-Step Implementation Procedure
-
Configure a STEP 7 Variable Table (VAT) for Multi-DB Monitoring:
* In SIMATIC Manager, select the S7 Program ->Blocksfolder.
* Right-click ->Insert New Object -> Variable Table(name itVAT_MultiDB_Monitor).
* In the table, enter the addresses:- Line 1:
DB1.DBD0(Display format: HEX or TIME) - Line 2:
DB2.DBD0(Display format: REAL) - Line 3:
DB3.DBD0(Display format: REAL / CHAR) - Line 4:
DB1.DBD4... - Select
PLC -> Monitorto observe all three data streams simultaneously in real time.
- Line 1:
-
Restructure Logic into an Array of UDTs (Recommended DCS Practice):
* In theBlocksfolder, insert a User-Defined Type:UDT1(name:UDT_Event).
* Define the structure:EventTime(DATE_AND_TIME),Param1(REAL),Param2(DINT).
* Create a new Data Block:DB100.
* In the declaration table, define:EventList : ARRAY[1..200] OF UDT_Event.
* Save and compile. Switch to Data View (View -> Data View); all 200 event lines now display time and parameters together. -
Implement WinCC User Archive for Operator Visualization:
* In WinCC Explorer on the OS, open User Archives.
* Create archiveEvent_Logwith fields:LogTime(DateTime),Value1(Double),Value2(Double).
* In Graphics Designer, insert theWinCC UserArchiveControlonto a process screen.
* Connect the control toEvent_Log.
* In CFC, instantiateUA_Sendto automatically stream new event lines from the CPU into the WinCC table.
Verification
- In STEP 7, open
VAT_MultiDB_Monitorand clickMonitor; confirm all rows display active data from DB1, DB2, and DB3. - Trigger an event in the CPU; observe that matching lines update synchronously across the table.
- If using WinCC User Archives, open the operator screen in runtime; confirm that each event generates a new row displaying the timestamp and both parameters in a single grid.
Limitations and Operational Precautions
Variable Tables (VAT) are strictly an engineering tool for commissioning; they are not accessible to plant operators in WinCC. Restructuring running controllers from three separate DBs into an Array of UDTs modifies memory offsets, requiring an updated CFC compilation and CPU download. WinCC User Archives require the SIMATIC WinCC/User Archives software license if deployed outside standard bundled packages.
Engineer FAQ
Can the STEP 7 DB editor display multiple DBs in one table?
No. The standard DB editor only opens one Data Block at a time. To monitor multiple DBs together, use a Variable Table (VAT).
What is the best way to group related event data in an S7 CPU?
Use an Array of User-Defined Types (UDT) inside a single Data Block, grouping the timestamp and all associated parameters into each array element.
How can operators view tabular event data in WinCC?
By implementing WinCC User Archives and displaying the data using the WinCC User Archive Control.
Can I export Variable Table (VAT) data to Excel?
Yes, data in a Variable Table can be selected, copied, and pasted directly into Microsoft Excel.
Does WinCC User Archives require an extra license?
Yes, WinCC User Archives is an optional software package requiring a runtime license unless included in a specific PCS 7 bundle.
Technical References
- SIMATIC STEP 7 V5.6 Programming with STEP 7 Manual - Variable Tables and UDTs
- SIMATIC WinCC V7.4 / V7.5 User Archives Manual
- SIMATIC PCS 7 Engineering System Guidelines
Related Articles
- Programmatic Engineering Data Extraction Methods in SIMATIC PCS 7 (POV vs XML vs COM API)
- Configuring Parameter Visibility in the PCS 7 Technological List Editor vs Process Object View
- Essential Keyboard Shortcuts and Navigation Techniques in SIMATIC PCS 7 CFC Editor
- Resolving Corrupted S7 Block Folders and Resolving CFC Compilation Failures in PCS 7
Related Tags
- Data Blocks
- Variable Table
- VAT
- UDT
- User Archives
- Array of UDT
- Table Control
- PCS 7 V9.0