You are on page 1of 52

SIMATIC

S7-PLCSIM Advanced V1.0


Simulation with TIA Portal V14 and PLCSIM Advanced

Restricted Siemens AG 2016 siemens.com/tia-portal


Simulation
What solutions does Siemens offer?

Requirement Siemens solution

PLCSIM V14
Mapping of the controller
functionality in a model PLCSIM Advanced V1.0
NEW

Mechatronics Concept Designer

Process Simulate
Mapping of the plant/machine in
a model SIMIT

Target 1500S for SIMULINK

Restricted Siemens AG 2016


Page 2 March 2016
PLCSIM Advanced
to create virtual controllers

Simulation
PLCSIMsystem
Advanced

Virtual controller

1) With SIMATIC S7-PLCSIM Advanced, virtual controllers can


be used for simulation of S7-1500 and ET 200SP CPUs and
for comprehensive function simulation.
API

2) The virtual controllers can also be tested and validated in in


the context of a plant/machine.
To connect to a plant/machine simulation = co-simulation
an API is available.
Virtual plant/machine

Plant/Machine simulation
= Co-simulation
Restricted Siemens AG 2016
Page 3 March 2016
PLCSIM Advanced
Basis for software in the loop

Real world Virtual world

S7-1500 hardware controller PLCSIM Advanced


Virtual S7-1500 controller PLCSIM
Controller

Advanced
as basis for
"Software
in the Loop"

API Extensive function


simulation without adapting
the STEP 7 program
Process

Co-simulation
Interface for a connection
to different co-simulations
via API

Restricted Siemens AG 2016


Page 4 March 2016
PLCSIM Advanced
Supported controllers: S7-1500 CPU incl. C/F/T and ET200SP CPU incl. F

Virtual
S7-1500 controller
S7-1500C

S7-1500T(F)

ET 200SP(F)
Mapping of the real CPU
S7-1500F controller

Restricted Siemens AG 2016


Page 5 March 2016
PLCSIM vs. PLCSIM Advanced
What are the differences in the functionality?

Real world Virtual world

Real controller PLCSIM


Simulation of
the logic of
the controller IO simulation IO simulation
program Button/ PLCSIM operator
Simulator LEDs panel

Simulation of Real controller PLCSIM Advanced


the controller
in the context NEW
of the plant /
machine Prototype/
Co-simulation
Real plant

Restricted Siemens AG 2016


Page 6 March 2016
PLCSIM vs. PLCSIM Advanced
What are the differences in the functionality?

S7-1200 (F)/
PLCSIM / S7-1500 (F/T) / PLCSIM Advanced

API
up to 2 Multiple instances up to 16

Distributed instances
OPC UA
Web server
Process diagnostics
( ) Traces
Virtual S7-1500 controller
Integrated controller simulation ( ) Motion
in STEP 7 in TIA Portal via softbus S7 communication Applications:
via softbus Open User communication Functional test of the STEP 7
Use case: program also in the context of a
know how protected blocks plant/machine
Functional test and validation of the
Virtual time Operator training
STEP 7 program
Connection of real PLCs/HMIs
Virtual commissioning / Factory
DNS use Acceptance Test (FAT)
Restricted Siemens AG 2016
Virtual memory card
Page 7 March 2016
PLCSIM Advanced
Multiple and distributed instances

Various configurations are supported:


Support of multiple instances; PC1 S7-1500 S7-1500
Instance 1 Instance 2
recommendation: WinCC Panel
PC
4 GB RAM for one instance clock

4 instances on a PC with 8 GB RAM


(16 instances can technically be started)
Support of distributed instances
PC2 S7-1500
for load distribution Instance 3
STEP 7

communication via TCP/IP PC


clock
Connection of real devices (HMIs /
controllers) is possible
Virtual time
connection of real I/Os is not possible
Slow Virtual time Fast

Restricted Siemens AG 2016


Page 8 March 2016
PLCSIM Advanced
Multiple instances in combination with a co-simulation

