IMDTouchKnowledge BaseShop main store

How-to

How to Simulate a PLC Behind WinCC Flexible 2008 SP3

HMI and touchscreens Published 7 min read

Short answer

WinCC Flexible 2008 SP3 simulation runs your screens on the engineering PC and executes no PLC program, so give every animated object a real data source: STEP 7 with PLCSIM for an S7-300 test, PC Access or KepServerEx OPC for an S7-200, or a PC Adapter USB cable to the physical controller. Then wire M0.0 in parallel with I0.0, M0.1 in series as the stop, and animate the motor symbol on Q0.0, not on the command bit.

On this page
  1. What the Simulation Button Actually Starts
  2. Pick the Data Path Before Installing Anything
  3. Route 1: S7-300 Logic in PLCSIM
  4. Route 2: The S7-200 Through PC Access, KepServerEx or the Cable
  5. One Button Pair and One Symbol
  6. Worked Example: The Start/Stop Seal-In Test on M0.0, M0.1 and Q0.0
  7. When Nothing Moves
  8. From the Simulator to the Real Controller
  9. Questions asked

WinCC Flexible 2008 SP3 simulation runs your screens on the engineering PC and nothing else: no PLC program executes behind them, so every external tag stays dead until you connect a source. For a simulated controller that source is STEP 7 with PLCSIM on the same computer. For an S7-200 it is an OPC server — PC Access or KepServerEx — or the PC Adapter USB cable to the physical PLC, because PLCSIM does not cover that family. In the ladder, put the start command M0.0 in parallel with the physical start input I0.0, put the stop command M0.1 in series as a normally closed logical contact, and bind the motor symbol to the output Q0.0, never to the command bit. The steps below build exactly that.

What the Simulation Button Actually Starts #

The "Simulation On/Off" button in the toolbar starts runtime with your project on the PC. Internal tags belong to the HMI, so navigation, button events and animation built on them work with no controller installed. External tags exchange data with a controller, and simulation does not create one — and neither does installing a PLC programming package, because the interface and access point still have to be aimed at the simulator. That is why a screen can look alive while the logic behind it never runs; the communication side of that trap is covered in why HMI simulation cannot talk to a simulated PLC.

Before you debug anything, name the source of every value on the screen. If the answer is an internal tag, you are testing graphics, not control.

Pick the Data Path Before Installing Anything #

Data path You install Controller What a pass proves
PLCSIM STEP 7 and PLCSIM on the same PC as WinCC Flexible Simulated S7-300 Ladder logic and HMI interaction with no hardware
OPC server PC Access or KepServerEx, connected to the PLC Physical S7-200 Real driver, real tag path, real memory
Direct cable The S7-200 driver and a PC Adapter USB cable Physical S7-200 The same, without the server layer

Commit to what this table forces. With no PLC hardware on the bench, PLCSIM is the only software-only path, so write the exercise for an S7-300. Keeping an S7-200 in the loop means the hardware must be powered and on the connection, because there is no software S7-200. And when a direct connection fails outright, the first check is the controller's communication driver in the installation, not the project.

Route 1: S7-300 Logic in PLCSIM #

  1. Install STEP 7 and PLCSIM on the same computer that runs WinCC Flexible 2008 SP3. Splitting them across machines adds a network hop the simulation does not need; the working arrangement keeps everything on one PC with PLCSIM(MPI) as the interface parameter.
  2. In the PG/PC interface settings, make the S7ONLINE access point point at PLCSIM.
  3. Write the start/stop program from the worked example below, download it to PLCSIM, and switch PLCSIM to run.
  4. Start the test with the "Simulation On/Off" toolbar button, then in the simulation settings click "Blocks" and check that the communication setting is set to PLCSIM.
  5. Prove the path before judging any screen: change a tag value in PLCSIM and watch it arrive in the HMI. If that one value does not travel, fix the interface before touching a single object.

Route 2: The S7-200 Through PC Access, KepServerEx or the Cable #

The S7-200 is often not reachable directly from WinCC Flexible; the working arrangements are an OPC server in between, or runtime over a PC Adapter USB cable.

  1. Install the OPC server — PC Access or KepServerEx — and connect it to the powered S7-200.
  2. Define server items for M0.0, M0.1 and Q0.0, then read and write each item from the server's own test view before the HMI enters the picture. A correct HMI tag cannot compensate for a wrong item name or a dead server-to-PLC link.
  3. In the project tree, double-click Communication > Connections, create a new connection, and select OPC as the communications driver.
  4. Create the external tags against those items — the addressing discipline is the one in addressing S7 PLC outputs in a WinCC flexible tag, with the OPC item path in place of the direct address.
  5. With the PC Adapter USB cable in hand, skip the server: install the S7-200 driver, connect runtime over the cable, and map the same three addresses directly.

One Button Pair and One Symbol #

The start button gets a press event with SetBit on M0.0, the stop button the same on M0.1. SetBit drives a bit to 1 and leaves it there, so give each button a release action that clears its bit, or clear it from the ladder — otherwise the next test starts from a stuck command and the seal-in check proves nothing.

The motor symbol, a plain circle, takes its appearance from Q0.0 and only Q0.0. The symbol must show what the program did, not what the operator asked for: an animation on the command bit lights even when the logic is broken, which is precisely the fault this test exists to catch.

Worked Example: The Start/Stop Seal-In Test on M0.0, M0.1 and Q0.0 #

