Wire the pump signals, map them into DB_IO, write FB_Pump in ladder or SCL with command bits the PLC clears and a status word from feedback, load the DB members into WinCC through the S7-1500 channel, then connect buttons with direct connections on mouse press and release, the lamp with a dynamic dialog on the status word, and protect both with authorisation levels.
- WinCC writes requests; the PLC decides and clears them.
- Lamps follow a feedback status word, never the command.
- Authorisation on the object, enforcement in the PLC.
Ways to Dynamise an Object in WinCC Explorer
| Method | Use for | Note |
|---|---|---|
| Tag connection | Show a value directly (I/O field) | Simplest; updates on change |
| Direct connection | Write a constant or tag on an event | Buttons, screen changes |
| Dynamic dialog | Property from ranges or expressions | Lamp colours, visibility |
| VBS / C action | Logic that needs code | Keep short; machine logic stays in the PLC |
Lab Flow: From Pump Signals to a WinCC Faceplate
Every lesson in the Softwell PLC lab manual series follows the same six stages and the same address rule, so the code you write here plugs straight into the HMI lessons.
Stage 1Field Wiring and PLC Tags
| PLC tag | Address | Type | Device / comment |
|---|---|---|---|
S60_Remote | %I8.1 | Bool | Local/remote selector, 1 = REMOTE |
P301_Running | %I8.2 | Bool | Contactor auxiliary |
P301_OL_OK | %I8.3 | Bool | Overload, NC, 1 = healthy |
K301_P301 | %Q4.2 | Bool | Pump contactor |
Stage 2Input Mapping into DB_IO
// FC_InputMapping "DB_IO".S60_Remote := "S60_Remote"; "DB_IO".P301_Running := "P301_Running"; "DB_IO".P301_OL_OK := "P301_OL_OK";
Stage 3PLC Logic in Ladder and SCL
The same logic in SCL – use whichever your plant standard prefers; both write the same DB members that WinCC reads:
// FB_Pump (instance "IDB_P301") – SCL equivalent of networks 1 – 3
"DB_P301".RunCmd := ("DB_P301".Cmd_Start OR "DB_P301".RunCmd)
AND NOT "DB_P301".Cmd_Stop AND NOT "DB_P301".Faulted AND "DB_IO".S60_Remote;
"DB_P301".Faulted := NOT "DB_IO".P301_OL_OK OR ("DB_P301".Faulted AND NOT "DB_P301".Cmd_Reset);
"DB_P301".Running := "DB_IO".P301_Running AND NOT "DB_P301".Faulted;
// Status word for one lamp animation: 0 stopped, 1 running, 2 fault, 3 local
IF "DB_P301".Faulted THEN "DB_P301".Status := 2;
ELSIF "DB_P301".Running THEN "DB_P301".Status := 1;
ELSIF NOT "DB_IO".S60_Remote THEN "DB_P301".Status := 3;
ELSE "DB_P301".Status := 0;
END_IF;
"DB_P301".Cmd_Start := FALSE; "DB_P301".Cmd_Stop := FALSE; "DB_P301".Cmd_Reset := FALSE; // PLC clears commands
// FC_OutputMapping
"K301_P301" := "DB_P301".RunCmd;Stage 4Link PLC Tags to WinCC (Tag Management)
In Tag Management add the SIMATIC S7-1200, S7-1500 Channel, create a connection with the CPU IP address, then use AS Symbols to load the PLC symbols and drag the DB members you need into a tag group. The DB members must have Accessible from HMI ticked in TIA Portal. Names and menus can differ slightly between WinCC versions.
| WinCC tag | Data type | Connection / address | Used by |
|---|---|---|---|
DB_P301_Cmd_Start / _Stop / _Reset | Binary | S7-1500 channel, symbolic | Buttons |
DB_P301_Status | Signed 16-bit | symbolic | Lamp, status text |
DB_P301_RunCmd | Binary | symbolic | Diagnostics |
Stage 5Link Tags to Graphics in Graphics Designer
| # | Object | Properties | Tag / event |
|---|---|---|---|
| ① | Button START (Windows object) | Events → Mouse → Press left: direct connection constant 1 → tag; Release left: constant 0. Miscellaneous → Authorization: Process controlling | DB_P301_Cmd_Start |
| ② | Buttons STOP / RESET | Same pattern | DB_P301_Cmd_Stop / _Reset |
| ③ | Circle lamp | Background color → Dynamic dialog on Status: 0 white, 1 dark grey, 2 white with red border (flashing), 3 light grey | DB_P301_Status |
| ④ | Text list (smart object) | Assignment 0 Stopped, 1 Running, 2 Fault, 3 Local | DB_P301_Status |
| ⑤ | Operator-Control Enable | Dynamic on Status = 3 → disabled in LOCAL | DB_P301_Status |
The TIA panel version of the same faceplate is in HMI buttons, lamps and auto/manual mode; authorisation levels are defined in WinCC user administration.
Stage 6Perform and Test: WinCC Faceplate and Online Ladder
The WinCC screen on the right writes command bits; network 1 of FB_Pump below it shows the PLC deciding. Trip the overload, switch to LOCAL, make the contactor fail, and remove the operator authorisation.
Troubleshooting
| Symptom | Likely cause | First check |
|---|---|---|
| Button works once only | PLC does not clear the command, or release writes nothing | FB code and Release event |
| Lamp RUN while pump stands | Lamp on the command tag | Dynamic dialog source tag |
| Tag shows ### in Runtime | Connection down or member not accessible from HMI | Tag Management diagnostics, DB settings |
| Button does nothing for one user | Authorisation level | User Administrator |
Hands-On Lab: Build a WinCC Explorer Pump Faceplate
Hands-on- TIA Portal and WinCC Explorer V8.1 (or PLCSIM Advanced with WinCC)
- Estimated time: 90 minutes
Wire and declare the pump signals
Declare S60_Remote, P301_Running, P301_OL_OK and K301_P301.
Map inputs into DB_IO
Copy the inputs in FC_InputMapping.
Write FB_Pump in ladder and SCL
Run command with seal-in, fault latch with reset, status word from feedback; PLC clears the commands.
Load the tags into WinCC
Create the S7-1500 channel connection and drag DB_P301 members from AS Symbols into a tag group.
Build the faceplate in Graphics Designer
Buttons with direct connections, a lamp with a dynamic dialog, a text list for the status, authorisation on the objects.
Test in Runtime
Start, stop, overload, local and contactor failure; log off and confirm the buttons are blocked.
WinCC only requests, the PLC decides in ladder or SCL, and the faceplate always shows what the pump really does.
Frequently asked questions
What is the difference between direct connection and dynamic dialog in WinCC?
A direct connection copies a value from a source to a target when an event fires, for example writing 1 to a command tag on mouse press. A dynamic dialog sets a property such as a colour from a tag value or expression with defined ranges.
When should I use a VBS or C action instead?
When the logic cannot be expressed as a simple connection or range table, for example several tags or a calculation. Keep actions short; logic that belongs to the machine belongs in the PLC.
Who should reset a WinCC command bit?
The PLC, after evaluating it. WinCC writes 1 on press (and optionally 0 on release), and the PLC clears the bit in the same scan, so a command never sticks after a communication loss.
How do I stop an operator pressing a button they should not?
Set the object's Authorization property to an authorisation level from the User Administrator and, if needed, disable it with an Operator-Control Enable dynamic so it is greyed out when the action is not allowed.
Why must the lamp follow feedback?
Because a lamp driven by the command shows RUN even when the contactor did not pull in. Animate it from a status word the PLC builds from the running feedback.
Should the logic be in ladder or SCL?
Either – both write the same DB members. Many plants keep simple motor logic in ladder for maintenance and status calculations in SCL; this lesson shows both.