Various configurations are supported:


PC1 S7-1500 S7-1500
Support of multiple instances in combination Instance 1 Instance 2
with a co-simulation software
PC
clock in the
Connection of PLCSIM Advanced loop
instances with co-simulation via virtual
time

PC2 Co-simulation STEP 7

Virtual time

Slow Virtual time Fast

Restricted Siemens AG 2016


Page 9 March 2016
PLCSIM Advanced
Virtual time what does it mean and how can it be used?

Two types of clocks are used for the simulation: OB 1 OB 1

Virtual clock: Basis for the user program;


Cycle control point
Duration between two cycle control points is Internal process image of
measured in virtual time the virtual controller

Real clock: Communication with STEP 7 read IOs


write IOs
API

How can the virtual time be used? A freeze state stops the virtual controller at a cycle
Gradual debugging of the STEP 7 program; control point:

the virtual controller can be stopped (freeze state) at Virtual time is stopped
the cycle control point, which is at the end of a OB1 No OBs are running, no timers
call, and I/Os can be read or manipulated
User program is not executed any longer
The freeze state is also used for synchronization
with the simulation partners. Virtual controller is in a state with consistent input
and output data

Restricted Siemens AG 2016


Page 10 March 2016
PLCSIM Advanced
How can the virtual time be used?

Manipulation of the virtual time


Virtual time
Slow motion (scaling factor < 1):
e.g. scaling factor 0.5 = virtual time is slowed down by Slow motion Virtual time Fast mode
0.01 100
50%
Cyclic OBs are called less frequently during a OB1
cycle Slow motion
OB 1 OB 1
Fast mode (scaling factor > 1):
e.g. scaling factor 2 = virtual time runs twice as fast Cycle
control point
Cyclic OBs are called more frequently during a
OB1 cycle Fast mode

Note: OB1 always runs at the same speed and only OB 1 OB 1


depends on the performance of the PC if you change
the scaling factor, more or fewer cycle control points are Cycle
reached within a fixed time period control point
Cyclic OB

Restricted Siemens AG 2016


Page 11 March 2016
PLCSIM Advanced
Connection with a co-simulation (1)

Planning and
configuring
Result Test in virtual environment

Automation STEP 7 program PLCSIM Advanced


with TIA Portal virtual controller

software
Signal connection via API in the
Hardware loop
configuration Co-simulation
(incl. signal list)
Definition of kinematics

Mechanical design Sequence planning


with CAD (sequences)
Motion
CAD model
relations and profiles
Simulation of kinematics
Definition of sensors
and actuators

Restricted Siemens AG 2016


Page 12 March 2016
PLCSIM Advanced
Connection with a co-simulation

Planning and
configuring
Result Test in virtual environment

Automation STEP 7 program PLCSIM Advanced


with TIA Portal virtual controller

software
Signal connection via API in the
Hardware loop
configuration Plant/machine simulation in C++ / C#
(incl. signal list)
Sequence planning
(sequences)
Motion relations and profiles

Plant/machine
know-how
Definition of sensors
and actuators C++ / C#

Restricted Siemens AG 2016


Page 13 March 2016
PLCSIM Advanced
Benefits of a virtual controller

Engineering Commissioning Production


Realistic function test of the Test of the STEP 7 program in Early training of the operator is
STEP 7 program combination with a possible (Operator training)
Early error detection and plant/machine simulation prior Increased efficiency thanks to
validation of the functionality to commissioning optimization of program parts
High quality of the STEP 7 High quality of the Quick replacement of machine PLCSIM
program code automation project components (migration) / quick
Advanced
No real S7-CPU hardware Reduction in time-to- expansion of existing plants as basis for
production "Software
required in the Loop"
Savings in hardware costs

High engineering quality High project quality High productivity

Restricted Siemens AG 2016


Page 14 March 2016
PLCSIM Advanced
Benefits of virtual commissioning

Conven- Concept Planning and configuring Commissioning Operation


