Creating Custom AS Blocks and OS Faceplates in SIMATIC PCS 7: S7_m_c Attributes, Type Definition, and @PCS7Typicals Integration
To make a custom AS function block visible in WinCC and generate operational faceplates in SIMATIC PCS 7, you must declare the system attribute S7_m_c := 'true' at the block header and on every parameter requiring operator monitoring or control (OCM). Instantiate the block in a CFC chart, compile CFC with module drivers, and execute an OS Compile. This generates the WinCC Structure Tag type. To render block icons automatically, create a customized object in @PCS7Typicals.pdl with its type property matching @<BlockType>/1. OS compilation will then automatically generate dynamic block icons and link them to faceplates.
Table of Contents
- PCS 7 Block Engineering: Bridging AS Logic and OS Visualization
- Declaring S7_m_c Attributes on Block Headers and Parameters
- CFC Chart Instantiation and OS Compilation Workflow
- Creating Dynamic Block Icons in @PCS7Typicals.pdl
- Structure Tag Generation and Faceplate Binding Architecture
- Step-by-Step Implementation of Custom Blocks and Faceplates
- Verification
- Limitations and Operational Precautions
- Engineer FAQ
- Technical References
- Related Articles
- Related Tags
PCS 7 Block Engineering: Bridging AS Logic and OS Visualization
In SIMATIC PCS 7, process automation relies on object-oriented technological blocks. A complete technological object comprises an AS algorithm (FB/FC programmed in SCL or STL), an OS Structure Tag in WinCC Tag Management, a dynamic Block Icon displayed in process pictures, and a multi-tab Faceplate window providing detailed diagnostics and operator controls.
When automation engineers create proprietary function blocks, they often find that WinCC Faceplate Designer cannot locate the block, or the OS compilation fails to generate structure tags. This occurs when mandatory STEP 7 system attributes and template conventions are omitted.
Declaring S7_m_c Attributes on Block Headers and Parameters
The fundamental link between STEP 7 and WinCC is the S7_m_c (Operator Communication and Monitoring) attribute:
-
Block Header Attribute: In the SCL source file, the block header must declare:
{ S7_m_c := 'true' }immediately aboveFUNCTION_BLOCK FBxxxx.
Without this header attribute, the block object's 'OCM possible' property remains unchecked in the block properties dialog. -
Parameter Attributes: Every variable exposed to WinCC (inputs, outputs, setpoints, statuses) must have
{ S7_m_c := 'true' }declared:
PV_Out { S7_m_c := 'true'; S7_unit := '°C' } : REAL; - Parameters without this attribute remain internal to the AS work memory and are omitted from the WinCC tag dictionary.
CFC Chart Instantiation and OS Compilation Workflow
Declaring the block in the symbol table is not sufficient to generate WinCC tags:
- The block type must be imported into the STEP 7 Master Data Library or project block folder.
- Instantiate in CFC: Open a Continuous Function Chart and drop an instance of the block into the chart. Assign a chart name and block instance name.
- Compile Charts: Execute Compile Charts as Program. Ensure Generate Module Drivers is selected.
- Compile OS: Right-click the OS Server in SIMATIC Manager and run Compile OS. The AS-OS compiler parses all blocks with
S7_m_c = 'true'and creates the corresponding WinCC Structure Type and Structure Tags.
Creating Dynamic Block Icons in @PCS7Typicals.pdl
PCS 7 automatically places block icons into process pictures during OS compile using template graphics:
- Open
@PCS7Typicals.pdl(classic PCS 7) or@PCS7TypicalsAPLV8.pdl(APL). - Copy a standard block icon template (e.g.
@MOTOR/1or@MEAS_MON/1) to serve as a baseline. - Select the customized object, open Object Properties, and locate the property named
type. - Set
typeto@<YourBlockType>/1(e.g.@POLYMER_DOSER/1). - Connect object status animations to the block structure tag elements (e.g.
.STATUS,.PV_Out). - When the process graphic has 'Create/Update Block Icons' checked in Picture Tree, OS compile instantiates the icon automatically.
Structure Tag Generation and Faceplate Binding Architecture
The following table details the technological relationship between STEP 7 source definitions and WinCC runtime components:
{ S7_m_c := 'true' }{ S7_m_c := 'true' }<Chart>/<Block>)@PCS7Typicals.pdltype = @Type/1@PG_<Type>.pdlStep-by-Step Implementation of Custom Blocks and Faceplates
Follow this complete sequence to build and integrate custom technological blocks:
- Author SCL Code: Declare
{ S7_m_c := 'true' }on block header and all relevant inputs/outputs. Compile SCL source into target FB. - Verify Block Attributes in STEP 7: In SIMATIC Manager block folder, right-click the FB -> Object Properties -> Attributes. Confirm
S7_m_cis checked. - Drop Block into CFC: Insert FB into a CFC chart. Set block parameters and interconnect signals.
- Compile AS Program: Compile CFC charts entirely.
- Execute OS Compilation: Compile OS with scope Entire OS and memory generation. Verify WinCC Tag Management creates the structure.
- Build Block Icon: In WinCC Graphics Designer, open
@PCS7Typicals.pdl. Paste a customized object template, set propertytypeto@<FB_Name>/1. - Build Faceplate Graphic: Create
@PG_<FB_Name>.pdlusing Faceplate Designer or APL Faceplate templates. - Update Block Icons in Picture: Open the target plant picture. Click Options -> Create/Update Block Icons. Confirm the custom icon appears.
Verification
Validate custom block and faceplate operation through these checks:
- Tag Management Verification: Open WinCC Tag Management -> Structure Tags. Confirm your block type exists with all declared variables.
- Block Icon Placement: Verify that the block icon generated in the process picture has its
TagandTagPrefixproperties populated. - Runtime Click Test: Launch WinCC Runtime. Click the custom block icon; verify that the faceplate
@PG_<FB_Name>.pdlopens with live data. - Set-point Operation: Modify a setpoint or command from the faceplate and verify online change in CFC Test Mode.
Limitations and Operational Precautions
Observe the following design precautions:
-
Backup Template Pictures: Always create a backup of
@PCS7Typicals.pdlbefore editing. An error in this picture can corrupt block icon generation across the entire project. -
Tag Name Length Limits: WinCC tag names cannot exceed 128 characters. Keep chart and block instance names concise to avoid truncated tag paths.
-
Commercial Accuracy Disclaimer: Software order numbers (MLFBs), package structures, and hardware capacity prerequisites vary across PCS 7 versions and hardware platforms. System integrators must confirm exact software entitlements and licensing requirements against the official Siemens Catalog CA 01 and obtain an authorized Siemens distributor quotation prior to purchasing.
Engineer FAQ
What is the difference between S7_m_c on the header vs on parameters?
The header attribute enables the block type for OS compilation, while parameter attributes determine which specific input/output variables become structure tag elements in WinCC.
Why are my block icons not updating after changing @PCS7Typicals.pdl?
You must open the target plant picture in Graphics Designer and run 'Tools -> Create/Update Block Icons', or recompile the OS with that option selected.
Does creating custom blocks consume additional AS Process Object (PO) licenses?
Yes, if the custom block has S7_m_c attributes and generates autonomous WinCC alarms or operator controllable tags, it consumes AS RT PO licenses.
Technical References
- SIMATIC PCS 7 Programming Instructions for Blocks (Entry ID: 109746516)
- SIMATIC PCS 7 APL Style Guide (Entry ID: 65601446)
- SIMATIC WinCC V7.4 Faceplate Designer Manual (Entry ID: 109740190)
- SIMATIC PCS 7 APL Operator Guide (Entry ID: 50249288)
Related Articles
- Tracing Origin of Instantiated Function Blocks in SIMATIC PCS 7
- Understanding CFC-Generated ES_MAP and ES_IL Blocks in SIMATIC PCS 7
- APL Parameter Arbitration - Faceplate Operator Control vs Interconnection in PIDConL Ramping
Related Tags
- SIMATIC PCS 7
- S7_m_c
- WinCC Faceplate
- Block Icon
- @PCS7Typicals
- CFC Compilation
- Structure Tags