Adding Unmonitored CFC Block Values to WinCC Tag Logging and Trend System

Adding Unmonitored CFC Block Values to WinCC Tag Logging and Trend System

To archive and display non-technology block signals—such as elementary calculation outputs (Add04, Sub02) or channel driver diagnostic tags—in WinCC Tag Logging trends, the variable and its parent function block must possess the S7_m_c (Message and Control) attribute. Because elementary blocks and channel drivers lack block-level S7_m_c, simply tagging an individual output pin is ineffective. The standard engineering practice connects the unmonitored signal to a standard APL monitoring block like MonAnS (for analog values) or MonDiS (for digital values) with 'Create block icon' disabled and archiving enabled, automatically generating WinCC archive tags during AS-OS compilation.

Table of Contents

WinCC AS-OS Tag Compilation Rules and the S7_m_c Attribute

SIMATIC PCS 7 relies on automated AS-OS engineering compilation to populate the WinCC tag database from STEP 7 / CFC charts. The compiler scans the offline block database for variables assigned the system attribute S7_m_c := 'true'. However, a fundamental prerequisite is often overlooked: an individual parameter will only be compiled to WinCC if its parent block (FB) also has S7_m_c := 'true' declared in its block properties.

Standard elementary math blocks (Add04, Sub02, Mul04), logic gates (And04, Or08), and standard channel drivers (Pcs7AnIn, Pcs7DiIn) are designed purely for algorithmic execution or hardware normalization. They do not possess block-level S7_m_c attributes. Consequently, attempting to manually flag an output pin like Out as S7_m_c := 'true' in CFC or the LAD/FBD/STL block editor results in the compiler silently ignoring the parameter during OS compilation.

Structured Variables and the S7_xm_c Attribute Requirement

In the Advanced Process Library (APL), variables are rarely flat primitive types; they are defined as composite structures (e.g., STRUCT: Value : REAL; ST : BYTE; END_STRUCT). For structured variables, standard S7_m_c cannot be applied directly to the structure header in SCL or the block declaration.

According to the Siemens APL Styleguide, structured parameters require the extended attribute S7_xm_c. The attribute value must explicitly identify which internal structure element is exposed to WinCC and whether it is writable or read-only (for example, S7_xm_c := 'Value,true;'). If S7_m_c is assigned to a structured tag instead of S7_xm_c, AS-OS compilation fails or creates corrupt tag structures in the WinCC database.

Architectural Strategies for Trending Non-Technology Signals

The table below evaluates three engineering strategies for adding arbitrary process calculations and internal signals to WinCC Tag Logging:

Engineering StrategyImplementation MethodAS OverheadMaintainability & Library UpgradesAPL Small Monitor Blocks (Recommended)Connect calculation to MonAnS or MonDiS; uncheck 'Create block icon'; enable Archiving.Minimal (Optimized light block)Highest: Standard Siemens blocks; immune to library update conflicts.Custom SCL Archive Interface FBCreate dedicated FB in SCL with S7_m_c := 'true' and input pins flagged with S7_archive.Extremely lowHigh: Centralized data collector; requires project SCL maintenance.Direct Library Block ModificationModify system FBs in Master Data Library to add S7_m_c to block header and pins.NonePoor / Prohibited: Will be overwritten during PCS 7 library updates; high regression risk.

Step-by-Step Procedure Using APL MonAnS and MonDiS Blocks

  1. Instantiate Monitor Block: In the target CFC chart, open the APL library catalog. Drag an instance of MonAnS (for analog values) or MonDiS (for digital values) onto the chart canvas.
  2. Interconnect Signal: Connect the calculation block output (e.g., Add04.Out) or internal driver signal to parameter PV_In on MonAnS (or In on MonDiS).
  3. Configure Block Properties:
    - Right-click the monitor block -> select Object Properties.
    - Uncheck the checkbox Create block icon (this prevents cluttering the WinCC mimic screen with unnecessary faceplate icons).
  4. Enable Archiving for the Tag:
    - In the block properties or via Process Object View (POV) -> Archive Tags tab, locate the PV_Out#Value parameter.
    - Set the archiving attribute to Archiving (or select the appropriate archive cycle, such as 1 s or On change).
  5. Compile and Download:
    - Compile CFC changes (Changes Only) and download to the AS controller.
    - Perform AS-OS Compilation (Changes Only). WinCC automatically creates the tag in WinCC Tag Management and registers it within the WinCC Tag Logging Archive Manager.
  6. Assign to WinCC Trend Control: Open Graphics Designer or WinCC Trend Control, select the newly created archive tag, and verify real-time historical logging.

Verification

Verify tag creation and archiving through the following steps:
1. In SIMATIC Manager Process Object View, select the Archive Tags tab and verify that the target variable shows an active archive assigned with the correct acquisition cycle.
2. Open WinCC Explorer on the OS Server, launch Tag Logging, and expand the archive tree: confirm the presence of the tag under the assigned archive folder.
3. In WinCC Runtime, insert the archive tag into a WinCC Trend Control window: confirm that historical curve values update cyclically with status 16#80 (Good Quality).

Limitations and Operational Precautions

Never modify standard elementary blocks (Add04, Sub02, etc.) in the system libraries (CFC Library or PCS 7 Basis Library). Altering block headers in system libraries violates software maintenance standards and will cause compiler mismatch errors when applying PCS 7 updates. Furthermore, observe CPU memory consumption: while MonAnS is lightweight, instantiating hundreds of monitoring blocks increases local DB memory; for mass trending of raw calculations, utilize a unified custom SCL collector block.

Engineer FAQ

Technical References

Related Articles

Related Tags

  • Tag Logging
  • S7_m_c
  • S7_xm_c
  • MonAnS
  • CFC
  • WinCC Trends
6 respuestas