0% found this document useful (0 votes)
30 views29 pages

CrossLink DOC en

cross link digital twin siemens
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views29 pages

CrossLink DOC en

cross link digital twin siemens
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 29

Digitalization with TIA

Portal: Virtual
Commissioning by
basic behavior
modelling with
SIMATIC S7-PLCSIM
Advanced

TIA Portal
Siemens
SIMATIC S7-PLCSIM Advanced Industry
Online
https://support.industry.siemens.com/cs/ww/en/view/109754823 Support
Legal information

Legal information
Use of application examples
Application examples illustrate the solution of automation tasks through an interaction of several
components in the form of text, graphics and/or software modules. The application examples are
a free service by Siemens AG and/or a subsidiary of Siemens AG (“Siemens”). They are non-
binding and make no claim to completeness or functionality regarding configuration and
equipment. The application examples merely offer help with typical tasks; they do not constitute
customer-specific solutions. You yourself are responsible for the proper and safe operation of the
products in accordance with applicable regulations and must also check the function of the
respective application example and customize it for your system.
Siemens grants you the non-exclusive, non-sublicensable and non-transferable right to have the
application examples used by technically trained personnel. Any change to the application
examples is your responsibility. Sharing the application examples with third parties or copying the
application examples or excerpts thereof is permitted only in combination with your own products.
The application examples are not required to undergo the customary tests and quality inspections
of a chargeable product; they may have functional and performance defects as well as errors. It is
your responsibility to use them in such a manner that any malfunctions that may occur do not
result in property damage or injury to persons.

Disclaimer of liability
Siemens shall not assume any liability, for any legal reason whatsoever, including, without
limitation, liability for the usability, availability, completeness and freedom from defects of the
application examples as well as for related information, configuration and performance data and
any damage caused thereby. This shall not apply in cases of mandatory liability, for example
under the German Product Liability Act, or in cases of intent, gross negligence, or culpable loss of
life, bodily injury or damage to health, non-compliance with a guarantee, fraudulent
 Siemens AG Copyright 2018 All rights reserved

non-disclosure of a defect, or culpable breach of material contractual obligations. Claims for


damages arising from a breach of material contractual obligations shall however be limited to the
foreseeable damage typical of the type of agreement, unless liability arises from intent or gross
negligence or is based on loss of life, bodily injury or damage to health. The foregoing provisions
do not imply any change in the burden of proof to your detriment. You shall indemnify Siemens
against existing or future claims of third parties in this connection except where Siemens is
mandatorily liable.
By using the application examples you acknowledge that Siemens cannot be held liable for any
damage beyond the liability provisions described.

