Overview
When fifteen SIMATIC S7-300/S7-400 motors are implemented as multi-instances of a single Function Block (FB), the entire dataset of all fifteen drives lives in one Instance Data Block — typically DB4. The engineering challenge is to expose this consolidated dataset in SIMATIC WinCC V7.0 through a single reusable faceplate rather than fifteen hand-wired motor screens. The pattern that solves this problem is the combination of STEP 7 multi-instance programming on the controller side and the Picture Window Tag Prefix mechanism on the HMI side.
This article walks through the full build, from the FB interface declaration in STEP 7 (Classic) to the Graphics Designer picture window configuration in WinCC 7.0. The result is one MotorFaceplate.PDL that is instantiated fifteen times, each instance reading its own slice of DB4 by virtue of a different tag prefix.
Architecture: Multi-Instance FBs and Picture Window Faceplates
The reusable-faceplate architecture is built from three layers:
-
Controller layer (STEP 7 V5.x / Classic): A child FB (
FB_Motor) encapsulates the logic and I/O of a single motor. A parent FB (FB_15Motors) is called once in OB1 and contains fifteen multi-instance calls ofFB_Motor. The instance DB of the parent FB (DB4) is the only data block needed in the user program; it holds all fifteen instance datasets in contiguous offsets. -
Tag layer (WinCC Tag Management): One WinCC structure tag (built on a WinCC UDT, User-Defined Structure) mirrors the
FB_Motorinterface. Fifteen instances of that structure are created, each pointing to a different starting address in DB4. -
Visualization layer (Graphics Designer): A single picture file
MotorFaceplate.PDLcontains all the animations, IO-fields, bars, and buttons of a motor overview. The picture is referenced from a Picture Window object on the process screen. The Tag Prefix property of the picture window rewrites every internal tag reference, so a single picture can display fifteen different motors.
The Tag Prefix property is the pivot of the technique. WinCC prepends the configured prefix string to every tag name queried from inside the picture at runtime. By changing the prefix from Motor1. to Motor15., the engineer switches the faceplate's data source without duplicating graphics.
Prerequisites
- STEP 7 V5.5 or V5.6 with a valid license for S7-300/S7-400 programming.
- SIMATIC WinCC V7.0 SP3 (or later SP) installed on the engineering/runtime station.
- An established S7 HMI connection (MPI/PROFIBUS/TCP) between the WinCC station and the PLC. The
S7ONLINEdriver must be online in WinCC Tag Management. - STEP 7 project with hardware configuration downloaded to the AS, including a free DB number for the instance DB (DB4 in the example).
- WinCC 7.0 Information System installed locally (Start → SIMATIC → WinCC → Information System). The Faceplate topic references Tag Prefix and Picture Window objects.
STEP 7 Multi-Instance Configuration for Fifteen Motors
A multi-instance is a call of an FB inside another FB where no separate instance DB is generated for the called FB; the called FB reuses the instance data area of the calling FB. The benefit is a dramatic reduction in DB count: fifteen motors require only one instance DB (DB4) instead of fifteen separate instance DBs. Multi-instance creation is described in detail in the SIMATIC STEP 7 documentation: Multi-instances — Programming Basics, Block Calls and the S7-1500/TIA equivalent at Creating multi-instances (STEP 7 V18). The classic S7-300/S7-400 mechanism is functionally identical.
Build the Child FB (FB_Motor)
- In the STEP 7 SIMATIC Manager, insert a new Function Block named
FB_Motor(for example number 100). Declare the following interface (all symbols are example-only — match them to the project):
| Section | Name | Type | Purpose |
|---|---|---|---|
| INPUT | i_Start | BOOL | Start command from HMI |
| INPUT | i_Stop | BOOL | <>Stop command from HMI|
| INPUT | i_Overload_OK | BOOL | Thermal overload contact |
| OUTPUT | o_Running | BOOL | Run feedback |
| OUTPUT | o_Fault | BOOL | Latched fault |
| OUTPUT | o_Current | REAL | Motor current (A) |
| OUTPUT | o_Speed | INT | Speed feedback (rpm) |
| OUTPUT | o_Hours | DINT | Run-time hours |
| STATIC | s_State | INT | Internal state word (0=stopped, 1=running, 2=fault) |
- Implement the body of FB_Motor in LAD/FBD/ST. Compile the FB. Because the FB is called only as a multi-instance, do not assign an instance DB at this stage.
Build the Parent FB and Create the Multi-Instances
- Insert a new FB named
FB_15Motors(for example number 1). In its interface section, declare aSTATvariable for each multi-instance. STEP 7 will auto-create the data area when the FB is compiled:
STAT
Motor : ARRAY[1..15] OF FB_Motor; // multi-instance array
- In the code body of FB_15Motors, call
FB_Motorfifteen times, one call per network, with explicit instance assignment. In STEP 7 V5.x the dialog is Edit → Call → Multi-Instance; in TIA Portal it is the "Call options" dialog described in multi-instance creation. The instance symbol auto-completes to#Motor[1],#Motor[2], …#Motor[15]. - Wire each call to physical I/O or shared inputs (e.g.,
i_Start_1,i_Start_2…). Pass the outputs to global DBs, M flags, or leave them exposed via the parent FB interface for WinCC to read. - Call FB_15Motors once in OB1. When FB_15Motors is saved, STEP 7 asks for the instance DB: select DB4. Compile and download the program.
"Motor_1".Running) by enabling "Symbolic addressing" in the WinCC connection properties; otherwise the faceplate will break every time the FB interface changes.
DB4 Structure and Per-Motor Offsets
DB4 contains fifteen repetitions of the FB_Motor instance data. The byte offset for motor n (1-based) is (n-1) * sizeof(FB_Motor instance data). For the example interface above, the offsets look like:
| Motor Index | Tag Prefix | DB Number | Byte Offset |
|---|---|---|---|
| 1 | Motor1. |
4 | 0 |
| 2 | Motor2. |
4 | 24 |
| 3 | Motor3. |
4 | 48 |
| 4 | Motor4. |
4 | 72 |
| 5 | Motor5. |
4 | 96 |
| 6 | Motor6. |
4 | 120 |
| 7 | Motor7. |
4 | 144 |
| 8 | Motor8. |
4 | 168 |
| 9 | Motor9. |
4 | 192 |
| 10 | Motor10. |
4 | 216 |
| 11 | Motor11. |
4 | 240 |
| 12 | Motor12. |
4 | 264 |
| 13 | Motor13. |
4 | 288 |
| 14 | Motor14. |
4 | 312 |
| 15 | Motor15. |
4 | 336 |
The instance size of 24 bytes assumes the FB_Motor layout shown. The exact size must be verified in STEP 7 by selecting DB4 and reading the Instance-DB / Length property. If the FB interface changes, all offsets downstream shift and the WinCC structure tags must be re-mapped.
WinCC 7.0 Tag Configuration
The faceplate reads from a WinCC structure tag, which is composed of elementary tags. The structure tag gives the faceplate a single, named data context (e.g., Motor1) that maps onto one motor's slice of DB4.
Create a User-Defined Structure (UDT)
- In WinCC Explorer, open Tag Management → [your S7 connection] → Structures.
- Right-click → New Structure. Name it
MotorUDT. Add the following elements matching the FB_Motor interface:
| Element Name | Data Type | Address (DB4, Motor 1 baseline) |
|---|---|---|
| Start | BOOL | DB4.DBX0.0 |
| Stop | BOOL | DB4.DBX0.1 |
| Overload_OK | BOOL | DB4.DBX0.2 |
| Running | BOOL | DB4.DBX2.0 |
| Fault | BOOL | DB4.DBX2.1 |
| Current | FLOAT (REAL) | DB4.DBD4 |
| Speed | INT (WORD) | DB4.DBW8 |
| Hours | DINT | DB4.DBD12 |
| State | INT | DB4.DBW20 |
Offset values are illustrative; confirm against the compiled DB4 layout in STEP 7.
Create Fifteen Structure Tag Instances
- Right-click the S7 connection → New Tag → Tag of Structure Type. Name it
Motor1, selectMotorUDTas the structure type. Set the base address of the structure to DB4, byte 0. - Repeat for
Motor2throughMotor15, advancing the base address by 24 bytes each time (DB4.DBoffset). - For symbolic access (strongly recommended), right-click the S7 connection → Properties → Symbolic, point to the STEP 7 source file. The structure elements then resolve as
Motor_1.Running,Motor_2.Running, etc. — the FB instance name from STEP 7 is used as the structure root, which fits the multi-instance model cleanly.
.sdf file and imported into the WinCC connection. Without symbolic access the absolute addresses above are used; if the FB interface changes, all fifteen structure tags must be edited manually.
Creating the Faceplate in WinCC 7.0
The faceplate is a normal WinCC picture, but it is designed to operate against a relative tag namespace that the Tag Prefix rewrites at runtime.
Step-by-Step Faceplate Construction
- Open the Graphics Designer. Create a new picture, save as
MotorFaceplate.PDLin the projectGraficdirectory. - Set the picture's Properties → Geometry to a 320 × 240 window (or the size of one motor tile on the process screen).
- Insert the visual elements, all of which must reference tags without the motor index — the index is supplied by the picture window's Tag Prefix:
- An IO field bound to
Speed(output). - An IO field bound to
Currentwith one decimal place. - A Bar object animated 0–100 % from
Current. - A Round button for Start, configured with the event Press Left → Set Tag →
Start = 1; release sets it back to 0. - A Round button for Stop, similar, writing
Stop. - A Status indicator showing
Runninggreen /Faultred. - A Text field for run-time hours:
Hours.
- An IO field bound to
- Save the picture. The faceplate itself is generic — never reference a specific motor index here.
Configuring the Picture Window Tag Prefix
The Picture Window is the runtime vehicle that loads the faceplate picture and rewrites its tag references. The Tag Prefix is the property that makes the rewriting work.
Step-by-Step Picture Window Configuration
- In the main process picture (e.g.,
Main.pdl), open the Graphics Designer. From the Standard palette, drag a Picture Window object onto the canvas. - Open Properties → Miscellaneous and configure:
| Property | Value (Motor 1 instance) | Description |
|---|---|---|
| Picture Name | MotorFaceplate.PDL |
The faceplate picture to load |
| Tag Prefix | Motor1. |
Prepended to every tag in the faceplate |
| Display | True | Show the picture window at runtime |
| Adapt Picture | True | Scale the embedded picture to the window size |
| Independent Window | False | Stay embedded in the parent picture |
| Window Mode | Standard | Use standard mode for the faceplate |
- With Tag Prefix set to
Motor1., an internal tagRunningresolves toMotor1.Running, which is the structure element at DB4, byte 2.0. - Copy the picture window fourteen times. For each copy, set the Tag Prefix to
Motor2.,Motor3., …,Motor15.. The Picture Name stays the same; the geometry can be tiled or arrayed in the process picture. - Alternatively, drive the Tag Prefix dynamically. WinCC 7.0 supports a script-based approach: in the picture window's Tag Prefix property, use a tag-prefix expression or assign it from a C-script on the Open Picture event. A common pattern is to use a script that picks the prefix from an internal
MotorSelecttag, allowing one faceplate to "follow" a clicked motor icon.
char* prefix = NULL;
int idx = GetTagWord("SelectedMotor"); // 1..15
if (idx >= 1 && idx <= 15)
{
sprintf(prefix_buf, "Motor%d.", idx);
prefix = prefix_buf;
}
return prefix;
This is the technique used to make a single faceplate popup display whichever motor the operator clicked.
Calling the Faceplate from the Process Picture
There are two common invocation patterns in WinCC 7.0:
Pattern A: Persistent Mosaic of Fifteen Faceplates
Fifteen Picture Windows placed on the overview screen, one per motor, each with a hard-coded Tag Prefix. Use this when the operator always needs to see all fifteen motors simultaneously (typical for a motor control room screen).
Pattern B: Single Popup Faceplate (Drill-Down)
- Place a single Picture Window at a fixed position on the process screen, with Picture Name =
MotorFaceplate.PDLand Tag Prefix left empty initially. - On each motor icon, configure a C-script on the Mouse Click Left → Open Picture event that sets a tag
SelectedMotorto the motor index, then triggers the faceplate display. Many sites use a Set Tag action followed by a Picture Window → Set Property → Tag Prefix direct connection. - Bind the faceplate's Tag Prefix to the dynamic expression above. The faceplate now follows the operator's click without any screen navigation.
Verification and Acceptance Test
After build, perform this sequence in the WinCC Runtime (RT) with the PLC online:
- Tag visibility test: In RT, right-click on the faceplate → Properties → Diagnostics. Confirm that all tags resolve (no red "quality bad" markers). The Tag Prefix value is shown in the picture window's property dialog at runtime.
-
Per-motor mapping test: In STEP 7, force
Motor[1].o_Running = TRUEin VAT. Verify the first faceplate shows the running indicator; the other fourteen do not. Repeat for motors 2–15. -
Command path test: Click Start on faceplate 1. The
Motor1.Starttag in DB4 must toggle for 1 PLC scan; theMotor[1].o_Runningoutput must latch true. -
Fault propagation test: Force
Motor[3].o_Fault = TRUE. Faceplate 3 must turn red; faceplates 1, 2, 4–15 must remain unaffected. - Dynamic Tag Prefix test (if used): Click motor 7's icon. The popup faceplate must show the data of motor 7; the status display on the overview must still show motor 7's data in its own picture window.
- Performance test: Open WinCC Performance Watcher. With all fifteen faceplates updating 250 ms, the tag load must remain within the licensed tag-power limit of the WinCC station. Each structure tag counts as multiple elementary tags in licensing.
Troubleshooting Matrix
| Symptom | Likely Cause | Fix |
|---|---|---|
| All faceplates show the same motor data | Tag Prefix is empty or identical on all picture windows | Set Tag Prefix to Motor1. … Motor15.; verify with WinCC diagnostics |
| Faceplate shows "quality bad" for every tag | DB4 not downloaded or connection is down | Re-download DB4; check WinCC channel diagnostics; verify S7ONLINE |
| Outputs work, but Start/Stop buttons have no effect | Inputs are mapped to a non-writable area (e.g., M flags) or to the wrong offset | Recheck DB4 offset; ensure the input bit is in the INPUT section of FB_Motor, not OUTPUT |
| Adding a new motor shifts all offsets and faceplates misalign | FB interface changed, structure tag base addresses not updated | Recompile DB4, recalculate per-motor offsets, update fifteen structure tag base addresses |
| Dynamic Tag Prefix popup always shows Motor1 | C-script on Tag Prefix property not being re-evaluated on each click | Trigger a property refresh event after SelectedMotor is written; or use a direct connection in lieu of a script |
| WinCC Information System link to faceplate topic is missing | Information System not installed | Reinstall WinCC with the Information System component selected |
| Fifteen faceplates cause RT stutter | Each Picture Window triggers a full picture redraw on every tag change | Increase the update cycle of fast-changing tags (e.g., Current) from 250 ms to 1 s |
Best Practices for Scaling Beyond Fifteen Motors
- Use an ARRAY of multi-instances inside the parent FB. This keeps the multi-instance naming self-consistent and lets the WinCC tag prefix loop with an index, simplifying maintenance.
- Always export the STEP 7 symbols and import the
.sdffile into WinCC. The faceplate will survive future FB interface changes without manual address patching. - Limit tag update rates to 1 second for non-critical data. A bar object updating at 100 ms for fifteen motors creates noticeable RT load.
- Use Picture Windows (not static copies of the picture) for all reusable visuals; they load the picture by reference and consume far less memory than embedded duplicates.
- When the project moves to TIA Portal in the future, the same principle applies but the faceplate authoring moves to the TIA "Faceplate" editor, and the tag prefix is replaced by a PLC tag interface on the faceplate type.
FAQ
How does the Tag Prefix property of a WinCC 7.0 Picture Window actually work?
The Tag Prefix is a string prepended to every tag name resolved inside the embedded picture at runtime. If the faceplate references a tag Running and the picture window's Tag Prefix is set to Motor1., WinCC queries the tag Motor1.Running instead. This allows one generic picture to be reused for many data contexts by changing only the prefix.
Why do all fifteen motors fit into a single DB4 in STEP 7?
Because the FBs are implemented as multi-instances of a single child FB. A multi-instance call does not generate its own instance DB; the instance data is stored inside the parent FB's instance DB. The pattern is described in the Siemens documentation for multi-instance block calls and the equivalent S7-1500 procedure in STEP 7 V18 multi-instances.
What is the recommended address strategy — symbolic or absolute?
Symbolic. Export the STEP 7 symbol table as a .sdf file and assign it to the WinCC S7 connection. The structure elements then resolve through the FB instance names (e.g., Motor_1.Running). Symbolic addressing eliminates manual offset maintenance when the FB interface evolves; absolute addresses must be re-edited on every interface change.
Can the same faceplate be used as both a permanent mosaic and a popup?
Yes. Configure the mosaic with fifteen picture windows and hard-coded Tag Prefixes. Add a separate single picture window for the popup and drive its Tag Prefix dynamically from a C-script bound to the Mouse Click event of each motor icon. The two views are independent and do not interfere.
Where is the official WinCC 7.0 faceplate documentation?
The authoritative reference is the local WinCC Information System installed with WinCC 7.0 (Start → SIMATIC → WinCC → Information System). The relevant topics are Working with Pictures → Picture Objects → Picture Window and Working with Tags → Tag Prefix. Online equivalents for TIA Portal faceplates are available on the Siemens support and TIA documentation portals.