[go: up one dir, main page]

0% found this document useful (0 votes)
87 views37 pages

SimulationModelGenerator DOC v3 4 en

Uploaded by

ChochoRoy
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)
87 views37 pages

SimulationModelGenerator DOC v3 4 en

Uploaded by

ChochoRoy
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/ 37

Simulation Model

Generator V3
Siemens
TIA Portal & SIMIT Industry
Online
https://support.industry.siemens.com/cs/ww/en/view/109780391 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 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
© Siemens AG 2024 All rights reserved

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 under
https://www.siemens.com/cert.

Simulation Model Generator


Entry-ID: 109780391, V3.4, 06/2024 2
Table of contents

Table of contents
Legal information .............................................................................................................................. 2
1 Introduction ............................................................................................................................. 4
1.1 Overview .................................................................................................................... 4
1.2 Principle of operation ................................................................................................. 5
1.3 Generated simulation model ...................................................................................... 6
1.4 Components used...................................................................................................... 7
2 Preparation .............................................................................................................................. 8
2.1 Project requirements for using the software .............................................................. 8
2.2 Configuring the SIMIT project .................................................................................... 9
3 Templates and rules .............................................................................................................11
3.1 Templates ................................................................................................................11
3.2 Rules ........................................................................................................................12
4 Operation ...............................................................................................................................14
4.1 Main menu ...............................................................................................................14
4.2 Settings ....................................................................................................................17
© Siemens AG 2024 All rights reserved

4.3 Starting the generation ............................................................................................21


4.4 Results window ........................................................................................................23
4.5 Warning window ......................................................................................................24
4.6 Logging window .......................................................................................................26
5 Importing into SIMIT .............................................................................................................27
5.1 Import via Excel file .................................................................................................27
5.2 Adjusting the coupling names ..................................................................................29
5.3 Consistency check ...................................................................................................32
5.4 Important notes for starting the simulation ..............................................................33
5.5 Troubleshooting .......................................................................................................34
6 FAQ – Troubleshooting ........................................................................................................35
7 Appendix ................................................................................................................................36
7.1 Service and support .................................................................................................36
7.2 Industry Mall ............................................................................................................37
7.3 Links and literature ..................................................................................................37
7.4 Abbreviations ...........................................................................................................37
7.5 Change documentation ...........................................................................................37

Simulation Model Generator


Entry-ID: 109780391, V3.4, 06/2024 3
1 Introduction

1 Introduction
1.1 Overview
In today's world, engineering companies are faced with an ever increasing number of
requirements. These range from faster development processes to the reduction of risks in
development and commissioning.

To meet these requirements, using simulation during development is becoming increasingly


important. One way of reducing development time is to have multiple contractors work in parallel
rather than one after the other.
Risks can also be identified during development and before commissioning, and can be
reduced by simulating the machine throughout the value chain.
Last but not least, this also means that the actual commissioning can be carried out more
quickly and more easily, as the functionality of the machine has been validated in advance and
possible risks have been reduced or even eliminated.

Siemens offers a variety of simulation tools that cover different application scenarios. These
programs can either be used as stand-alone simulations or in combination with others.
One example of this is the combination of SIMATIC S7 PLCSIM Advanced and SIMIT. Here,
PLCSIM Advanced simulates the behavior of a SIMATIC S7-1500 CPU, while SIMIT simulates
the behavior and communication model of field devices, such as drives. By combining these two
© Siemens AG 2024 All rights reserved

tools, it is possible to reconstruct communication behavior between a PLC and a drive, for
example.
In addition, there are many other simulation programs and combinations that cover other
application scenarios.

However, specific expertise is required to use these simulation tools. In addition, there is always
a certain amount of time required to create the simulation models.
The aim of this application example is to simplify the introduction to simulation using SIMIT and
to reduce the time required to create the simulation model in SIMIT.
Version 3 of the Simulation Model Generator (SMG) focuses on even better openness and
extensibility.
The user can use so-called "Templates" to expand generation possibilities in SIMIT and
automatically read the necessary values from the TIA Portal project using "Rules".
A large library containing rules and templates has already been issued for publication, allowing
the user to directly generate behavior models for drives, standard as well as safety I/Os, and
other elements (e.g. RFID, external encoders, safety telegrams).

Simulation Model Generator


Entry-ID: 109780391, V3.4, 06/2024 4
1 Introduction

1.2 Principle of operation


The principle of operation illustration in Figure 1-1 shows the individual elements necessary for
creating the simulation model in SIMIT based in the TIA Portal project configuration. The TIA
Portal Openness API is used as a basis for reading information from the TIA Portal project.
The individual steps are explained in greater detail below.
• 1a) Scan: The goal of an SMG rule is to describe the location and position of information
that is necessary for a simulation model.
– A file-based "no code" approach is used as the basis for this. Native methods are
available for reading data. With their help, a user can navigate to the right place in the
Openness model of the TIA project. Alternatively, a rule can be defined in a high-level
programming language (C#).
– Additional information can be found in the corresponding chapter, Rules.
• 1b) Connect: A connection to the TIA Portal Openness API is necessary order for the SMG
to read the information from the TIA Portal project. This connection can be automatically
established from SMG to an open TIA Portal project.
• 2) Read: If one or more rules in SMG have been activated and a TIA Portal project was
connected, generation can be started. In the process, the information is read from the SMG
rule, thereby scanning the TIA Portal project for the desired information via Openness.
• 3) Generate: SMG formats and filters the collected information (for example, if an element
was not found). Finally, the user confirms and generates an Excel file. This file is specifically
designed for importing into SIMIT.
© Siemens AG 2024 All rights reserved