tional
commi-
ssioning
Time in the office Time at the
customer plant

Virtual Com
With Planning and configuring +
Concept commiss missi Operation
virtual Create a model of the plant oning
ioning
commis
sioning
Time in the office Time at the
customer plant

Create a model of Reduced


Quick
the plant = effort commissioning
Time-to-Production
time at the
customer plant
Restricted Siemens AG 2016
Page 15 March 2016
PLCSIM Advanced
Licensing concept and list price

Licensing concept:
Instance 1 Instance 2 Instance 3
Floating license
Enterprise License (EPL)
One license per instance

List price per instance:


2.500 (download)
2.750 (DVD)
Download available in SIOS from CW16 on:
https://support.industry.siemens.com/cs/de/en/view/109745647

Restricted Siemens AG 2016


Page 16 March 2016
Requirements and
restrictions
Restricted Siemens AG 2016 siemens.com/tia-portal
PLCSIM Advanced
Basic knowledge required

Knowledge of the following is considered essential: STEP 7 program

Industrial automation and automation technology


Programming with STEP 7 (TIA Portal)
SIMATIC PLCs (S7-1500 & ET200SP PLC)
Development of software in C++ and C#
with MS Visual Studio 2015 (WPF and MVVM recommended)
C++ / C#
OR
Co-simulation software like MCD V12 and Matlab/ SIMULINK
PC technology / Windows operating system Co-simulation

Restricted Siemens AG 2016


Page 18 March 2016
PLCSIM Advanced
Basic knowledge required Data exchange

PLCSIM Adv.
Instance 1

PII C
Prg
PIO A

MVVM

B
A

B
C
Restricted Siemens AG 2016
Page 19 March 2016
PLCSIM Advanced
Basic knowledge required WPF and MVVM

Model View ViewModel

Restricted Siemens AG 2016


Page 20 March 2016
PLCSIM Advanced
Basic knowledge required WPF and MVVM

Model View ViewModel

Restricted Siemens AG 2016


Page 21 March 2016
PLCSIM Advanced
Basic knowledge required WPF and MVVM

Model View ViewModel

Restricted Siemens AG 2016


Page 22 March 2016
PLCSIM Advanced
Hardware/software requirements + supported virtualization platforms

Hardware / software Minimum requirement


Processor 2.2 GHz Intel Celeron Dual Core
RAM 4 GB for one instance
8 GB for 4 instances
Free hard disk space 5 GB
Operating system (64-bit) Windows 7 Home Premium SP1 Supported virtualization platforms:
Windows 7 Professional SP1 VMware vSphere Hypervisor (ESXi) 6.0
Windows 7 Enterprise SP1
Windows 7 Ultimate SP1 VMWare Workstation 12 Pro
Windows Server 2012 R2 StdE VMware Workstation Player 12
Screen resolution 1024 x 768
Microsoft Windows Server 2010 R2 Hyper-V

Restricted Siemens AG 2016


Page 23 March 2016
Specific constraints

S7-PLCSIM Advanced and S7-PLCSIM cannot be installed on the same PC.


Not real-time capable / deterministic program cannot be evaluated based on the time results of the
simulation
No support of bus systems (PROFINET IO, PROFIBUS DP, rear panel bus)
The user interface (API) does not offer authentication and authorization options
No support of security mechanisms for Web server (HTTPS) and for OPC UA (certificates)
The simulation communication across computers is not encrypted.
We recommend using a separated simulation network that is not connected to a productive network.
Integrated I/O modules within the compact PLCs as well as the configured I/O modules are not simulated.
The ODK functionality of the 1517 and 1518 CPUs is not simulated.
No support of S7-1200, ET 200pro (F), ET 200SP CPU Open Controller, Software Controller
No simulation of alarms, recipes, data logging, "backup and restore" of PLCs

Restricted Siemens AG 2016


