Developing Custom APL Faceplates for Blocks Compiled from CFC Charts in PCS 7

Developing Custom APL Faceplates for Blocks Compiled from CFC Charts in PCS 7

In SIMATIC PCS 7, converting a complex CFC chart containing multiple interconnected blocks into a reusable Function Block (FB) and binding it to a custom WinCC faceplate requires compiling the chart as a block type and adhering to Advanced Process Library (APL) naming and structure conventions. Once compiled via "Chart -> Compile -> Chart as Block Type", the new FB must have Operator Communication and Monitoring (OCM) attributes (S7_m_c := 'true') declared on its interface. In WinCC, the companion faceplate is built using standard modular template screens (@PG_<BlockType>.pdl for the main frame, @PG_<BlockType>_Standard.pdl for process controls) and bound to a custom block icon in @PCS7Typicals.pdl via TagPrefix linking.

Table of Contents

Compiling a CFC Chart as a Block Type

In large-scale process automation projects, engineering teams frequently design standardized multi-block equipment controls—such as specialized chemical dosing skids, packaging line handshakes, or composite motor-valve trains. Rather than duplicating dozens of individual charts, PCS 7 allows engineers to encapsulate the entire chart into an autonomous, compiled Function Block Type:

  1. In the Continuous Function Chart (CFC) Editor, create the complete control logic.
  2. Route external inputs and outputs to the chart boundary (Chart I/O).
  3. In CFC Editor, select Chart -> Compile -> Chart as Block Type....
  4. Define the block parameters:
    - FB Number: Assign an available user FB number (e.g., FB2100 within user range FB1–FB2000 or FB2048+).
    - Symbolic Name: Provide a descriptive block name (e.g., DoseSeq).
    - Family: Assign a library family name (e.g., UserLib).
  5. Upon successful compilation, the new FB is stored in the project block folder and becomes available in the CFC block catalog for drag-and-drop instantiation.

Configuring OCM System Attributes on Block Parameters

For WinCC to generate tags automatically during OS compilation, the compiled block and its interface parameters must declare Operator Communication and Monitoring (OCM) attributes:

Parameter DeclarationAttribute SyntaxFunctional RoleFunction Block Header{ S7_m_c := 'true' }Enables block instance for OS compilationProcess Value OutputPV_Out { S7_m_c := 'true' } : REAL;Generates floating point tag in WinCCMode Command InputManModLi { S7_m_c := 'true' } : BOOL;Generates binary operator command tagAPL Structure VariableOutAna { S7_m_c := 'true'; S7_xm_c := 'Value,true;' } : AnaVal;Exposes structure subfield Value to WinCCAlarm Message EventMsgEvId { S7_server := 'alarm_archiv'; S7_a_type := 'alarm_8p' } : DWORD;Links block to WinCC Alarm Logging via Alarm_8P

When the chart is compiled as a block type, configure these attributes under the Chart I/O properties before compilation, or update the generated block properties in the SIMATIC Manager block folder.

APL Modular Faceplate Architecture and File Conventions

SIMATIC PCS 7 APL utilizes a standardized modular architecture for operator faceplates. To create a faceplate for custom block DoseSeq, create the following files in the OS project directory using Graphics Designer:

  • @PG_DoseSeq.pdl (Main Container): The primary window frame hosting the header bar (batch allocations, instance name), view navigation buttons (Standard, Maintenance, Limits), and the central Picture Window.
  • @PG_DoseSeq_Standard.pdl (Standard View): The working view displayed by default when an operator clicks the block icon. Displays process values, setpoints, auto/manual toggles, and status animations.
  • @PG_DoseSeq_Maintenance.pdl (Maintenance View): Optional auxiliary view for instrument maintenance, simulation modes, and bypass commands.
  • @PG_DoseSeq_Preview.pdl (Preview View): Displays operating permissions and upcoming interlocking conditions.

The main container @PG_DoseSeq.pdl uses standard Split Screen Manager C-scripts (SSMOpenTopField2 / SSMGetPictureName) to dynamically swap auxiliary views into its central picture window.

Designing Block Icons and TagPrefix Binding in WinCC

The link between the process graphic and the faceplate is established via the Block Icon:

  1. Open @PCS7Typicals<Project>.pdl (or create a custom typical file).
  2. Create or copy an existing APL block icon.
  3. Configure the block icon object properties:
    - type: Set strictly to @DoseSeq (or @DoseSeq/1 for variant 1).
    - servernames: Set to PCS7 DoseSeq Control.
    - tagname: Leave blank; the PCS 7 block icon wizard automatically populates this with the hierarchical chart path during icon generation.
  4. When an operator clicks the block icon in WinCC Runtime, standard APL scripts read the object's tagname, assign it to the faceplate picture window's TagPrefix, and open @PG_DoseSeq.pdl.
  5. Inside the faceplate views, all dynamic objects reference relative tag names (e.g., .PV_Out#Value or .ManModLi#Value), which automatically resolve against the assigned TagPrefix.

Verification

To verify custom block and faceplate integration:
1. In SIMATIC Manager, instantiate the custom block in a CFC chart; assign instance name Dose_Unit1.
2. Assign the chart folder to the OS and execute Compile OS (Changes only).
3. In SIMATIC Manager, right-click the plant folder and select Plant Hierarchy -> Create/Update Block Icons.
4. Open the target process picture in WinCC Runtime; verify that the newly generated block icon appears.
5. Click the block icon; confirm that the custom faceplate opens instantly, populates live process data, and executes operator commands cleanly.

Limitations and Operational Precautions

Never hardcode absolute tag names (e.g., Plant1/Area2/Dose_Unit1.PV_Out) inside custom faceplate sub-pictures (@PG_*_Standard.pdl). Hardcoded tag names prevent the faceplate from being reused across multiple block instances. All dynamic dialogs and scripts must utilize relative tag names with a leading dot (e.g., .PV_Out), relying exclusively on the WinCC TagPrefix mechanism.

Engineer FAQ

Can a block compiled from a CFC chart contain other sub-blocks?

Yes. When compiling a chart as a block type, all underlying elementary blocks, APL blocks, and logic gates are encapsulated within the newly generated function block.

Why does clicking my custom block icon fail to open the faceplate?

Verify that @PG_<BlockType>.pdl exists in the GraCS directory and that the type property of the block icon matches @<BlockType> exactly (case-sensitive).

Does compiling a chart as a block type consume Process Objects?

The compiled block itself will consume 1 AS RT PO and 1 OS RT PO if it contains S7_m_c := 'true' and generates alarms via Alarm_8P.

Technical References

Related Articles

Related Tags

  • Chart as Block Type
  • Custom Faceplate
  • Block Icons
  • APL Architecture
  • TagPrefix
6 respuestas