• 4) As a final step, the Excel sheet can be imported into SIMIT. The corresponding
simulation models are generated together with the SMG templates (which only need to be
integrated once in advance).

Figure 1-1: Principle of operation


1b) connect 1a) scan
TIA Portal
SMG
Project
rule
2) read out
3) generate

Excel
file
4) import

Simulation SMG
model template
Integrate

Simulation Model Generator


Entry-ID: 109780391, V3.4, 06/2024 5
1 Introduction

1.3 Generated simulation model


The application example contains an application that allows for automatic generation of
simulation models. An Excel file is created based on the TIA Portal project configuration. The
file can then be imported into SIMIT. An example of the imported simulation models can be
found in Figure 1-2.

Figure 1-2: Generated simulation model


© Siemens AG 2024 All rights reserved

The information read from the TIA Portal project depend on the rules that are activated in the
SMG.
For a drive, for example, they may be:
Telegram configuration (PROFIdrive)
• Relevant parameters of the technology object/drive, such as reference speed
• Encoder configuration (rotary/linear)
• Signals for connection to SIMATIC S7 PLCSIM Advanced/SIMIT Unit.

The corresponding information is automatically read using the "Openness" TIA Portal API.
Based on this information, an algorithm is used to gather the information required for the
simulation model in SIMIT.
After importing to SIMIT, the simulation model is created together with the templates.

Simulation Model Generator


Entry-ID: 109780391, V3.4, 06/2024 6
1 Introduction

1.4 Components used


This application example was created for these software components:
Table 1-1
Component Quantity Item number Note
Totally Integrated Portal 1 6ES7823-1TE08-.. V18
SIMIT SP V11.0 SP1 1 6DL8913-0.L.0-… V11.0 SP1
ENGINEERING M
SIMATIC S7-PLCSIM 1 6ES7823-1FA04-0YA5
Advanced V5.0 Update 2
HF1

This application example consists of the following components:


Table 1-2
Component File name Note
Documentation 109780391_SimulationModelGenerator_DOC_v3_4_en.pdf This
document
TIA Portal V18 109780391_SimulationModelgenerator_PROJ_v3_4.zip Example
project project
Simulation 109780391_SimulationModelgenerator_v3.4_TIAv18.zip Application
© Siemens AG 2024 All rights reserved

Model
Generator
Software
Including rules
and templates

Overview of 109780391_SimulationModelgenerator_ContentOverview_v3.4_en.pdf English only


rule (families)

The SMG Application can be downloaded as a .zip file. It is portable, so no installation is


needed.
The file name will use the following format: SMG_VX.X_TIAvYY, where:
• "X.X" indicates the SMG version found in the .zip file.
• "YY" indicates the lower TIA Portal version compatible with this version of SMG.

Simulation Model Generator


Entry-ID: 109780391, V3.4, 06/2024 7
2 Preparation

2 Preparation
For this application example to function correctly, a few steps are necessary to begin with.
These steps are broken down into the respective programs, TIA Portal (see chapter 2.1) and
SIMIT (see chapter 2.2).
The application example also contains a ZIP archive with SIMIT templates with interconnection
of the respective behavior models. This must also be integrated into SIMIT as preparation.

2.1 Project requirements for using the software


The requirements for the project are divided into two points. First, there are requirements for TIA
Portal installation and for the user (see point 1). Second, there are requirements for the open
project that the software will be used with (see point 2).

Point 1, installation:
The application example requires an installation of the Totally Integrated Automation (TIA)
Portal version V18 or higher. V19 work as well. Older versions of TIA Portal are not supported.
The Openness option must also be selected during installation.
The user must also have access to Openness. This access is allowed by assigning the local
user group "Siemens TIA Openness" to the current user account.
Additional information can be found at the following link (Openness documentation).
© Siemens AG 2024 All rights reserved

Point 2, project requirements:


The opened project must be compilable and all necessary software packages, as well as
Hardware Support Packages (HSPs), must be installed. If the last point is not completed, no
access to Openness will be possible and the software cannot interface with the TIA Portal
project.
Use of the software further requires at least one configured PLC station.
Depending on the rule family, certain requirements will apply to the project before the respective
charts can be generated. For example, in the "Drives" family, at least one drive must be
configured with a PROFIdrive telegram and connected with the PLC. Additional information is
available in the document describing the rule families and their requirements.

Simulation Model Generator


Entry-ID: 109780391, V3.4, 06/2024 8
2 Preparation

2.2 Configuring the SIMIT project


To use the simulation models created by the Simulation Model Generator (SMG) V3, a SIMIT
installation is required. The following versions are natively supported at the time of publication:
• SIMIT V10.3 Update 2
• SIMIT V11.0 SP1

The following will explain what preparations are necessary in a SIMIT project to use the
simulation models created by the SMG and to start the simulation.
1. A SIMIT project must be open.
2. A SIMATIC S7 PLCSIM Advanced/SIMIT Unit coupling has been created.
3. The associated TIA Portal project has been imported into this coupling.
4. The mnemonic of the coupling must be set to "I/Q" not "E/A".
5. The package with templates (attached to this package) has been imported into SIMIT (see
point 4).

