Step-by-Step Simulation of PCS 7 Automation Systems and CFC Logic Using S7-PLCSIM

Step-by-Step Simulation of PCS 7 Automation Systems and CFC Logic Using S7-PLCSIM

To simulate a SIMATIC PCS 7 V9.0 program using S7-PLCSIM: 1) In SIMATIC Manager, launch the simulator via Options > Simulate Modules; 2) Ensure the PLCSIM interface is set to PLCSIM(TCP/IP) or PLCSIM(MPI); 3) Open HW Config and download the hardware configuration to the virtual AS (PLC > Download); 4) Switch S7-PLCSIM from STOP to RUN or RUN-P mode; 5) In SIMATIC Manager, compile the CFC charts (Entire program) and download the charts to the simulated AS; and 6) To monitor logic online in CFC, open any chart, select Debug > Test Mode (Ctrl+T), right-click the desired block, and select Debug > Watch On (Ctrl+F7).

Table of Contents

Executive Summary

Virtual commissioning and simulation play a fundamental role in modern process automation engineering, allowing engineers to validate complex interlocking, test sequential function charts (SFC), and verify APL control loops before deploying code to physical plant controllers. Novice engineers working with SIMATIC PCS 7 V9.0 frequently encounter roadblocks when using S7-PLCSIM: the simulated CPU remains locked in STOP mode, hardware downloads fail with communications timeouts, or newly downloaded CFC charts cannot be monitored online. This technical guide provides the complete, structured methodology to initialize S7-PLCSIM, download hardware configurations and CFC charts, and activate live online monitoring.

Architecture and Fundamental Mechanics

S7-PLCSIM Simulation Architecture and Operating States

+-------------------------------------------------------------------------+
|                        SIMATIC PCS 7 Engineering System                 |
+-------------------------------------------------------------------------+
| HW Config:                                                              |
| - Hardware Station Definition (Rack, Power Supply, CPU 410-5H, CPs)     |
| CFC Editor:                                                             |
| - Continuous Function Charts, APL Blocks, OB35 Runtime Groups           |
+-----------------------------------|-------------------------------------+
                                    |
         +--------------------------+--------------------------+
         | Phase 1: Hardware Download                          | Phase 2: Chart Download
         v                                                     v
+-------------------------------------------------------------------------+
|                     S7-PLCSIM V5.4 (Virtual S7-400 AS)                  |
|                                                                         |
|   OPERATING STATE TRANSITIONS:                                          |
|   1. Startup: Initialized in STOP mode                                  |
|   2. HW Download: Defines virtual memory layout & internal MPI/IP bus   |
|   3. Mode Switch: User switches mode selector to RUN-P (Run-Program)    |
|   4. Chart Download: Loads user DBs, FBs, and OB35 execution schedules  |
|                                                                         |
|   ONLINE MONITORING (CFC Editor):                                       |
|   - Test Mode (Ctrl+T): Establishes online communication to PLCSIM      |
|   - Watch On (Ctrl+F7): Subscribes to live block pin values             |
+-------------------------------------------------------------------------+

Critical Simulation Prerequisites

  1. Hardware Definition First: A common failure occurs when users attempt to download CFC charts into a freshly launched S7-PLCSIM without downloading HW Config. Without HW Config, the simulated CPU operates with default minimal memory and no configured communication interfaces, rejecting chart downloads.
  2. The RUN-P vs RUN Distinction: In RUN mode, S7-PLCSIM executes code but locks write-access to program blocks; in RUN-P (Run-Program) mode, the virtual CPU executes code while simultaneously permitting online block downloads, delta downloads, and variable forcing.
  3. Interface Parameterization: S7-PLCSIM must match the PG/PC Interface configured on the ES (typically PLCSIM.TCPIP.1 or PLCSIM.MPI.1).

Step-by-Step Implementation Procedure

Step 1: Launch S7-PLCSIM from SIMATIC Manager

  1. Open SIMATIC Manager with your PCS 7 project.
  2. In the toolbar, click the Simulation On/Off icon (or select Options > Simulate Modules).
  3. S7-PLCSIM will launch. In the bottom status bar, locate the interface dropdown.
  4. Select PLCSIM(TCP/IP) if your AS communicates over Industrial Ethernet, or PLCSIM(MPI) if using MPI.
  5. Keep PLCSIM in STOP mode for the initial hardware download.

Step 2: Download Hardware Configuration

  1. In SIMATIC Manager, expand the AS station and double-click Hardware to open HW Config.
  2. Select PLC > Download (or click the Download to Module icon).
  3. In the Target Module dialog, select the CPU and click OK.
  4. Confirm the download. S7-PLCSIM will receive the hardware configuration, initializing its memory structures, diagnostic buffers, and communication addresses.
  5. Close HW Config.

