Consolidating Multi-DB Array Data into Unified Tabular Views in SIMATIC PCS 7 and WinCC

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

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
  • 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_TIME
    • Param1: REAL
    • Param2: REAL (or STRING)
  • Instantiate a single Data Block (DB_EventLog) containing Events : 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

  1. Configure a STEP 7 Variable Table (VAT) for Multi-DB Monitoring:
    * In SIMATIC Manager, select the S7 Program -> Blocks folder.
    * Right-click -> Insert New Object -> Variable Table (name it VAT_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 -> Monitor to observe all three data streams simultaneously in real time.
  2. Restructure Logic into an Array of UDTs (Recommended DCS Practice):
    * In the Blocks folder, 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.

  3. Implement WinCC User Archive for Operator Visualization:
    * In WinCC Explorer on the OS, open User Archives.
    * Create archive Event_Log with fields: LogTime (DateTime), Value1 (Double), Value2 (Double).
    * In Graphics Designer, insert the WinCC UserArchiveControl onto a process screen.
    * Connect the control to Event_Log.
    * In CFC, instantiate UA_Send to automatically stream new event lines from the CPU into the WinCC table.

Verification

  1. In STEP 7, open VAT_MultiDB_Monitor and click Monitor; confirm all rows display active data from DB1, DB2, and DB3.
  2. Trigger an event in the CPU; observe that matching lines update synchronously across the table.
  3. 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

Related Articles

Related Tags

  • Data Blocks
  • Variable Table
  • VAT
  • UDT
  • User Archives
  • Array of UDT
  • Table Control
  • PCS 7 V9.0
20 respuestas