Introduction
S7-1500 has dominated the world of SIMATIC automation systems but there is still a huge install base of the legacy systems (S7-300 and S7-400) that is not going to be upgraded soon. Quite often we control engineers have to connect our shiny new systems to these old dogs and it is not the easiest thing to do because they are already in production. The best practice to implement any project requires thorough tests but how do we test our software with these legacy systems?
This article addresses this challenge using PLCSim and / or PLCSim Advanced and S7 communication.
PLCSim and PLCSim Advanced
PLCSim and PLCSim Advanced are two popular PLC simulators for the SIMATIC controllers. PLCSim has been there much longer than PLCSim Advanced while the later has much more features. Below form describes their similarities and differences.
Function | PLCSim Advanced | PLCSim TIA Portal | PLCSim Step7 5.x |
---|---|---|---|
Runtime | Independent | Programming with Step7 | Programming with Step7 |
User interface | Control panel | TIA Portal | Step7 V5.x |
Communication | Softbus, TCP/IP | Softbus | Softbus |
Supported CPU families | S7-1500, ET200SP | S7-1200, S7-1500, ET200SP | S7-300, S7-400 |
API for co-simulation | Yes | No | No |
Webserver | Yes | No | No |
OPC UA | Yes | No | No |
Process diagnostics | Yes | Yes | No |
S7 communication | Yes | Only via Softbus | Only via Softbus |
Open user communication | Yes | Only via Softbus | No |
Traces | Yes | Yes | No |
Motion | Yes | Yes | No |
Multiple instances | Up to 16 | Up to 2 | No |
Distributed instances | Yes | No | No |
Connection of real CPUS / HMIs | Yes | No | No |
DNS | Yes | No | No |
Virtual memory card | Yes | No | No |
Solution Concept
The backbone of the solution to test the S7-1500 software with the legacy systems is the Softbus. Softbus is communication bus based on software that hides the particular network technology. It provides application processes with a transparent, end-to-end communication path and at the same time, integrates the access to standard systems such as SIMATIC S7/S5.
In other words, when you are going online to a simulated PLC instance provided by either PLCSim or PLCSim Advanced, if your PG/PC interface is PLCSim, your TIA Portal is communicating with the PLC instance via softbus.
Since softbus is available in both PLCSim and PLCSim Advanced, it can let S7-1500 systems communicate with the legacy systems in the simulated environment and we can test the interface with it comprehensively using S7 communication via softbus.
Application Example
In this application example, we have two PLCs configured in two TIA Portal projects. The S7-1513 on the left is the new project that we want to connect to the legacy system and the S7-416 on the right is the old dog that has been there for 20 years.
To test the interface functions between the two projects, we need to configure S7 communication between them.
Configure the S7 Communication
On the S7-1513 side the configuration is done as below.
It is important to make the S7-1513 actively establish the connection.
Also make sure that the rack and slot number for the partner side is correct.
On the S7-416 side the configuration is done as below.
Note that S7-416 is not actively establishing the connection.
Also make sure that the rack and slot number for the partner side is correct.
Run the Simulation
Run the S7-1513 with PLCSim Advanced by creating a PLC instance in the PLCSim Advanced and download the S7-1513 HW Config.
For the S7-416 side, simply run the PLCSim from TIA Portal and download the HW Configuration.
Check the S7 Communication Status
With both PLC instances running, we can easily check the S7 communication status by looking at the HW configuration of either side.
As shown below, the S7-1513 CPU has a healthy S7 communication running.
The same on the S7-416 side.
From this point onwards, we can go back to the old game of using PUT/GET to exchange interface data and test all the functions.
Limitations
Without further development softbus can only run on a standalone station hence distributed simulation is not possible and the computing resource for the simulation is limited as well as the number of PLC instances.
Also, PLCSim limits the number of simulated instances to the maximum of 2.
Conclusion
With S7 communication supported by softbus, we can establish communication between S7-1500 simulation instances running on PLCSim Advanced with S7-300 / S7-400 simulation instances running on PLCSim. This allows us to test software function between a newly developed system using S7-1500 and an existing legacy system running on S7-300 / S7-400.