Note It is also recommended to enable the "bus synchronous mode" in SIMIT, if possible, and in
the SIMATIC S7 PLCSIM Advanced coupling. This allows time synchronization between
SIMATIC S7 PLCSIM Advanced and SIMIT, which significantly improves the behavior of
time-critical processes such as Motion Control.
© Siemens AG 2024 All rights reserved

It is also recommended to set the mnemonics in the PLCSIM Advanced / SIMIT Unit / Virtual
Note Controller coupling to the English "I/Q". The mnemonics is set by default to the German "E/A",
which can cause issues when assigning logical addresses.

Point 4, import templates:


To instantiate the values generated by SMG, the associated templates must be imported into
SIMIT.
Installation:
• Open a SIMIT project
• (Optional) Copy the templates to a storage directory (see below)
• Integrate the templates into SIMIT

The templates are located in the application folder in the path "Rules_Templates/Templates".
Please do not forget to import the templates for your SIMIT version (templates in the SIMITV11
folder can only be opened in SIMIT V11 and are not backwards compatible).
You can now either copy these templates into the directory for Project Templates (so that this
component is available for all users of this project) or you can copy them to any storage location
where you already have other templates, for example.
Both variants are explained in brief below:

Simulation Model Generator


Entry-ID: 109780391, V3.4, 06/2024 9
2 Preparation

Variation #1 (Project Templates):


Every SIMIT project folder contains a folder named "ppat" ("Project Patterns"). See Figure 2-1.
Any template moved here appears in the corresponding Project Templates field in SIMIT. This is
located in the "templates" library. Project templates are only available in this specific project, so
if you start a new project, you need to import them again.

Figure 2-1: Project Templates folder


© Siemens AG 2024 All rights reserved

Variation #2 (User Templates):


You can use any folder on your PC as a storage location for templates in SIMIT, and you can
link this directory in SIMIT.
To do this, copy the templates to a directory outside of the project folder (!) to which you have
read and write access. However, this folder must not be located in the project folder.
To include the folder in SIMIT: Create or open a chart in SIMIT, select the "Templates" tab on
the right-hand side of the SIMIT window, and add a new folder in the "User templates" section
(see Figure 2-2). Templates imported via User templates are available in all projects on your
PC; however, they will not be included if you share the SIMIT project with someone else.

Figure 2-2: User templates

Now the templates can be used to create simulation models.

Simulation Model Generator


Entry-ID: 109780391, V3.4, 06/2024 10
3 Templates and rules

3 Templates and rules


There are two major elements for the extensibility of the SMG V3:
- SIMIT templates, today considered "best practice" for efficient creation of simulation
projects.
- SMG rules, which make adding new elements for generation considerably easier and more
efficient.
This chapter will explain the key properties of rules and templates.

3.1 Templates
Templates are used to format recurring functions of a simulation model, such as parts of a chart,
so that you can use them as templates for charts when creating projects. You can use all
elements in templates that you also use in charts:
• Components
• Macro components
• Controls
• Graphics
Unlike charts, templates use placeholders for various elements contained in the components of
the template. When a template is instantiated, a chart is created in which the placeholders have
© Siemens AG 2024 All rights reserved

been replaced with values, signal names, etc.


There are already many templates available in connection with SMG. However, you also have
the option of either making modifications to existing templates or of making your own templates
from scratch.
The template shown in Figure 3-1 demonstrates an example of an interconnection for a digital
input signal. Besides the interconnections for various components, it also contains the
placeholders characteristic of templates. Specifically, here they are the PLC signal (see no. 1)
and the comment for this signal (see no. 2).

Figure 3-1: Example template

Assuming now that we have a digital input module with 8 channels in an ET 200SP station in
TIA Portal, this template can be instantiated 8 times to simulate these inputs – once per
channel. The placeholders "ChannelSignal" and "Comment" are based on the respective data in
TIA Portal – in the case of "ChannelSignal", for example, we might consider the value "I43.0"
(i.e. the pure logical address) – and the comment would depend on whether a PLC tag with a
comment is attached to the address "I43.0".

If no PLC tag or comment exists, this template can still be used, since empty placeholders (in
this case, a non-existent comment) are automatically deleted from the chart upon import so long
as the appropriate option is selected.

Simulation Model Generator


Entry-ID: 109780391, V3.4, 06/2024 11
3 Templates and rules

3.2 Rules
The main goal of a rule is to find all necessary placeholder information for a template. A rule
provides the following information to the software; the information is then used for generation.
1. Which objects in the TIA Portal project should be used as a starting point.
2. What information is read from the TIA Portal project for each of the placeholders.
3. Which SIMIT template will be used for instantiation.
4. The name of the generated SIMIT charts.
5. The folder structure (in SIMIT) that the charts will be organized in.

Each rule belongs to a family that roughly describes its application. A family always contains at
least one rule.

Example: The rule "FDI_8" is aimed at safety modules of type F-DI 8 in an ET 200SP module,
for example. This rule is therefore assigned to the family "Safety". This family also contains
other rules, for instance for "F-DI 16", "F-DQ" or "F-AI" modules.
The families in turn can be enabled in the main interface, causing the associated rules to be
utilized in generation.

Examples of other families:


• "Drives" for drives → e.g. PROFIdrive telegrams, safety telegrams, encoders
© Siemens AG 2024 All rights reserved

