Querying CFC Charts and Block Instances: Command Interface Limitations vs Process Object View

Querying CFC Charts and Block Instances: Command Interface Limitations vs Process Object View

In SIMATIC PCS 7, querying CFC charts via the classic STEP 7 Command Interface (Kommandoschnittstelle COM API) to inspect used FCs, FBs, and instance DBs is impossible because CFC stores chart topologies in proprietary database files opaque to the standard S7 API. The STEP 7 Command Interface only provides access to classic S7 container objects, leaving the CFC block collection empty. To automate inspection, extraction, or auditing of CFC charts and block instances, utilize the Process Object View export functions, the Import/Export Assistant (IEA), or Siemens Plant Automation Accelerator (PAA).

Table of Contents

Architecture of the STEP 7 Command Interface vs CFC Data Model

Many engineering organizations develop automated scripts (in C#, VBA, or Python) using the STEP 7 Command Interface (S7API COM automation library) to automate software testing, code reviews, and hardware auditing.

The classic STEP 7 Command Interface exposes an object hierarchy for classic STEP 7 entities:
* IS7Project, IS7Station, IS7Program, IS7Blocks, IS7SymbolTable.

However, SIMATIC PCS 7 relies on the Continuous Function Chart (CFC) graphical editor (s7cfcapp.exe). CFC is not a native STEP 7 language; it is an advanced layered subsystem that maintains its own technological database (storing chart hierarchies, block coordinates, sheet partitions, and signal routing) within proprietary database files (chart.dbf, s7p structures) inside the project folder.

Why the Command Interface Returns Empty CFC Block Collections

When a software developer attempts to iterate through a CFC chart object using the standard COM API:
* The API allows binding to the chart object handle (IS7Chart).
* However, when querying child collections (e.g., querying blocks or calling Next), the interface returns an empty set or null.
* Technical Reason: The STEP 7 Command Interface was architected in the 1990s strictly for classic STEP 7 blocks (OBs, FCs, FBs, DBs). Siemens never extended the COM interface to expose the internal graphical AST (Abstract Syntax Tree) and block collection of the CFC subsystem. The internal CFC data model is private and accessible only through the CFC application binary itself.

Extracting CFC Metadata via Process Object View and XML Export

To automate the extraction of CFC chart structures, block instances, parameters, and signals without using unsupported API calls, use official PCS 7 engineering tools:

Extraction MethodTool / MechanismData ExtractedSupported Output FormatProcess Object View (PO View)SIMATIC Manager > Process Object ViewAll CFC blocks, parameters, signals, messages, and I/O assignments.CSV / .TXT (Tab-delimited)Import/Export Assistant (IEA)SIMATIC Manager > IEATechnological templates, process tags, hierarchy links.CSV / .IEA exchange tablesCFC Chart Reference Data ExportCFC Editor > Options > Chart Reference DataBlock type usage, instance DB list, cross-chart interconnectionsText export / Print fileXML Data ExchangeSIMATIC Manager > Export XMLComplete plant hierarchy and technological block topologyStandardized .XML schema

Table 1: Supported methods for querying and exporting PCS 7 CFC metadata.

Enterprise Engineering Automation with Plant Automation Accelerator (PAA)

For enterprise automation where programmatic, bidirectional creation and inspection of CFC charts is required:
* Siemens provides SIMATIC PCS 7 Plant Automation Accelerator (PAA).
* PAA provides an object-oriented COMOS-based engineering database that interfaces directly with PCS 7.
* Through PAA's modern API, developers can programmatically query every CFC chart, enumerate blocks, modify parameters, and re-import changes directly into SIMATIC Manager via the official PCS 7 XML interface without bypassing database integrity rules.

Verification

To confirm proper metadata extraction using supported workflows:

  1. In SIMATIC Manager, select the top-level plant hierarchy folder and open Process Object View.
  2. Select the General tab to view all block instances, or the Parameters tab to view signal interconnections.
  3. Select Process Objects > Export. Choose CSV format and save to disk.
  4. Open the exported CSV file in a script or spreadsheet: verify that every CFC chart, block instance (MotL, PIDConL), and assigned instance DB (DB741) is fully documented with exact parameters.

Limitations and Operational Precautions

  • Never attempt to reverse-engineer or parse internal .dbf database files in the project directory using direct ODBC/SQL drivers while SIMATIC Manager is open, as concurrent file locks can corrupt the multiproject.
  • The STEP 7 Command Interface is frozen in maintenance mode; Siemens does not add new features to the classic COM interface.
  • Bulk parameter changes performed via CSV re-import must be validated by running a full CFC consistency check (Options > Check Consistency).

Engineer FAQ

Can I use OpenPCS 7 to query CFC charts?

OpenPCS 7 is an OPC DA/HDA/A&E interface for runtime OS Servers to share process data with third-party systems; it does not interface with offline CFC engineering databases on the ES.

Is there a Python library to read PCS 7 CFC charts directly?

There are no official Siemens Python libraries for raw CFC databases. The industry standard approach is writing Python scripts to parse exported XML or CSV files generated by Process Object View.

Does Process Object View require a separate license?

Process Object View is an integrated component of standard SIMATIC PCS 7 Engineering Station software packages and does not require an add-on license.

Technical References

Related Articles

Related Tags

  • Command Interface
  • CFC API
  • Process Object View
  • IEA
  • PAA
  • Automation
  • PCS 7
6 respuestas