Page 24 March 2016
Simulation with
PLCSIM Advanced V1.0
in TIA Portal V14
Restricted Siemens AG 2016 siemens.com/tia-portal
PLCSIM Advanced
How to simulate with PLCSIM Advanced within TIA Portal

To use a STEP 7 project with PLCSIM Advanced, the ability to simulate the blocks must first be enabled in
the project properties in the Protection tab.

1 2

3
Compiling the project activates the ability to simulate the blocks
If the project already includes know-how protected blocks, these must be
unlocked by entering a password and then these blocks need to be
compiled individually.

Restricted Siemens AG 2016


Page 26 March 2016
PLCSIM Advanced
Checking the ability to simulate specific blocks

The ability to simulate specific


blocks can be checked by means of
the block properties under
"Compilation".
(display field no input field!)

Restricted Siemens AG 2016


Page 27 March 2016
PLCSIM Advanced
Handling blocks from libraries

Handling of blocks from existing libraries: blocks which have been stored in the library without simulation support:

1
Blocks must be edited / set to "in test"

2
By compiling the blocks again, the check mark for the ability to be simulated is set; a
new type of the block must be published in the library

Restricted Siemens AG 2016


Page 28 March 2016
PLCSIM Advanced V1.0
Control Panel
Restricted Siemens AG 2016 siemens.com/tia-portal
PLCSIM Advanced Control Panel
for the PLCSIM Adv. Instance Management

Tray icon in the taskbar


Right-click starts the Control
Panel of PLCSIM Advanced

Notes:
The Control Panel is optional and is not required for
operation of PLCSIM Advanced via the API.
The Control Panel is available in English in version V1.0.

Restricted Siemens AG 2016


Page 30 March 2016
PLCSIM Advanced Control Panel
Setting of the communication interface

Selecting the communication interface


PLCSIM Softbus
PLCSIM Virtual Eth. Adapter TCP/IP

Softbus PLCSIM Virtual Ethernet Adapter


The communication between different instances is Multiple instances can communicate with each other
limited to a local PC. over distributed computers.
STEP 7 needs to be installed on the same computer. STEP 7 can be installed on another computer.
OPC UA and Web server communication are not OPC UA and Web server communication are supported.
supported. Real PLCs/ real HMIs can be connected.
Real PLCs / real HMIs cannot be connected. Real T block communication
Simulated T block communication

Restricted Siemens AG 2016


Page 31 March 2016
PLCSIM Advanced Control Panel
Setting of the communication interface and the virtual time

Selecting the network adapter for


distributed communication
<Local> disables the PLCSIM virtual switch
and disconnects the instances from the real
network = local TCP/IP communication.

Setting of the virtual time:


100 = 100x faster than PC clock
0.01 = 100x slower than PC clock

Restricted Siemens AG 2016


Page 32 March 2016
PLCSIM Advanced Control Panel
Creating virtual controllers (PLCSIM Softbus)

Creating the virtual controllers; definition of


Instance name; when the name already
exists in the directory of the Virtual SIMATIC
Memory Card, this existing instance is started.
PLC type (unspecified 1500/ET200SP PLC)

Visual feedback regarding the status of the


instances
Up to 16 instances can be started
Acitvation and deactivation of individual
instances is possible

Restricted Siemens AG 2016


Page 33 March 2016
PLCSIM Advanced Control Panel
Creating virtual controllers (PLCSIM Virtual Eth. Adapter TCP/IP)

Creating the virtual controllers; definition of


Instance name; when the name already
exists in the directory of the Virtual SIMATIC
Memory Card, this existing instance is started
IP address; each virtual PLC needs a unique
IP address
Subnet mask
PLC type (unspecified 1500/ET200SP CPU)

Visual feedback regarding the status of the


instances
Up to 16 instances can be started
Enabling and disabling of individual
instances is possible

Restricted Siemens AG 2016


Page 34 March 2016
PLCSIM Advanced Control Panel
Settings

Activation and setting of the Runtime


Manager Port for distributed instances
Is saved and therefore identical after a
restart.