• "ET200 periphery" → for standard I/O (e.g. DI, DQ, AI, AQ).
• "RFID" → for Siemens RF17x / 18x simulation

More detailed information and application scenarios can be found in the more detailed
description of the rule families.

Rules can be created in two principal ways (see Figure 3-2):

• Rules can be created with a "no code" approach. Here, SMG-specific commands are
employed to read information. The commands allow navigation and readout of Openness
information.
– The rules mentioned above were developed with this approach.
– They are particularly expedient if the information from TIA Portal can be assigned
directly to a template. For example, a hardware address from the module can be used
in the SIMIT template without major changes.

• For more complex requirements, rules can also be created in a high-level programming
language (C#) as a plugin and loaded by the SMG. This is recommended especially if the
information from TIA Portal needs to be specially prepared/organized so that it can be
instantiated as easily as possible using the SIMIT templates.
– The "IO-Communication" rule is one example of this. It reads "DDX" (Direct Data
Exchange) and "IDevice" transfer areas and generates the charts based on this
information.
– The transfer ranges between the PLCs can contain "PLC tags" with various data types
("Bool", "Byte", "Word", etc.), the use of User Defined Types (UDTs) is also possible.
Recognition of these data types is essential for interconnections in SIMIT.
– Therefore, this rule was created in a high-level programming language in order to
support the additional complexity of using UDTs.

Simulation Model Generator


Entry-ID: 109780391, V3.4, 06/2024 12
3 Templates and rules

Figure 3-2: Types of rule definition

Build rules via


C# code (API)

Generate
Build rules
via XML
markup

Build rules via


Rule Editor
Coming soon
© Siemens AG 2024 All rights reserved

Simulation Model Generator


Entry-ID: 109780391, V3.4, 06/2024 13
4 Operation

4 Operation
With the previous chapter having presented the steps for setting up the software and explained
the necessary requirements in SIMIT, this chapter will address how to work with "Simulation
Model Generator V3". The following topics are examined in more detail:
• Operating the application and creating the simulation models (see chapter 4.1)
• Importing the simulation model into SIMIT (see chapter 5)
• Starting the simulation (see chapter 5.4)

4.1 Main menu


Once you open the software by running "SimulationModelGenerator.exe", the main window will
appear. From here, you can select the rule families that can be selected for generation (see
number 1). You can connect with an open TIA Portal project in the area labeled with number 2.

Generation can only commence if the following requirements have been met:
Note 1. At least one rule family has been selected (thus activating at least one rule).
2. A TIA Portal project is open and has been successfully connected with SMG (number 2). At least
one PLC station in the TIA Portal project is selected.
© Siemens AG 2024 All rights reserved

Figure 4-1: Main window

After pressing the "Connect" button, a prompt will appear in the open TIA Portal project asking
to confirm the Openness firewall (see Figure 4-2).

If multiple TIA Portal projects are open in multiple instances, you must first select the project
Note you wish to connect to. You can do this by making the corresponding selection in SMG. Only
then will the Openness firewall appear.

Simulation Model Generator


Entry-ID: 109780391, V3.4, 06/2024 14
4 Operation

Figure 4-2: Openness firewall

After confirming the firewall, you will see a listing of all PLC stations in the TIA project (see
Figure 4-3).
This section is divided into 4 parts:
1. In area 1, you can select the station that will be used for generation (modifiable).
© Siemens AG 2024 All rights reserved

2. Area 2 shows the names of the controllers as defined in the TIA Portal project
(read-only).
3. Area 3 allows you to change the coupling name used for the generated signals. By default,
this is the name detected by the HWCN Exporter when analyzing the project.
This directly assigns the directed signals to the respective instance
(modifiable).
4. Area 4 allows you to run SIMIT's HWCN Exporter (current version
B11.01.00.00_04.05.00.0), generating the XML file required for creating the PLCSIM
Advanced coupling.

SIOS link to the HWCN Exporter:


https://support.industry.siemens.com/cs/ww/en/view/109770995

Figure 4-3: Station selection

Simulation Model Generator


Entry-ID: 109780391, V3.4, 06/2024 15
4 Operation

The menu bar also contains links for some important commands. They are explained below.
Important functions are marked in bold.
• "TIA Portal" menu command
– "Connect" → starts setting up the connection from SMG to an open TIA project. Can
also be used to reconnect when changing TIA projects.
– "Load TIA PLCs and Subnet Devices" → refreshes all controllers and devices. Helpful
when a PLC was added to the project and needs to be detected, for example.
• "SMG" menu command:
– "Load Rules" → (re-)loads all rules. This function can also be executed with the Refresh
button in the main window. Please note that a valid rule path (see Settings) must be
defined.
– "Show Matches" → shows all generation results in the Results window again. This
command is grayed out if there are no events.
– "Show Warnings" → shows the Warning window again. This command is grayed out if
there are no events.
– "Export Matches to XML / Excel" → exports the currently valid results (by default,
without duplicates) again to the selected file format. The destination path in this case is
the "work directory" ("Work-Dir", by default, the TIA Portal project).
– "Open Export Path" → opens the destination folder containing the exported results,
the log and other files such as the HWCN XML file.
• "Extras" menu

© Siemens AG 2024 All rights reserved

"Settings"→ opens the Settings.


– "Show Log Viewer": → opens the Logging window.

Simulation Model Generator


Entry-ID: 109780391, V3.4, 06/2024 16
4 Operation

