Customizing WinCC Tags in PCS7

Customizing WinCC Tags in PCS7

PCS7’s AS-OS Engineering feature automatically creates and connects WinCC OS tags for your PCS7 AS blocks during compilation. Although this feature is a huge timesaver, it sometimes needs to be customized for your specific application.

In this blog, I will demonstrate three methods to define your own variables that will be added to the PCS7 compilation process so that your WinCC tags are automatically maintained by AS-OS Engineering.

SFC Type Parameters

There are several use cases for automatically generating additional variables from PCS7 blocks at the WinCC server. These range from custom WinCC graphic icons all the way to pushing data to-and-from an Ignition based batch reporting system.

Generating tags for your parameter characteristics is straightforward and baked into the PCS7 SFC editor. On the parameter in question, there is a tick box labeled Faceplate. Simply tick the box, and the parameter variable will be created and connected the next time your AS and OS projects are compiled.

Customizing Parameter characteristics.

The parameter will appear on the faceplate Parameters tab, which may not be desirable in all cases but is unavoidable for this type of characteristic. If that’s your case, consider using Process Value or Control Value characteristics instead.

SFC Parameters tab

SFC Type Process and Control Values

One way to work around this limitation is to, instead, define your variable as a Process Value (PV) or Control Value (CV) characteristic. PVs and CVs don’t get included on the Parameters tab, so there is no chance that someone modifies the value from the faceplate; however, because an SFC instance’s PVs and CVs don’t appear on the faceplate, tags aren’t automatically created in WinCC during compilation.

To include a particular variable, switch from the Characteristics view to the Chart I/Os view.

Process Value characteristics

Inside of the IN variable group (for PVs) or the OUT variable group (for CVs), browse to your chosen variable, right click, select Object Properties, and navigate to the Attributes tab in the Variable Properties window that opens. In the first available row, add the S7_m_c attribute, and set its value to true. The next time you compile your AS and OS projects, WinCC will automatically create a tag in your WinCC project.

Modifying variable properties

CFC Blocks

To include variables on library blocks, navigate to an instance of the block and make a note of its FB number. Here, I’m working with FB1865, OpAnL, from the APL V9.0. In the Component View, open your project library and drill through to the Blocks folder to find the specific FB. When you open the FB in the editor, you’ll be notified that it’s protected. You won’t see the source, but you can still edit the variable declarations.

Library block variable attributes

In the declaration table, open the IN or OUT group containing the variable you want to create tags for. Right click on the variable, open the Object Properties, and navigate to the Attributes tab. If the variable is an atomic datatype (BOOL, INT, REAL, etc.), you can simply add the S7_m_c attribute and set it to true, as above.

If the variable is a struct, you’ll need to add both the S7_m_c attribute (set to true), as well as the S7_xm_c attribute. For each member of the struct you want included, you’ll need to add semicolon-separated lists of comma-separated member names and values for the S7_xm_c attribute. For example, to include both the .Value and .ST members of a struct, set the value of S7_xm_c to Value,true;ST,true; and the tags will be generated the next time you compile your AS and OS projects.

Variable properties window in PCS7

Before compiling, it is necessary to update block types in your multiproject. Back in the component view, select the Blocks folder in your library project and choose Options > Charts > Update Block Types from the toolbar. Where prompted, select the block you’ve modified and continue with the ‘Update Block Types’ process. Compiling both the AS and OS projects after updating will make the new struct member(s) available as tags in your WinCC OS project.


AS-OS Engineering is a powerful tool for maintaining and updating tag connections within your PCS7 Multiproject. You can leverage this time saving feature by customizing which SFC and CFC variables get created and updated in the OS project via PCS7 attributes on variables.

Learn more about DMC's Siemens WinCC expertise and contact us for your next project. 


There are currently no comments, be the first to post one.

Post a comment

Name (required)

Email (required)

Enter the code shown above:

Related Blog Posts