Storage location of the SIMATIC Memory


Card data of the virtual PLCs
The STEP 7 user program, the hardware
configuration and the retentive data are saved
on the virtual SIMATIC Memory Card.

Setting of Balloon Messages

Link to the manual

Exit Control Panel


All local instances are closed.

Restricted Siemens AG 2016


Page 35 March 2016
PLCSIM Advanced V1.0
Communication &
Download
Restricted Siemens AG 2016 siemens.com/tia-portal
PLCSIM Advanced
Operating principle of virtual switch and virtual network adapter

PLCSIM Advanced installs a virtual network adapter


and a virtual switch PC 2
PLCSIM Adv. Virtual network
Connection to the real world is established by Instance 1 adapter with own IP
means of the virtual switch address

PC 1
IP: 10.11.7.20
PLCSIM Adv. Instance 1 Virtual switch
TIA Portal
on PC 2 can be loaded by connects virtual
means of its IP 10.11.7.20 Virtual adapter adapter with real
from the TIA Portal IP: 10.11.7.12 network adapter

Virtual switch

Communication
Network adapter Network adapter takes place via real
IP: 10.11.7.10 IP: 10.11.7.11 network adapter

Network
Restricted Siemens AG 2016
Page 37 March 2016
PLCSIM Advanced
Distributed operation Virtual Switch

To use the PLCSIM Virtual Switch across multiple


computers, it must be enabled in a real network
adapter via:
Control panel
System control

Note:
You have to ensure that the PLCSIM
Virtual Switch is enabled in only one
network adapter (if a computer has more
than one network adapter).

In the project tree, all stations are shown


which can be accessed by means of the
Virtual Ethernet Adapter.

Restricted Siemens AG 2016


Page 38 March 2016
PLCSIM Advanced
Distributed operation Download from TIA Portal

When PLCSIM Virtual Switch is enabled Download directly via Virtual Ethernet
for a real network adapter Adapter
(TIA Portal and PLCSIM Advanced are (TIA Portal and PLCSIM Advanced are
located on different computers) located on the same computer)

Restricted Siemens AG 2016


Page 39 March 2016
PLCSIM Advanced V1.0
API
Restricted Siemens AG 2016 siemens.com/tia-portal
PLCSIM Advanced
Access to instances via the Control Panel and the API

Through the Control Panel you can only access an PC 1 PC 2


instance that is available on the local PC. 1 Control Control
Panel Panel

In case of distributed communication, the Runtime API 1

accesses the instance of the other PC with the Runtime


Runtime API Runtime API
Manager. 2
2 2

Runtime Runtime
The Runtime Manager Port can be set
Manager Manager
in the Control Panel of the respective
PC (also possible directly via API)

Runtime Runtime
instance 1 instance 1

Virtual Virtual
1500 CPU 1500 CPU

Restricted Siemens AG 2016


Page 41 March 2016
PLCSIM Advanced
API interface

API offers methods for:


Access to PLC data Simulation Runtime

(I/Os, bit memories, DBs, timers)


Co-simulation 1
Configuring and controlling PLCSIM Advanced Runtime Manager

Runtime API
instances Co-simulation 2

Comprehensive functionality for C++/C#


programming with Visual Studio Runtime Runtime
instance 1 instance 2
Co-simulations can connect to the
Runtime Manager by means of the provided
Virtual Virtual
API interface 1500 CPU 1500 CPU

Restricted Siemens AG 2016


Page 42 March 2016
PLCSIM Advanced
Code example

Register instance at the SimulationRuntimeManager:


IInstance myInstance = SimulationRuntimeManager.RegisterInstance("MyVirtualController");

Start PLCSIM instance: myInstance.PowerOn();

Set CPU to RUN: myInstance.Run();

Write output (O0.0): myInstance.OutputArea.WriteBit(0, 0, true);

Read input (I0.0): bool value = myInstance.InputArea. ReadBit(0, 0);