4.2 Settings
You can change key settings in the Settings window (see Figure 4-4).
The sections are divided into the following sub-areas:
1. "Startup Routine": Elements that are run when the application starts.
2. "Work & log directory": Folder that results/logs are saved to.
3. "Unique values": How to deal with duplicate results.
4. "Export Format": Specific setting for exporting generated results.
5. You can change miscellaneous settings such as the "LoggingLevel".
6. "File Locations": Locations of important folders, e.g. the path to the rules.

Figure 4-4: Settings window


© Siemens AG 2024 All rights reserved

In the following, the individual sections will be discussed in more detail.

Simulation Model Generator


Entry-ID: 109780391, V3.4, 06/2024 17
4 Operation

"Startup Routine" (point 1):

Table 4-1: Startup routine explanations


Name Explanation
"Connect TIA Portal" When starting the application, the system attempts to
(disabled by default) connect directly to a TIA Portal project.
"Read SMG rules" Upon start, the system attempts to search the rules folder
(enabled by default) specified in 6) (see Figure 4-4); all rules that are found are
then loaded.
"Convert XML Rules to JSON" All rules in XML format are converted to JSON file format,
(enabled by default) which is read by SMG. Recommended if writing custom rules
with XML.
"Load Plugins" In order for rules that have been extended with a high-level
(disabled by default) programming language application or plugin to be loaded,
this option must be enabled. If this option is not selected, the
relevant rules will not be loaded and the associated rule
families will not appear in the main window.
"Debug Plugins" This option is available for debugging plugins.
(disabled by default) If activated, the just-in-time debugger will be called using the
"Debugger.Launch()" method as part of a rule when the
corresponding plugin is launched. This allows the user to
"attach" to his/her code and then run through it using break
points.
© Siemens AG 2024 All rights reserved

More information on this topic can be found here:


https://learn.microsoft.com/en-
us/visualstudio/debugger/debug-using-the-just-in-time-
debugger?view=vs-2022

Simulation Model Generator


Entry-ID: 109780391, V3.4, 06/2024 18
4 Operation

"Work & log directory" (point 2)


The TIA Portal directory is selected here by default. This causes the generated results as well
as the SMG-generated logs to be saved in the TIA Portal project in the folder named "SMG V3 -
Export".
If "SMG Work-Dir" is selected, then the files in this folder will be stored centrally in the "Work
Directory" folder (see point 5).

Figure 4-5: SMG V3 – Export folder


© Siemens AG 2024 All rights reserved

"Unique Values" (point 3):


"Preselection by priority": (selected by default):
If rules contain a priority, the highest priority will be preferred. The system follows a numerical
priority here. The higher the number, the higher the priority.
Example: If two rules find the same results, such as the same I/O address, then a decision must
be made on which result to favor. If rule 2 has a priority of 2 and rule 1 has a priority of 1, then if
this option is activated in the setting mentioned above, rule 2 will be automatically preferred.
The selection can later be changed manually in the "Warnings Window".
"Preselection by number of placeholders":
Here, the priority system is ignored and instead the results are favors which have a greater
number of placeholders.
The templates for these rules are typically more complex and should therefore be preferred over
less complex rules and templates.

Simulation Model Generator


Entry-ID: 109780391, V3.4, 06/2024 19
4 Operation

"Export Format" (point 4):


"Ignore deselected multiple unique values" (enabled by default):
If there are multiple duplicate results (see also the "Unique Values" section above), then only
the selected results will be generated. Unselected results will be ignored. If this option is
disabled, then all results will be exported. This can cause duplicate connections in SIMIT along
with consistency issues.
"Group charts with same chart name" (enabled by default):
Results which have the same chart name during export will be grouped during export. This
means that thematically similar elements (e.g. all 8 channels of a DI module) will not be split into
individual charts, but instead bundled together in one chart.
Disabling this option can cause not all results to be imported in the desired format, since any
existing charts may be overwritten.

"Miscellaneous":
"Archive project before start":
The connected TIA Portal project is archived before generation. The storage path is one level
above the TIA Portal project directory. Please note that this can take some time, depending on
the size of the TIA project.
"Always include Station Name in Output":
If more than one PLC is selected for generation, the station name of the PLC will be
© Siemens AG 2024 All rights reserved

automatically added to the folder structure of the diagram. Therefore, it is possible that even
when multiple PLCs are being generated, that global connectors used in charts have an unique
identifier (because they also contain the folder path).
If this option is activated, the station name of the PLC will be added to the generated result
regardless of the number of selected PLCs, i.e. it will be added if only a single PLC is being
generated.
Please note, that the maximum length of the folder structure + diagram name is 90. If the length
is higher, SIMIT will trigger an error during Import. In this case, please generate the stations
individually (while turning this option off), shorten the name of the station in TIA or change the
generated Excel-file.

"Log level (point 5)":