Step 3: Switch PLCSIM to Operating Mode RUN-P

  1. On the S7-PLCSIM window, locate the mode selector switch.
  2. Click the radio button for RUN-P.
  3. Confirm that the yellow STOP LED turns off and the green RUN LED illuminates steadily.

Step 4: Compile and Download CFC Charts

  1. In SIMATIC Manager, select the Charts folder in the project tree.
  2. In the menu bar, select PLC > Compile and Download Objects (or open any CFC chart and choose Chart > Compile > Entire program).
  3. In the compilation dialog, check Generate module drivers and click OK.
  4. Once compilation finishes, select Target system > Download to target system.
  5. Select Scope: Entire program for the initial load.
  6. Confirm the prompt to download to the running/stopped CPU. The charts will load into S7-PLCSIM.

Step 5: Activate Online Monitoring in CFC

  1. Open any CFC chart containing control logic (e.g., motor or PID loop).
  2. In the menu bar, select Debug > Test mode (or press Ctrl + T or click the yellow eyeglasses icon).
  3. Notice the status bar changes to yellow: Test mode: On.
  4. Select a specific block (e.g., MotL), right-click and select Debug > Watch On (or press Ctrl + F7).
  5. The block pins will now animate with live green numbers and boolean states.
  6. You can now toggle inputs, force manual modes, and verify process responses dynamically.

Verification

  1. PLCSIM Variable Inspection: In S7-PLCSIM, select Insert > Vertical Bits or Insert > Byte. Enter an input or output address (e.g., Q 0.0). Confirm that toggling a manual start command in CFC energizes the corresponding bit in PLCSIM.
  2. Diagnostic Buffer Verification: In SIMATIC Manager, select the simulated CPU and press Ctrl+D. Confirm that operating state indicates RUN with zero time error or hardware faults.
  3. WinCC Runtime Connection: Open the OS project locally in WinCC Explorer, ensure the S7 Protocol Suite is set to PLCSIM.TCPIP.1, and click Activate. Verify that faceplates and block icons animate dynamically against the simulated AS.

Limitations and Operational Precautions

  1. No True Hardware Redundancy: S7-PLCSIM V5.4 simulates a single CPU; it cannot simulate redundant S7-400H / CPU 410-5H dual-chassis lockstep failover or optical sync line disconnects.
  2. Real-Time Jitter: S7-PLCSIM is a software emulator running on the Windows operating system; execution cycle times are non-deterministic and can vary based on PC background workload.

Engineer FAQ

Why is PLCSIM stuck in STOP mode initially?

PLCSIM launches in STOP mode by default; you must download the hardware configuration first, then switch the mode selector to RUN-P.

Why does downloading CFC charts fail on a new simulation?

Because HW Config was not downloaded first. S7-PLCSIM requires the hardware configuration to initialize its internal memory and communication parameters.

What is the difference between RUN and RUN-P mode in PLCSIM?

RUN mode executes code but blocks program downloads; RUN-P executes code while permitting block downloads and variable forcing.

How do I monitor a block in CFC?

Press Ctrl+T to enter Test Mode, select the block, and press Ctrl+F7 to activate 'Watch On'.

Can S7-PLCSIM simulate analog inputs?

Yes, you can insert an Analog Slider or Input Word (IW) in PLCSIM to simulate field transmitter values.

What communication protocol should I select in PLCSIM?

Select PLCSIM(TCP/IP) for Industrial Ethernet PCS 7 plants, or PLCSIM(ISO) / PLCSIM(MPI) depending on configured CPs.

Can I test WinCC faceplates with S7-PLCSIM?

Yes, by configuring the WinCC SIMATIC S7 Protocol Suite unit to PLCSIM.TCPIP.1 and activating WinCC Runtime locally on the ES.

Does S7-PLCSIM require physical network cards?

No. S7-PLCSIM communicates via an internal virtual memory bus without requiring physical Ethernet adapters.

Can I simulate SFC charts in PLCSIM?

Yes, SFC sequences can be visualized and stepped through online in the SFC editor during PLCSIM execution.

Is S7-PLCSIM included with SIMATIC PCS 7?

Yes, S7-PLCSIM is a standard engineering tool included in the SIMATIC PCS 7 Engineering Toolset.

Technical References

Related Articles

Related Tags

  • S7-PLCSIM
  • Simulation
  • CFC Monitoring
  • Watch On
  • Test Mode
  • HW Config Download
  • PCS 7 V9.0
20 respuestas