Set CPU to STOP: myInstance.Stop();

Restricted Siemens AG 2016


Page 43 March 2016
PLCSIM Advanced V1.0
Applications
Restricted Siemens AG 2016 siemens.com/tia-portal
PLCSIM Advanced
Applications Valve simulation 1

Valve_chocolate Controlling the valves with FB library and


PLCSIM Adv. HMI
Faceplate:
Instance 1
set_open Chocolate
set_close Vanille
Open_feedback
Close_feedback Simulation the IOs of each valve
Set open
Set close
Open_feedback
Close_feedback

Valve library with alarms included Valve face plate

Restricted Siemens AG 2016


Page 45 March 2016
PLCSIM Advanced
Applications Valve simulation 2

Valve_chocolate Controlling the valves with FB library and


PLCSIM Adv. HMI
Faceplate:
Instance 1
set_open Chocolate
set_close Vanille
Open_feedback
Close_feedback Simulation the IOs of each valve
Set open
Set close
Open_feedback
Close_feedback

Valve library with alarms included Valve face plate

Restricted Siemens AG 2016


Page 46 March 2016
PLCSIM Advanced
Applications Cross Link

Controlling a conveyor belt by monitoring a


PLCSIM Adv. Cross Link PLCSIM Adv. HMI
sensor that detects when it has passed the
Instance 2 C# based Instance 1
end

Simulation the actual position of the


A B transported object and the sensor signal
coSimController mainController
IP: 192.168.0.1 IP: 192.168.0.11

B
Restricted Siemens AG 2016
Page 47 March 2016
PLCSIM Advanced
Applications OPC UA

Matlab/
SIMULINK Controlling the alignment of
PLCSIM Adv. HMI the PENDULUM by PID
Instance 1 Compact
OPC UA

.Control_Value Simulation of the PENDULUM


process behavior using a
.Process_Value state space model with
OPC UA Client OPC UA Server Matlab/ SIMULINK

PENDULUM

Restricted Siemens AG 2016


Page 48 March 2016
PLCSIM Advanced
Applications Open User Communication

PLCSIM Adv. PLCSIM Adv.


Instance 2 Instance 1 Pn_io_controller is establishing a
OpenUserCommunication

S7-1500F Pn_io_controller
IP: 192.168.0.100 IP: 192.168.0.102

Restricted Siemens AG 2016


Page 49 March 2016
PLCSIM Advanced
Applications Open User Communication

PLCSIM Adv. PLCSIM Adv.


Instance 2 Instance 1 Pn_io_controller is sending frequently data

S7-1500F controller is receiving data

S7-1500F Pn_io_controller
IP: 192.168.0.100 IP: 192.168.0.102

Restricted Siemens AG 2016


Page 50 March 2016
Your questions our answers

1. Is it possible to simulate blocks from a SIEMENS library like SIWAREX which are know
how protect? We cannot remove know how protect from those blocks.
In this case the Owner of the Siemens library block (e.g. SIWAREX) has to flag the
block with the property Support simulation during block compilation. If this is not
done, it is not possible to simulate this library block with PLCSIM Advanced

2. There is the possibility to connect a PLC SIM Advanced to communicate with a real
CPU, Do you have an example of this?
I have no example but this scenario is not so difficult to realize. The only thing to
consider is to start the PLCSIM Advanced Instance with Online Access PLCSIM
Virtual Ethernet Adapter and to activate the virtual switch (TCP/IP communication
with: ) on the physical network card which is connected to the real PLC.

3. Where can we have more info on this please?


In the function manual some basics are described.

Restricted Siemens AG 2016


Page 51 March 2016
Thank you for your attention!

Annika Simmel
Product Management
DF FA AS E&C PRM 1
Gleiwitzer Str. 555
90475 Nuremberg, Germany

Phone: +49 (911) 895-3236


E-mail: annika.simmel@siemens.com

siemens.com/tia-portal

Restricted Siemens AG 2016


Page 52 March 2016

You might also like