Inputs — all single bits, from the exercise this setup serves:

  • I0.0, physical Start pushbutton, digital input.
  • I0.1, physical Stop pushbutton, digital input.
  • Q0.0, the output coil the symbol watches.
  • M0.0, the HMI Start command, set by the start button.
  • M0.1, the HMI Stop command, set by the stop button.

Rule in words: energize Q0.0 while (I0.0 OR M0.0 OR Q0.0) is true AND the stop chain is true. The stop chain is the physical stop permissive in series with a normally closed logical contact of M0.1, and that contact is true while M0.1 is 0. Stop outranks both start paths and the seal-in.

Arithmetic, with 1 = true and the stop circuit healthy:

  1. Idle: run term (0 + 0 + 0) = 0, stop chain (1 × 1) = 1, so Q0.0 = 0.
  2. Start pressed on the HMI: run term (0 + 1 + 0) = 1, stop chain (1 × 1) = 1, so Q0.0 = 1 and the symbol lights.
  3. Start released and M0.0 cleared: run term (0 + 0 + 1) = 1 through the coil's own contact, stop chain 1, so Q0.0 = 1 — the coil holds itself.
  4. Stop pressed on the HMI: M0.1 = 1 opens the normally closed contact, stop chain (1 × 0) = 0, so Q0.0 = 0; once M0.1 clears, the run term is (0 + 0 + 0) = 0 and Q0.0 stays 0.

Result: four states, every one decided by two command bits and one coil.

The test passes when the symbol lights at Start, holds after the release clears M0.0, and drops only at Stop; the hold and the drop are the two states that prove the seal-in and the stop priority. A symbol that dies on release is animated on the command bit. A screen that never moves has a data-path fault, not a graphics fault.

Read the physical stop polarity from the wiring, not from habit: monitor I0.1 online, and if it reads 1 when Stop is pressed rather than when the circuit is healthy, invert that contact in the logic.

One safety line before this leaves the bench: Q0.0 in PLCSIM is a bit in software, and the first download to real hardware energizes whatever that output is wired to, so isolate the machine before the same project faces a starter.

When Nothing Moves #

Work the list in order:

  • Simulation opens with a communication error: the "Blocks" setting is not on PLCSIM, or the S7ONLINE access point does not point at PLCSIM(MPI).
  • Screens open, values stay dead: the OPC server is not running, an item name does not match, or the server-to-PLC link is down — fix it at the server, not in the HMI project.
  • A direct S7-200 connection fails at once: the controller's communication driver is not installed; install it before changing anything in the project.
  • The symbol tracks the button exactly: the animation sits on the command bit; move it to Q0.0.
  • Screens healthy but fields empty where data should be: the tag connection is the suspect, and troubleshooting HMI fields that animate but stay blank starts there.

From the Simulator to the Real Controller #

Nothing in the project changes when PLCSIM gives way to hardware; only the connection does. The discipline carries over unchanged: prove one tag end to end before animating the rest, the way testing HMI simulation against a live PLC lays it out. If the operator station will be a computer at the machine rather than a panel, the project moves to PC runtime, and running a WinCC flexible 2008 project in PC runtime covers what that target needs.

Questions asked

Why do the HMI commands use M0.0 and M0.1 instead of writing to I0.0 and I0.1?

Inputs I0.0 and I0.1 show what is wired to the terminals, and a screen writing to them would fight the real pushbuttons. M-area bits are internal memory the ladder and the HMI can both touch, so the commands arrive in parallel and in series with the physical inputs instead of replacing them. Keep writes out of the I area.

Why does my motor symbol drop out the moment I release the start button?

Two causes cover nearly every case: the animation is bound to the command bit instead of Q0.0, so the symbol tracks the request; or the seal-in contact is missing, so nothing holds the coil once the command clears. Bind the symbol to Q0.0 and place the coil's own contact around the start paths, and the hold state appears.

Can PLCSIM stand in for an S7-200?

No. PLCSIM belongs to the STEP 7 side and simulates the S7-300 class of controller; an S7-200 program needs the physical PLC, reached through an OPC server such as PC Access or KepServerEx or over the PC Adapter USB cable. With no S7-200 on the bench, write the exercise for the simulated S7-300 instead.

What does a passing simulation prove before commissioning?

It proves the screens, the tag path and the logic wired for the test. It proves nothing about scan loading on a live network, real I/O wiring, or the polarity of the physical stop input — those are commissioned on the machine with the controller online and the output circuit isolated until the stop path is proven.

Keep reading

  • Explainer

    How WinCC and STEP 7 Work Together in a PLC Project

    STEP 7 configures and programs the Siemens PLC; WinCC builds the operator screens that read and write selected PLC variables over a configured connection. The boundary between the tools is the tag: STEP 7 owns the variable, WinCC owns the display and command objects bound to it.

    HMI and touchscreens

  • How-to

    How to Configure WinCC 7.0 PLC Connections With STEP 7

    No. WinCC 7.0 and STEP 7 5.4 never connect to each other; each one talks to the PLC, so configure two separate paths: the S7Online access point for STEP 7, and in WinCC Tag Management the MPI channel's Logical device name set to MPI (PLSIM for simulation). Acceptance is one known PLC value displayed live with valid status.

    HMI and touchscreens

  • How-to

    How to Disable a Remote HMI Display Through PLC Control

    Put the interlock in the PLC, not the panel. Read each panel's current screen through Remote Display Number, force display 21 through Replace Display Number while the disable bit is latched, and on release write the stored number back, hold one second, then write 0 so the panel never reports it is being controlled remotely.

    HMI and touchscreens

Connecting WinCC to PLCSIM Through the S7Online Access Point