Other information
Siemens reserves the right to make changes to the application examples at any time without
notice. In case of discrepancies between the suggestions in the application examples and other
Siemens publications such as catalogs, the content of the other documentation shall have
precedence.
The Siemens terms of use (https://support.industry.siemens.com) shall also apply.

Security information
Siemens provides products and solutions with industrial security functions that support the secure
operation of plants, systems, machines and networks.
In order to protect plants, systems, machines and networks against cyber threats, it is necessary
to implement – and continuously maintain – a holistic, state-of-the-art industrial security concept.
Siemens’ products and solutions constitute one element of such a concept.
Customers are responsible for preventing unauthorized access to their plants, systems, machines
and networks. Such systems, machines and components should only be connected to an
enterprise network or the internet if and to the extent such a connection is necessary and only
when appropriate security measures (e.g. firewalls and/or network segmentation) are in place.
For additional information on industrial security measures that may be implemented, please visit
https://www.siemens.com/industrialsecurity.
Siemens’ products and solutions undergo continuous development to make them more secure.
Siemens strongly recommends that product updates are applied as soon as they are available
and that the latest product versions are used. Use of product versions that are no longer
supported, and failure to apply the latest updates may increase customer’s exposure to cyber
threats.
To stay informed about product updates, subscribe to the Siemens Industrial Security RSS Feed
at: http://www.siemens.com/industrialsecurity.

CrossLink
Entry-ID: 109754823, V1.0, 02/2018 2
Table of contents

Table of contents
Legal information ......................................................................................................... 2
1 Introduction ........................................................................................................ 4
1.1 Overview............................................................................................... 4
1.2 Mode of operation ................................................................................ 6
1.3 Components used .............................................................................. 10
2 Valve application ............................................................................................. 11
2.1 Automation task .................................................................................. 11
2.2 Setup simulation platform ................................................................... 15
2.3 Operating simulation platform ............................................................ 17
3 Drive application .............................................................................................. 18
3.1 Automation task .................................................................................. 18
3.2 Setup simulation platform ................................................................... 21
3.3 Operating simulation platform ............................................................ 26
4 Appendix .......................................................................................................... 28
4.1 Service and Support ........................................................................... 28
4.2 Links and Literature ............................................................................ 29
4.3 Change documentation ...................................................................... 29
 Siemens AG Copyright 2018 All rights reserved

CrossLink
Entry-ID: 109754823, V1.0, 02/2018 3
1 Introduction

1 Introduction
1.1 Overview
With the SIMATIC S7-PLCSIM Advanced virtual controllers for the simulation of a
S7-1500 or ET 200SP CPU are created and used for the comprehensive simulation
of functions. Therefore no real controllers are required to test a STEP 7 program.
The virtual controllers can also be tested and validated in the context of a system
or machine. The application programming interface (API) allows manipulating the
IOs and is used to connect the virtual controller to a virtual model of a machine or
plant. Depending on the validation questions that should be answered by the
simulation, a virtual model of a machine or plant can include two components:
 Simulation of the physical behavior, for example, realized with NX
Mechatronics Concept Designer
 Behavior simulation of active components such as, for example, drive or valves
One possibility to realize simple behavior models is to use STEP 7 and simulate it
in an own PLCSIM Advanced instance.
This application example provides a crosslink application (here called "Crosslink"),
which deals as an IO signal exchange unit between two instances of the virtual
controller via API of the PLCSIM Advanced. One instance is in charge of the plant
control and the second instance simulates the device behavior. This is the basis to
 Siemens AG Copyright 2018 All rights reserved

develop own behavior models in STEP 7 and connect them to the program that
shall be validated.

Figure 1-1

In this documentation the usage of the crosslink application is demonstrated by the


following two use cases:
 Simulation of a valve control with ET 200SP IOs and a CPU 1511-1PN
 Simulation of a conveyor controlled by SINAMICS V90 drive and a
CPU 1511-1PN

Advantages of the application example


 Comprehensive simulation of controller functionality with SIMATIC S7-PLCSIM
Advanced
 Connection of virtual models of machine functionality via open API depending
on requirements and application
 Generation of a digital twin with equivalent inputs/outputs as test bench

CrossLink
Entry-ID: 109754823, V1.0, 02/2018 4
1 Introduction

Restrictions of the application example


 No library for behavior models available. Engineering effort has to be spent to
create behavior models, depending of the model complexity.
 Limited to SIMATIC S7-1500 applications
 STEP 7 behavior models cannot be migrated to SIMIT
 Siemens AG Copyright 2018 All rights reserved

CrossLink
Entry-ID: 109754823, V1.0, 02/2018 5
1 Introduction

1.2 Mode of operation


Crosslink is a C# based application which establishes the connection between two
instances of a PLCSIM Advanced virtual controller and manages the exchange of
the IO data between the two instances. The exchange is triggered by an API event
at the end of the program cycle in the virtual controller.
Instance #1 is the "Main Control" and contains the program for the plant control.
Instance #2 is the "Device Simulation" and contains a program which reacts on the
outputs from instance #1 (control signals) and simulates the behavior of the
devices (return signals).

General functionality
As shown in the Figure 1-2 Crosslink is cyclically executing the following
procedure:
 Copying the whole output image of instance #1 to the input image of
instance #2
 Copying the whole output image of instance #2 to the input image of
instance #1
The result of the simulation can be observed over a HMI.
 Siemens AG Copyright 2018 All rights reserved

Figure 1-2

The IO data exchange can be done in following two Crosslink modes:


 No Sync
 Cycle Sync

Crosslink Mode – No Sync


Depending on the program executed in the instance #1 and instance #2 the scan
time of the Main OB1 may be different.
The API from PLCSIM Advanced provides a trigger signal (end of cycle) each time
the Main OB1 scan had been finalized.
Once a trigger signal is detected and the Crosslink Mode “No Sync” is selected,
Crosslink writes the recent output image of the partner instance to the input image
of the instance that had generated the trigger.
Since the scan times of the Main OB1 of both instances are different, the data
exchange happens asynchronously. If the scan time of the Main OB1 from the
instance #1 e.g. takes longer than the instance #2, the next cycle of the
instance #2 will use the same input data as the previous one.

CrossLink
Entry-ID: 109754823, V1.0, 02/2018 6
1 Introduction

Figure 1-3

Crosslink Mode – Cycle Sync


 Siemens AG Copyright 2018 All rights reserved

Contrary to the Crosslink Mode “No Sync” the mode “Cycle Sync” Crosslink is
freezing the Main OB1 after each scan.
Once the trigger signal of both PLCSIM Advanced instances are detected by
Crosslink, it starts exchanging the IO images as described previously.
Once the synchronization procedure has been finalized, Crosslink is releasing the
freeze mode of both instances.

Figure 1-4

CrossLink
Entry-ID: 109754823, V1.0, 02/2018 7
1 Introduction

Operating screen
The following figure and table describe the functionality of the operating screen of
the Crosslink.

Figure 1-5

2 2

5
 Siemens AG Copyright 2018 All rights reserved

6 6
8 8

Table 1-1
No Function
1. Combo boxes to select the available PLCSIM Advanced instances
2. Status information of the selected PLCSIM Advanced instance provided by the
API :
 Instance number
 Instance name
 Program name
 Status: STOP/ RUN
 Execution mode
 Executed number Main OB1 scans

CrossLink
Entry-ID: 109754823, V1.0, 02/2018 8
1 Introduction

No Function
 Instance time
3. Push button “Add Connection” to establish a one way connection between the
instances with cyclic copying the PLCSIM Advanced output image of instance 1
to the input image of instance 2. The result is displayed in (9)
4. Push button “Add Exchange” to establish a two way connection between the
instances with cyclic copying the PLCSIM Advanced output image of instance 1
to the input image of instance 2 and the output image of instance 2 to the input
image of instance 1. The result is displayed in (9)
5. Push button “Clear” to terminate the IO image exchange processes from (3) and
(4)
6. Cycle mode
 Cycle Sync: Freezes related instance Main OB1 scan until partner instance
scan of Main OB1 has been finalized too, then executes IO image exchange
and then proceeds with the next Main OB1 scan
 No Sync: Exchanges IO data asynchronously from the status of the partner
Main OB1 scan
7. Enabling this feature allows to execute a single Main OB1 scan only. Both
instances are frozen until the next scan will be executed by pressing the push
button “Execute Step”
8. Operating the instances
 RUN: Switch instance in RUN mode

 Siemens AG Copyright 2018 All rights reserved

STOP: Switch instance in STOP mode


 STEP: Execute next single scan, if the “Single Step mode” is selected
(this will only influence the selected instance)
9. Display the status of the IO image exchange processes

CrossLink
Entry-ID: 109754823, V1.0, 02/2018 9
1 Introduction

1.3 Components used


Hardware

NOTE No real hardware is used in this application example. All hardware components
configured are simulated.

This application example has been created with the following hardware
components:
Table 1-2
Component Number Article number Note
CPU 1511-1 PN 2 6ES7 511-1AK01-0AB0 V2.0
TP700 Comfort 1 6AV2124-0GC01-0AX0 V14.0.1.0
IM 155-6 PN ST 1 6ES7 155-6AU01-0BN0 V4.1
SINAMICS V90 PN 1 6SL3 210-5FB10-1UF0 HSP0185

Software
This application example has been created with the following software
 Siemens AG Copyright 2018 All rights reserved

components:
Table 1-3
Component Number Article number Note
SIMATIC S7-PLCSIM 1 6ES7823-1FA00-0YA5 Two instances are
Advanced V1.0 SP1 used
SIMATIC STEP 7 1 6ES7822-1AA04-0YA5 -
Professional V14 SP1
SIMATIC WinCC Comfort 1 6AV2101-0AA04-0AA5 -
V14 SP1

Download
This application example consists of the following components:
Table 1-4
Component File name Note
Documentation 109754823_CrossLink_DOC_en.pdf -
Crosslink application 109754823_CrossLink_APPL.zip C# based exe file
Sample project 109754823_CrossLinkValve_PROJ.zip TIA V14 SP1
simulating a valve
control
Sample project 109754823_CrossLinkDrive_PROJ.zip TIA V14 SP1
simulating a SINAMICS
V90 drive

CrossLink
Entry-ID: 109754823, V1.0, 02/2018 10
2 Valve application

2 Valve application
2.1 Automation task
Devices
Figure 2-1

Hardware Configuration
Figure 2-2
 Siemens AG Copyright 2018 All rights reserved

CrossLink
Entry-ID: 109754823, V1.0, 02/2018 11
2 Valve application

Functional requirements
 The valve behavior shall be simulated by generating a feedback signal for
Valve_1 and Valve_2
 E.g. the control signal “v1Open” sent to Valve_1 shall be confirmed with the
feedback signal “v1Opened” delayed by 500ms
 For operating the process a TP700 Comfort Panel shall be added:
– To open and close the valves
– To display the feedback of the valves in the valve icon and in a message
box

Figure 2-3
 Siemens AG Copyright 2018 All rights reserved

CrossLink
Entry-ID: 109754823, V1.0, 02/2018 12
2 Valve application

Program structure of PLCSIM Advance instance “ValveCtrl”


Figure 2-4

Main [OB1]
 Siemens AG Copyright 2018 All rights reserved

CrossLink
Entry-ID: 109754823, V1.0, 02/2018 13
2 Valve application

Program structure of PLCSIM Advanced instance “Simulation”


Figure 2-5

Main [OB1]
 Siemens AG Copyright 2018 All rights reserved

Each received valve control signal is delayed by 500ms and sent back to the
PLCSIM Advanced instance “ValveCtrl”

CrossLink
Entry-ID: 109754823, V1.0, 02/2018 14
2 Valve application

2.2 Setup simulation platform


Configuration
Figure 2-6
 Siemens AG Copyright 2018 All rights reserved

Setup application
Table 2-1
No Action Commentaries
1. Execute PLCSIM Advanced with
Administrator rights.

2. Extract the following Zip files:


 109754823_CrossLink_APPL.zip
 109754823_CrossLinkValve_PROJ
.zip
3. Open the TIA project “CrossLinkValve”

CrossLink
Entry-ID: 109754823, V1.0, 02/2018 15
2 Valve application

No Action Commentaries
4. Create a new PLCSIM Advanced
instance with the name “ValveCtrl”

5. Download the Program “ValveCtrl” into


the PLCSIM Advanced instance #1 and
switch its mode to RUN by checking the
dialog “Start all”

nd
6. Create a 2 PLCSIM Advanced
instance called “Simulation”

7. Download the Program “Simulation” into


 Siemens AG Copyright 2018 All rights reserved

the PLCSIM Advanced instance #2 and


switch its mode to RUN by checking the
dialog “Start all”

8. Both PLCSIM Advanced instances shall


now come up with the status in the
attached picture

9.  Open the folder where the file


“109754823_CrossLink_APPL.zip”
had been extracted by Explore
 Launch the marked exe file

10.  Select “ValveCtrl” in the left Combo


box
 Select “Simulation” in the right the
Combo box
 Press the button “Add Exchange”

CrossLink
Entry-ID: 109754823, V1.0, 02/2018 16
2 Valve application

2.3 Operating simulation platform


Table 2-2
No Action Commentaries
1. Switch the project “HMI_1” into
simulation mode.

2. Pressing the push buttons “Open” and


“Close” allows a manual operation of
the valve status.

3. Open the watch table “ValveCtrl” of the


 Siemens AG Copyright 2018 All rights reserved

project “ValveCtrl” and monitor the IO


status of the control and feedback
signals.

4. Open the watch table “Simulation” of the


project “Simulation” and monitor the IO
status of the control and feedback
signals.

CrossLink
Entry-ID: 109754823, V1.0, 02/2018 17
3 Drive application

3 Drive application
3.1 Automation task
Devices
Figure 3-1

Hardware Configuration
Figure 3-2
 Siemens AG Copyright 2018 All rights reserved

NOTE For the SINAMICS V90 you need the HSP0185 SINAMICS V90 PN V2.0. You
can download the HSP under the following link:
https://support.industry.siemens.com/cs/ww/en/view/72341852

Unrestricted

CrossLink
Entry-ID: 109754823, V1.0, 02/2018 18
3 Drive application

Functional requirements
 Control
– A CPU 1511-1PN shall control the SINAMICS V90 drive via PROFIDrive
with the purpose of positioning a conveyor
– Technology Object: Positioning control
– The motion control commands shall be executed by using the TO control
panel and the MC-Commands MC_POWER, MC_JOG and
MC_MOVERELATIVE
 Motion Control parameters
– SINAMICS V90PN drive shall be controlled via PROFINET in RT by
standard PROFIDrive telegram 3 with a sample time of 4ms
– Axis type: Linear
– Reference speed: 3000 r/min
– Max. speed: 3000 r/min
– Measuring system: rotary
– Increments per revolution: 2048
– Gear: 1:1
– Leadscrew pitch: 10 mm
 HMI
 Siemens AG Copyright 2018 All rights reserved

– Enable/disable the drive


– JOG the conveyor in forward and backward direction with a given speed
– Relatively position the conveyor in both directions

CrossLink
Entry-ID: 109754823, V1.0, 02/2018 19
3 Drive application

Figure 3-3
 Siemens AG Copyright 2018 All rights reserved

CrossLink
Entry-ID: 109754823, V1.0, 02/2018 20
3 Drive application

3.2 Setup simulation platform


Configuration
Figure 3-4
 Siemens AG Copyright 2018 All rights reserved

CrossLink
Entry-ID: 109754823, V1.0, 02/2018 21
3 Drive application

Program structure of PLCSIM Advance instance “DriveCtrl”


Figure 3-5

Main [OB1] McServo [OB91]

Cycle time (ms) = 4.0

McInterpolar [OB92]
 Siemens AG Copyright 2018 All rights reserved

 The organization block “McServo”, called with a sample time of 4ms, calculates
based on the settings of the Technology Object the required speed which is
sent via PROFIDrive telegram 3 to the instance “Simulation”
 To enable the axis and execute either a MOVEJOG or MOVERELATIVE
command, in Main OB1 the related MC blocks are called

CrossLink
Entry-ID: 109754823, V1.0, 02/2018 22
3 Drive application

Program structure of PLCSIM Advanced instance “Simulation”


Figure 3-6

Main [OB1] CyclicInterrupt [OB30]


Cyclic time (µs) = 4000

Data [DB3]
 Siemens AG Copyright 2018 All rights reserved

 The function block “ProfiDriveTel3” is extracting the received speed and


calculates based on the Drive parameters” the conveyor “actualVelocity”
 The function block LSim_I (Entry ID: 79047707) acting as an integrator with a
sample time of 4ms calculates the travelled distance (“actualPosition”) based
on the “actualVelocity”
 The function block “ProfiDriveTel3” recalculated the travelled distance
(“actualPosition”) to telegram 3 compatible values and forward these data back
to the instance “DriveCtrl”

Setup application
Table 3-1
No Action Commentaries
1. Launch PLCSIM Advanced in
administration mode

2. Extract the following Zip files:


 109754823_CrossLink_APPL.zip
 109754823_CrossLinkDrive_PROJ.
zip

CrossLink
Entry-ID: 109754823, V1.0, 02/2018 23
3 Drive application

No Action Commentaries
3. Open the TIA project “CrossLinkDrive“

4. Create a new PLCSIM Advanced


instance with the name “DriveCtrl”

5. Download the Program “DriveCtrl” into


the PLCSIM Advanced instance #1 and
switch its mode to RUN by checking the
dialog “Start all”

nd
6. Create a 2 PLCSIM Advanced
instance called “Simulation”
 Siemens AG Copyright 2018 All rights reserved

7. Download the Program “Simulation” into


the PLCSIM Advanced instance #2 and
switch its mode to RUN by checking the
dialog “Start all”

8. Both PLCSIM Advanced instances shall


now come up with the status in the
attached picture
9.  Open the folder where the file
“109754823_CrossLink_APPL.zip”
had been extracted by Explore
 Launch the marked exe file

CrossLink
Entry-ID: 109754823, V1.0, 02/2018 24
3 Drive application

No Action Commentaries
10.  Select “DriveCtrl” in the left Combo
box
 Select “Simulation” in the right the
Combo box
 Press the button “Add Exchange”
 Siemens AG Copyright 2018 All rights reserved

CrossLink
Entry-ID: 109754823, V1.0, 02/2018 25
3 Drive application

3.3 Operating simulation platform


Move axis by MC commands
Table 3-2
No Action Commentaries
1. Switch the project “HMI_1” into
simulation mode

2. Pressing the push buttons “Enable”


enables the Drive
 Siemens AG Copyright 2018 All rights reserved

3. Open the watch table “Interface” of the


project “Simulation” and recognize that
the variable “Data”.driveEnabled had
been switched to TRUE

4.  Enter Distance 1000 mm


 Enter Velocity 50 mm/s
 Press push button “Execute”

5. In the watch table “Simulation” of the


project “Simulation” the variable
“Data”.actualPosition comes up with
1000.0 mm once the positioning job has
been executed successfully

CrossLink
Entry-ID: 109754823, V1.0, 02/2018 26
3 Drive application

Move axis by control panel


Table 3-3
No Action Commentaries
1. Open the control panel
“Commissioning” of the project
“DriveCtrl”

2.  Press the push button “Activate”


 Press the push button “Enable”

3. Open the watch table “Interface” of the


project “Simulation” and recognize that
the variable “Data”.driveEnabled had
been switched to TRUE
 Siemens AG Copyright 2018 All rights reserved

4.  Select “Positioning Relative”


 Enter Distance 1000 mm
 Enter Velocity 50 mm/s

5.  Press push button “Forward”

6. In the watch table “Simulation” of the


project “Simulation” the variable
“Data”.actualPosition comes up with
1000.0 mm once the positioning job has
been executed successfully

CrossLink
Entry-ID: 109754823, V1.0, 02/2018 27
4 Appendix

4 Appendix
4.1 Service and Support
Industry Online Support
Do you have any questions or need assistance?
Siemens Industry Online Support offers round the clock access to our entire
service and support know-how and portfolio.
The Industry Online Support is the central address for information about our
products, solutions and services.
Product information, manuals, downloads, FAQs, application examples and videos
– all information is accessible with just a few mouse clicks at:
https://support.industry.siemens.com

Technical Support
The Technical Support of Siemens Industry provides you fast and competent
support regarding all technical queries with numerous tailor-made offers
– ranging from basic support to individual support contracts. You send queries to
Technical Support via Web form:
www.siemens.com/industry/supportrequest
 Siemens AG Copyright 2018 All rights reserved

SITRAIN – Training for Industry


With our globally available training courses for our products and solutions, we help
you achieve with practical experience, innovative learning methods and a concept
that’s tailored to the customer’s specific needs.
For more information on our offered trainings and courses, as well as their
locations and dates, refer to:
www.siemens.com/sitrain

Service offer
Our range of services includes the following:
 Plant data services
 Spare parts services
 Repair services
 On-site and maintenance services
 Retrofitting and modernization services
 Service programs and contracts
You can find detailed information on our range of services in the service catalog:
https://support.industry.siemens.com/cs/sc

Industry Online Support app


You will receive optimum support wherever you are with the "Siemens Industry
Online Support" app. The app is available for Apple iOS, Android and Windows
Phone:
https://support.industry.siemens.com/cs/ww/en/sc/2067

CrossLink
Entry-ID: 109754823, V1.0, 02/2018 28
4 Appendix

4.2 Links and Literature


Table 4-1
No. Topic
\1\ Siemens Industry Online Support
https://support.industry.siemens.com
\2\ Link to this entry page of this application example
https://support.industry.siemens.com/cs/ww/en/view/109754823
\3\ Digitalization with SIMATIC TIA Portal
https://support.industry.siemens.com/cs/ww/en/view/109750456

4.3 Change documentation


Table 4-2
Version Date Modifications
V1.0 02/2018 First version
 Siemens AG Copyright 2018 All rights reserved

CrossLink
Entry-ID: 109754823, V1.0, 02/2018 29

You might also like