SimulationModelGenerator DOC v3 4 en
SimulationModelGenerator DOC v3 4 en
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
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.
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
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.
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).
• 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).
Excel
file
4) import
Simulation SMG
model template
Integrate
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.
Model
Generator
Software
Including rules
and templates
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.
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
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.
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:
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
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.
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.
• "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 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.
Generate
Build rules
via XML
markup
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)
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
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.
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.
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
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.
"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.
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.
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.
You can cancel generation at any time with the "Cancel" button. Exporting the results is only
possible after generation is complete.
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.
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"
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.
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
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.
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.
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.
This populates or replaces the old coupling name with the new one (see Figure 5-8 and
Figure 5-9).
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
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?
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
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
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
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