This selection controls which data will be logged during generation. The result can be viewed in
the "LogViewer" window and in the generated log file in the enabled working directory ("Work-
Dir", by default the TIA Portal project).
See also chapter entitled Logging window.

Note After changing the log level, the application must be restarted for the change to take effect.

The "Log Levels" "Debug" and "Verbose" affect the speed of generation, which is why these
settings should only be chosen if a rule must be analyzed in greater detail.

"File locations" (point 6):


"SMG Rule Folder":
The folder where the SMG rules are stored. The folder is searched recursively.
"SMG Work-Directory":
A central repository for all generated results and logs. Must be enabled in the "Work & log
directory" setting.
"TIA Portal Installation"
Assuming TIA Portal Openness has been properly installed, this path is automatically detected
and points to the installation directory of TIA Portal.
Simulation Model Generator
Entry-ID: 109780391, V3.4, 06/2024 20
4 Operation

4.3 Starting the generation


After generation is begun (see Figure 4-6), a progress dialog will appear. It shows the current
generation status.
Figure 4-6: Starting the generation

The generation is divided into 4 major steps


(see Figure 4-7):
1. First, the system finds all devices in the TIA Portal project that are connected with the
© Siemens AG 2024 All rights reserved

selected PLC station(s). Disconnected devices (from other stations) are not considered for
subsequent generation.
2. Next, the starting points for all activated rules are found. For example, with safety rule F-DI
8, these could be all FDI8 modules inserted in ET 200SP stations. The respective rule is
then applied only to these starting points, meaning that not all devices are scanned.
3. All relevant data are searched in the next step, based on the rule definition. These are:
– all placeholder values,
– the name of the template,
– the name of the chart and
– the folder where the chart is grouped ("Hierarchy").
4. The results are grouped and exported.

Figure 4-7: Progress display

You can cancel generation at any time with the "Cancel" button. Exporting the results is only
possible after generation is complete.

Simulation Model Generator


Entry-ID: 109780391, V3.4, 06/2024 21
4 Operation

Once the export is complete, the progress window will show some additional elements (see
Figure 4-8):
1. The number of results and duplicates. The former are generation results for which a rule
was able to read all the necessary information from the TIA Portal project. Duplicates are
possible duplicate results where multiple different rules analyzed the same device. You can
find more detailed explanations of this topic in the Warning window chapter.
2. The detail window shows the results in greater detail. You can see all the generated
information there. More information on this topic can be found in the Results window
chapter.
3. The warning symbol only appears if possible duplicates were found. The corresponding
window can be opened by clicking on the exclamation mark.
4. Exports will export all results to the destination folder (by default, the TIA Portal project
directory) in the form of an XML file and an Excel file.
If the window was closed with "Cancel" or another way, the result will not be exported.

If you do not press the "Export" button, no results will be exported and results from a
previous generation may be outdated.
CAUTION
Therefore, you should always make sure to press this button after reviewing the results in the
Details window or Warning window.

Figure 4-8: Generation complete.


© Siemens AG 2024 All rights reserved

Simulation Model Generator


Entry-ID: 109780391, V3.4, 06/2024 22
4 Operation

4.4 Results window


This window lists all generation results. These also contain duplicates. Every result contains all
placeholders necessary for later instantiation in SIMIT.
The display is structured in the following columns (see Figure 4-9):
• "Rule Name": The name of the rule used to find this result.
• "Rule Family": The name of the family to which the above rule belongs. It was enabled with
a checkbox in the main window before generation.
• "Template Name": The name of the template that will be used later in SIMIT for
instantiation.

A rule is not necessarily restricted to one template. Rather, using with the information it has
Note detected, it can decide dynamically which template to use for instantiation.

• "Chart Name": The chart name in SIMIT in which this template will be instantiated. If
multiple results point to the same chart name, they will be combined into one chart when
importing into SIMIT. As a result of this, for example, all 8 channels of a DI module will not
be split into separate charts but instead they will be instantiated in one chart representing
the DI module in question.
• "Folder Path": The above-mentioned charts can be created in a SIMIT folder. The folder
© Siemens AG 2024 All rights reserved

path in this case specifies the structure in which this should be done.
In most cases, the family name is used for identification. However, in the ET200 family, for
example, the charts will be instantiated in a folder with the respective station name of the
ET 200SP interface module.
• "Placeholders": All placeholder results are listed here. The section can be expanded or
collapsed with the expander. In addition to the names of templates, charts and folders, this
information is needed for instantiating the template in SIMIT.

You can also filter the results with the search field (at the top of the window). Possible selections
here are:
• "RuleName",
• "RuleFamily",
• "ChartName" and
• "TemplateName"

Simulation Model Generator


Entry-ID: 109780391, V3.4, 06/2024 23
4 Operation

Figure 4-9: Results window


© Siemens AG 2024 All rights reserved

4.5 Warning window


Rules differ with regard to complexity or the number of placeholders. Nevertheless, multiple
rules can address the same target device.
In the case of duplicate I/O signals in SIMIT, since usually only one chart for the device is
desired, the user must have the ability to make the right selection. You can make this selection
in the so-called "Warning window".
One example of this are the rules "Main Telegram" and "Main Telegram Without TO", both of
which are in the Drives family (and therefore they target drive axes). As the name implies, the
rule "Main Telegram Without TO" does not require a connection from the drive axis to an
appropriate technology object (SpeedAxis / PositionAxis / SynchronousAxis) in the PLC.
That is why in this case some values, such as the reference speed, cannot be found. The rule
thus has low complexity since many parameters cannot be read.
By comparison, the rule "Main Telegram" requires this exact connection between drive axis and
technology object. This allows the rule to read additional information from the settings of the
technology object in order to make this information available during generation as well.
Accordingly, the rule is more complex.
The problem in this case, however, is that both rules focus on the same drive axis, and as a
result, the same input and output addresses for the axes will be found in the case of both rules.
If you imported the results of both rules into SIMIT, then SIMIT would block the start due to the
duplicate I/O signals. It is necessary to decide which chart to delete.

To prevent this problem from occurring, you can use various mechanisms to either make the
choice automatically, or you can intervene manually after generation. Both of these options are
presented in the following.
You can make a default setting with respect to option 1 ("Selection by Priority") as well as
option 2 ("Select by count of Placeholders") in the Settings window. Option 1 is set here by
default.

Simulation Model Generator


Entry-ID: 109780391, V3.4, 06/2024 24
4 Operation

Option 1: "Selection by Priority" (recommended)


Rules with a higher priority are preferred by default. The priority system functions in ascending
order, i.e. 10 has a higher priority than 1. If no priority is specified in the rule, it has priority 0.
The button in this dialog lets you perform the selection again for all pairings.

Option 2: "Selection by count of Placeholders"


In this case, the priority system is ignored and the rule that is selected is the one that has a
greater number of placeholders.
This rule will generally be more complex, but there are some rules where this does not apply.
Therefore, it is recommended to leave the default setting with option 1 activated in the settings.
The button in this dialog lets you perform the selection again for all pairings.

Option 3: Manual selection


Besides the two options presented above, you can also select the results manually. This is done
with the corresponding radio buttons (see Figure 4-10).
Figure 4-10: Warning window
© Siemens AG 2024 All rights reserved

Simulation Model Generator


Entry-ID: 109780391, V3.4, 06/2024 25
4 Operation

4.6 Logging window


The "Logging window" shows the currently valid log and provides information about the program
sequence (see Figure 4-11). The window is divided into the following areas:
1. Save the log to a user defined location or delete the current log display. If deleted, the log in
the underlying file remains unchanged.
2. "LogLevel" for filtering the display. All levels with the selected level or higher will be
displayed.
Example: "LogLevel" "Verbose" will display levels "Verbose", "Information", "Warning",
"Error" and "Fatal". "LogLevel" "Error" will only display the "Error" and "Fatal" categories.
3. The elements themselves, clustered by categories of time stamp, "Information" and
"Message". Individual messages are colored according to their "LogLevel".
Figure 4-11: Log window
© Siemens AG 2024 All rights reserved

Simulation Model Generator


Entry-ID: 109780391, V3.4, 06/2024 26
5 Importing into SIMIT

5 Importing into SIMIT


After generating the results and exporting, the generated Excel file (.xlsx) can be imported into
SIMIT.

Before importing, the templates must be integrated into SIMIT.


If this has not been done, the charts will not be imported correctly. A notification that the
CAUTION templates could not be found will appear.
For more on this, see the section in the Configuring the SIMIT project chapter.

5.1 Import via Excel file


With an Excel file, the import is carried out with the "Instantiate templates" command. This
command can be run either from the menu bar
(see Figure 5-1) under "Automatic modelling", or in any folder in the SIMIT chart hierarchy (see
Figure 5-2).

Figure 5-1: Import via menu bar


© Siemens AG 2024 All rights reserved

Figure 5-2: Import via folder

Simulation Model Generator


Entry-ID: 109780391, V3.4, 06/2024 27
5 Importing into SIMIT

Now the Excel file can be selected (see point 1 in Figure 5-3). It is located by default in the TIA
Portal project directory.
After the import, #2 lets you decide which charts or folders to import. Pressing the Import button
(marked by #3) will instantiate the templates.
Figure 5-3: Instantiate templates - Dialog
© Siemens AG 2024 All rights reserved

Simulation Model Generator


Entry-ID: 109780391, V3.4, 06/2024 28
5 Importing into SIMIT

5.2 Adjusting the coupling names


After importing the templates into SIMIT, it may be necessary to verify the connection between
the signals and the corresponding PLC couplings.

Note The simulation models use the English mnemonic "I/Q" for input and output signals. In order
to assign the signals, ensure that you have selected them in the SIMATIC S7-PLCSIM Adv. /
SIMIT Unit coupling (see Figure 5-4).
When SIMIT is installed in German, this is set to "E/A" by default. If this setting is selected,
the signals may not be correctly assigned to the station.

Figure 5-4: Setting "I/Q" mnemonics

If the coupling names of the PLCs in the SMG main window (see Figure 5-5, point 1) have the
same name as the couplings in SIMIT (see Figure 5-6), no additional steps are necessary.
© Siemens AG 2024 All rights reserved

As long as the coupling name in SIMIT was not changed, it will have the same name as the
Note one in the SMG main window. The reason is that this name is acquired from the same data,
specifically, the name from the PLC station.

It is still recommended to perform a consistency check (see chapter Consistency check) to


ensure that everything was connected correctly and that there are no signals present without a
connection.
Figure 5-5: Coupling name in main window

Simulation Model Generator


Entry-ID: 109780391, V3.4, 06/2024 29
5 Importing into SIMIT

Figure 5-6: SIMIT coupling name


© Siemens AG 2024 All rights reserved

If the name differs, it is not possible to assign certain signals automatically. In such case, the
coupling signals must be assigned again. This process is done automatically by enabling the
"Assign Coupling Signals" option in SIMIT. It is located in the SIMIT menu under "Options".
If you have multiple PLC stations, please remember in this case to leave activated only the one
that you want to assign signals for.
It is also recommended to disable charts containing signals from couplings that have not been
activated. This prevents incorrect coupling names from being entered.

Figure 5-7: Assigning the coupling signals

Simulation Model Generator


Entry-ID: 109780391, V3.4, 06/2024 30
5 Importing into SIMIT

This populates or replaces the old coupling name with the new one (see Figure 5-8 and
Figure 5-9).

Figure 5-8: Before assigning the coupling signals

Figure 5-9: After assigning the coupling signals


© Siemens AG 2024 All rights reserved

Simulation Model Generator


Entry-ID: 109780391, V3.4, 06/2024 31
5 Importing into SIMIT

5.3 Consistency check


Finally, it is recommended to perform a consistency check before starting the simulation.
This determines, for example, whether the names of the signals are provided by a coupling at
all. If inconsistencies are found here, it is recommended to search for a solution before the
simulation is started.
The consistency check is located in the project tree directly above the "Start" button (see
Figure 5-10). Provided no inconsistencies have been found here, the simulation can be started.
Figure 5-10: Consistency check
© Siemens AG 2024 All rights reserved

Simulation Model Generator


Entry-ID: 109780391, V3.4, 06/2024 32
5 Importing into SIMIT

5.4 Important notes for starting the simulation


Remarks on the individual templates can also be found in the charts after generation. They may
tell you, for example, that not all parameters could be detected automatically. In this case, you
must fix them manually before you can run a functional simulation.
Furthermore, some families (such as "Drives V5 Without TO") are fundamentally limited in that
certain values cannot be found due to a missing configuration (in this case, for a technology
object). In such case, the parameters must be compared manually with the configuration in the
PLC.
© Siemens AG 2024 All rights reserved

Simulation Model Generator


Entry-ID: 109780391, V3.4, 06/2024 33
5 Importing into SIMIT

5.5 Troubleshooting
The software is designed in such a way that in the event of unexpected errors, the procedure is
not aborted but will continue to run.

All information about the steps made by Simulation Model Generator is written to a log file. In
addition to the prefix "SMG", it also contains a time stamp with the syntax "YearMonthDay", or
"SMG20230113.log". The log file is located in the export path along with the Excel & XML file.

Detailed information about the settings can be found in the Logging window chapter.
© Siemens AG 2024 All rights reserved

Simulation Model Generator


Entry-ID: 109780391, V3.4, 06/2024 34
6 FAQ – Troubleshooting

6 FAQ – Troubleshooting
I can't connect to my PLC project.
1. Check the system requirements:
a. Is TIA Portal V18 or V19 (latest update) installed?
b. Is Openness installed?
c. Has the Openness group (SIEMENS TIA OPENNESS) been added to the user?
2. Check the project requirements:
a. Are all necessary software packages (incl. updates) installed for the project?
b. Is the TIA Portal project open?
c. Does the TIA Portal project contain a PLC station?

Generation does not start.


1. Is a TIA Portal project connected and at least one PLC station connected?
2. Were the rules loaded and at least one rule family selected?
3. Can the project be compiled?

The SMG does not work with my project.


1. Does it work with the reference project?
2. Does it work with other projects?
© Siemens AG 2024 All rights reserved

3. In case of issues, please submit a service request:


siemens.com/SupportRequest
Product: "SIMIT – PLCSIM Adv. – SIMIT"
Subject: Please specify "Simulation Model Generator" or "SMG".
Details: Please specify, if possible, the TIA Portal project and the hardware used, as well as
the log generated by SMG (found in the storage location of the XML files → see "Settings").

Feedback – Change requests.


Please also submit these through the SR channel (see above).

Simulation Model Generator


Entry-ID: 109780391, V3.4, 06/2024 35
7 Appendix

7 Appendix
7.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:
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. Please send queries to Technical
Support via Web form:
siemens.com/SupportRequest
© Siemens AG 2024 All rights reserved

SITRAIN – Digital Industry Academy


We support you with our globally available training courses for industry 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 our web page:
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 web page:
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 iOS and Android:
support.industry.siemens.com/cs/ww/en/sc/2067

Simulation Model Generator


Entry-ID: 109780391, V3.4, 06/2024 36
7 Appendix

7.2 Industry Mall

The Siemens Industry Mall is the platform on which the entire siemens Industry product portfolio
is accessible. From the selection of products to the order and the delivery tracking, the Industry
Mall enables the complete purchasing processing – directly and independently of time and
location:
mall.industry.siemens.com

7.3 Links and literature


Table 7-1
Nr. Thema
\1\ Siemens Industry Online Support
© Siemens AG 2024 All rights reserved

https://support.industry.siemens.com
\2\ Link to this entry page of this application example
https://support.industry.siemens.com/cs/ww/en/view/109780391
\3\ SIMATIC SIMIT Simulation Platform - Overview
https://support.industry.siemens.com/cs/ww/en/view/109746429

7.4 Abbreviations
SMG Simulation Model Generator

7.5 Change documentation


Table 7-2
Version Date Modifications
V1.0 06/2020 First version
V2.0 04/2021 Complete revision
V3.0 03/2023 Complete revision for Version 3
V3.1 05/2023 Update Main- & Settings window, add description for new option
V3.4 06/2024 SMG not backwards compatible to TIAv16 or TIAv17
Update IO-Communication Rule
Add HWCN Exporter for TIAv19
Update Rule regarding Data Adaption template for drives
Add new rule: DriveSimDesigner

Simulation Model Generator


Entry-ID: 109780391, V3.4, 06/2024 37

You might also like