Creating Dynamic Inter-Block Faceplate Buttons in SIMATIC PCS 7 APL - Utilizing SelFp1#Jump and @NOTP Tag Overrides
To dynamically connect a custom faceplate button across dozens of valves (e.g., using VlvAnL and an auxiliary block POSITIONCTRL) without creating unique faceplates for each valve, utilize WinCC's @NOTP:: prefix combined with the APL interconnection tag .SelFp1#Jump. When an auxiliary block is connected to SelFp1 in CFC, WinCC generates the target tag path in .SelFp1#Jump. In the faceplate C-script, read this target string and write to @NOTP::<TargetBlock>.StartRef, which bypasses the local faceplate TagPrefix and routes commands dynamically to the connected block.
Table of Contents
- The APL Faceplate TagPrefix Encapsulation Problem
- The SelFp1 Interconnection Mechanism and Dynamic Tag Discovery
- Bypassing TagPrefix with the Special WinCC Prefix @NOTP::
- Parameter Mapping and Tag Resolution Matrix
- Step-by-Step Procedure to Implement Generic Inter-Block Faceplate Buttons
- Verification
- Limitations and Operational Precautions
- Engineer FAQ
- Technical References
- Related Articles
- Related Tags
The APL Faceplate TagPrefix Encapsulation Problem
In SIMATIC PCS 7 Advanced Process Library (APL), faceplates operate using standard WinCC Picture Windows:
* The TagPrefix Architecture:
When an operator clicks a valve block icon (e.g., Plant/Area/Valve101), the faceplate window loads with its TagPrefix property set to "Plant/Area/Valve101.". Any script or object inside the faceplate requesting .Command resolves to "Plant/Area/Valve101.Command".
* The Auxiliary Block Dilemma:
Suppose each valve has an associated auxiliary block (such as a custom positioner POSITIONCTRL or counter CntOSc). An engineer wants to add a button on the valve faceplate to trigger StartRef or Reset on that specific auxiliary block.
* The Failure Mode:
Simply writing SetTagBit("StartRef", 1) fails because WinCC prepends the valve prefix, searching for "Plant/Area/Valve101.StartRef", which does not exist on the valve block!
The SelFp1 Interconnection Mechanism and Dynamic Tag Discovery
PCS 7 APL provides built-in inter-block faceplate navigation via pins SelFp1 and SelFp2:
* The CFC Connection:
In CFC, the engineer connects an output or status pin from POSITIONCTRL into the SelFp1 input of VlvAnL.
* The OS Compilation Output:
During AS-OS compilation, the compiler generates a hidden internal structure tag:
Plant/Area/Valve101.SelFp1#Jump
The string value stored inside this tag contains the full symbolic tag path of the connected block:
"Plant/Area/Positioner101"
* Automatic Jump Buttons:
In standard APL, this powers the small jump button (csoFpBtnUser1) on the faceplate view toolbar, enabling operators to switch between related faceplates.
Bypassing TagPrefix with the Special WinCC Prefix @NOTP::
To execute a direct write or read on a different block from within an active faceplate without opening its window:
* The @NOTP:: Prefix ("No Tag Prefix"):
Siemens WinCC includes a built-in syntactic escape mechanism. If a tag name passed to SetTagBit(), GetTagChar(), or SetTagDouble() begins with @NOTP::, WinCC completely ignores the Picture Window's active TagPrefix.
* Dynamic String Concatenation:
By reading .SelFp1#Jump and prefixing the target variable with @NOTP::, a single generic button script works dynamically across hundreds of valves without hardcoding.
Parameter Mapping and Tag Resolution Matrix
The table below outlines tag resolution behavior inside an APL faceplate:
SetTagBit("StartRef", 1)Plant/Area/Valve101.Plant/Area/Valve101.StartRefSetTagBit("Pos101.StartRef", 1)Plant/Area/Valve101.Plant/Area/Valve101.Pos101.StartRefSetTagBit("@NOTP::Pos101.StartRef", 1)Plant/Area/Valve101.Pos101.StartRefSetTagBit(szDynamicTag, 1) via .SelFp1#JumpPlant/Area/Valve101.@NOTP::Plant/Area/Positioner101.StartRefStep-by-Step Procedure to Implement Generic Inter-Block Faceplate Buttons
- Interconnect Blocks in CFC:
In each of the 30 CFC charts, connect the output of your custom block (POSITIONCTRL) to theSelFp1input of the correspondingVlvAnLblock. - Expose Target Parameters for WinCC (S7_m_c):
Ensure that the target inputs (StartRefandRst) onPOSITIONCTRLhave the system attributeS7_m_c := 'true'in the SCL source. Compile the AS and execute an OS compilation. - Customize the Valve Faceplate PDL:
* In WinCC Graphic Designer, open the faceplate view (e.g.,@pg_VlvAnL_Standard.pdl).
* Insert a standard button labeledStart Calibration. -
Attach Dynamic C-Script to Button Click Event:
```c
// Dynamic inter-block write script using @NOTP
#include "apdefap.h"
void OnClick(char lpszPictureName, char lpszObjectName, char* lpszPropertyName)
{
char szTargetBlock[256];
char szFullTag[512];// Read the connected auxiliary block path from SelFp1#Jump
// Note: leading dot evaluates relative to active TagPrefix
char* pszJumpTag = GetTagChar(".SelFp1#Jump");if (pszJumpTag != NULL && strlen(pszJumpTag) > 0)
{
// Construct @NOTP command string
sprintf(szFullTag, "@NOTP::%s.StartRef#Value", pszJumpTag);// Pulse the target parameter to 1 SetTagBit(szFullTag, 1);}
}
```
5. Save and Test in Runtime:
Save the PDL and launch WinCC OS Runtime. Click the button on different valve faceplates and confirm that only the specific connected positioner receives the command.
Verification
To verify dynamic inter-block button operation:
1. Open Valve 1 faceplate in WinCC Runtime. Click the custom button.
2. Open the CFC chart for Valve 1 online. Verify that Positioner101.StartRef pulses to 1.
3. Open Valve 2 faceplate. Click the same button.
4. Verify online that Positioner102.StartRef pulses to 1 while Positioner101 remains unaffected.
5. Confirm that no tag resolution errors appear in the WinCC diagnostic console (apdiag.exe).
Limitations and Operational Precautions
- Missing CFC Interconnection: If an engineer forgets to connect
POSITIONCTRLtoSelFp1on a specific valve,.SelFp1#Jumpwill be empty. The script must check for null/empty strings to prevent runtime scripting errors. - OS Project Editor Overwrites: Customized standard faceplates (such as
@pg_VlvAnL_Standard.pdl) may be overwritten by the OS Project Editor during upgrades. Maintain a backup in your project documentation folder. - Security Authorizations: Ensure the custom button enforces operator authorization (e.g., checking user rights level 5 or 6) before executing the tag write.
Engineer FAQ
Technical References
- SIMATIC Process Control System PCS 7 Advanced Process Library Manual (A5E39140321-AB)
- SIMATIC HMI WinCC Scripting - C and VBS Reference Manual (A5E37536412-AB)
- SIMATIC PCS 7 Operator Station OS Configuration (A5E39875158-AA)
Related Articles
- Implementing Multi-Instance Faceplate Popups in SIMATIC PCS 7 WinCC - Dynamic TagPrefix and C-Script Window Allocation
- Creating Multi-Bit Dynamic Status Logic for Custom Block Icons in PCS 7 Graphic Designer
- Restoring Missing Menus and View Toolbars in PCS 7 APL Faceplates in WinCC Runtime
Related Tags
- APL Faceplates
- TagPrefix
- @NOTP
- SelFp1#Jump
- VlvAnL
- Graphic Designer