0% found this document useful (0 votes)
38 views

SimulationUnitHelpEN en-US

Uploaded by

Mickaleto
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views

SimulationUnitHelpEN en-US

Uploaded by

Mickaleto
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 140

Task 1

Quick Start Guide 2


Program structure of
SIMULATIONUnit 3
SIMATIC
Simulation of PROFIBUS
components 4
SIMULATIONUnit V9.1 Simulation of PROFINET
components 5
Manipulation of the simulated
System Manual devices 6

Runtime system 7
The programming interface
of SIMULATIONUnit 8

OPC server 9

XML import of hardware data 10


FAQs (Frequently Asked
Questions) 11

06/2018
Legal information
Warning notice system
This manual contains notices you have to observe in order to ensure your personal safety, as well as to prevent
damage to property. The notices referring to your personal safety are highlighted in the manual by a safety alert
symbol, notices referring only to property damage have no safety alert symbol. These notices shown below are
graded according to the degree of danger.

DANGER
indicates that death or severe personal injury will result if proper precautions are not taken.

WARNING
indicates that death or severe personal injury may result if proper precautions are not taken.

CAUTION
indicates that minor personal injury can result if proper precautions are not taken.

NOTICE
indicates that property damage can result if proper precautions are not taken.
If more than one degree of danger is present, the warning notice representing the highest degree of danger will be
used. A notice warning of injury to persons with a safety alert symbol may also include a warning relating to property
damage.
Qualified Personnel
The product/system described in this documentation may be operated only by personnel qualified for the specific
task in accordance with the relevant documentation, in particular its warning notices and safety instructions. Qualified
personnel are those who, based on their training and experience, are capable of identifying risks and avoiding
potential hazards when working with these products/systems.
Proper use of Siemens products
Note the following:

WARNING
Siemens products may only be used for the applications described in the catalog and in the relevant technical
documentation. If products and components from other manufacturers are used, these must be recommended or
approved by Siemens. Proper transport, storage, installation, assembly, commissioning, operation and
maintenance are required to ensure that the products operate safely and without any problems. The permissible
ambient conditions must be complied with. The information in the relevant documentation must be observed.

Trademarks
All names identified by ® are registered trademarks of Siemens AG. The remaining trademarks in this publication
may be trademarks whose use by third parties for their own purposes could violate the rights of the owner.
Disclaimer of Liability
We have reviewed the contents of this publication to ensure consistency with the hardware and software described.
Since variance cannot be precluded entirely, we cannot guarantee full consistency. However, the information in
this publication is reviewed regularly and any necessary corrections are included in subsequent editions.

Siemens AG Copyright © Siemens AG 2018.


Division Process Industries and Drives Ⓟ 07/2018 Subject to change All rights reserved
Postfach 48 48
90026 NÜRNBERG
GERMANY
Table of contents

1 Task..............................................................................................................................................................9
1.1 Simulation of PROFINET IO DP with SIMIT UNIT PN.............................................................9
1.2 Simulation of PROFIBUS DP with SIMIT UNIT PB................................................................10
1.3 Name......................................................................................................................................11
2 Quick Start Guide.......................................................................................................................................13
2.1 Installation of SIMULATIONUnit.............................................................................................13
2.2 Connecting a SIMIT UNIT......................................................................................................13
2.3 Data export from Step 7.........................................................................................................13
2.4 Data export from TIA Portal...................................................................................................14
2.5 Creation of a simulation project..............................................................................................15
3 Program structure of SIMULATIONUnit.....................................................................................................19
3.1 The portal view.......................................................................................................................19
3.1.1 Project....................................................................................................................................19
3.1.2 System...................................................................................................................................20
3.2 The Project view.....................................................................................................................23
3.2.1 Project navigator....................................................................................................................23
3.2.2 Menu and Quick Launch toolbar............................................................................................24
3.2.3 The hardware view.................................................................................................................25
3.2.4 The IO view............................................................................................................................28
3.2.5 The hardware editor...............................................................................................................29
3.2.6 Function blocks......................................................................................................................30
3.2.7 Worksheets............................................................................................................................31
3.2.8 Log window............................................................................................................................31
3.2.9 System settings (Options)......................................................................................................32
3.2.10 Window arrangement.............................................................................................................33
4 Simulation of PROFIBUS components.......................................................................................................35
4.1 Setup and coupling of the simulation of PROFIBUS systems with the SimbaProfibus
box / SIMIT UNIT PB..............................................................................................................35
4.1.1 Information on creating a simulation......................................................................................35
4.2 SIMIT UNIT PB......................................................................................................................35
4.2.1 Cabling...................................................................................................................................36
4.2.2 Installation and heat dissipation.............................................................................................36
4.2.3 Description of the LEDs.........................................................................................................36
4.3 SimbaProfibus........................................................................................................................37
4.3.1 Cabling...................................................................................................................................37
4.3.2 Installation and heat dissipation.............................................................................................38
4.3.3 Description of the LEDs.........................................................................................................38
4.4 Addressing the box................................................................................................................39

SIMULATIONUnit V9.1
System Manual, 06/2018 3
Table of contents

4.5 Web interface.........................................................................................................................40


4.6 Creating a project...................................................................................................................40
4.6.1 Configuring the hardware.......................................................................................................40
4.7 STEP 7 Hardware Config export............................................................................................41
4.7.1 SDB file export.......................................................................................................................41
4.7.2 cfg file export..........................................................................................................................42
4.7.3 Symbols.................................................................................................................................44
4.7.4 Copying the export files to the simulation computer..............................................................45
4.8 Hardware export from TIA Portal...........................................................................................45
4.8.1 Export symbols from TIA Portal.............................................................................................47
4.9 Download, display and diagnose hardware...........................................................................47
4.9.1 Displays..................................................................................................................................48
4.10 Redundant H systems............................................................................................................49
4.10.1 Handling and data transfer of H systems...............................................................................52
4.11 Fail-safe.................................................................................................................................53
4.11.1 Configuration and operation of fail-safe components.............................................................53
4.11.2 Loading the module and starting the fail-safe functionality....................................................54
4.12 Systems with Foundation Fieldbus components....................................................................54
4.12.1 Data import from PDM...........................................................................................................54
4.13 Restrictions when simulating PROFIBUS components..........................................................57
5 Simulation of PROFINET components.......................................................................................................59
5.1 Introduction to simulation with PROFINET.............................................................................59
5.1.1 Scope of the simulation..........................................................................................................60
5.2 SIMIT UNIT PN......................................................................................................................61
5.2.1 Hardware connections...........................................................................................................61
5.2.2 Installation and heat dissipation.............................................................................................62
5.2.3 Description of the LEDs.........................................................................................................63
5.3 SIMBA PNIO..........................................................................................................................63
5.3.1 Hardware connections...........................................................................................................63
5.3.2 Installation and heat dissipation.............................................................................................65
5.3.3 Description of the LEDs.........................................................................................................65
5.3.4 Reset......................................................................................................................................66
5.4 Configuration..........................................................................................................................66
5.4.1 Availability..............................................................................................................................66
5.4.2 Web interface.........................................................................................................................67
5.4.3 Examples of the interconnection of hardware........................................................................67
5.4.3.1 2 PCs, 3 networks..................................................................................................................67
5.4.3.2 2 PCs, 2 networks..................................................................................................................68
5.4.3.3 1 PC, 3 networks....................................................................................................................69
5.4.3.4 1 PC, 1 network......................................................................................................................70
5.5 Network connection................................................................................................................70
5.5.1 Network with redundant systems...........................................................................................72
5.5.2 Network with multiple SIMIT UNITs and real PROFINET devices.........................................73
5.6 Creating a project...................................................................................................................73

SIMULATIONUnit V9.1
4 System Manual, 06/2018
Table of contents

5.6.1 Configuring the hardware.......................................................................................................74


5.7 Download, display and diagnose hardware...........................................................................76
5.7.1 Displays..................................................................................................................................76
5.8 Simulation of the topology......................................................................................................78
5.9 Simulation of IRT-capable devices.........................................................................................80
5.10 Simulation of fail-safe modules (PROFIsafe V2)....................................................................80
5.10.1 Troubleshooting.....................................................................................................................81
5.11 Simulation of redundancy.......................................................................................................82
5.11.1 MRP ring redundancy............................................................................................................82
5.11.2 System redundancy S2..........................................................................................................82
5.11.3 System redundancy R1 and R2.............................................................................................83
5.12 Prioritized startup...................................................................................................................84
5.13 Shared Device simulation......................................................................................................84
6 Manipulation of the simulated devices........................................................................................................85
6.1 I/O values...............................................................................................................................85
6.1.1 I/O names...............................................................................................................................85
6.1.2 Analog values.........................................................................................................................85
6.2 Alarm generation and triggering.............................................................................................86
6.2.1 For PROFIBUS......................................................................................................................86
6.2.2 For PROFINET IO..................................................................................................................89
6.3 PROFIsafe V1 (F_SEND, F_RECV).......................................................................................91
6.3.1 Import of a configuration with PROFIsafe..............................................................................91
6.3.2 Necessary parameters in the SIMULATIONUnit function instances......................................91
6.3.3 Simulation F_RCVDP.............................................................................................................92
6.3.4 Simulation F_SENDDP..........................................................................................................92
6.3.5 Troubleshooting.....................................................................................................................93
7 Runtime system..........................................................................................................................................95
7.1 Copy block types to the project..............................................................................................95
7.2 Editing function block types....................................................................................................96
7.3 Block instances......................................................................................................................98
7.3.1 Export and import of block instances.....................................................................................98
7.4 Start/stop runtime system......................................................................................................99
7.4.1 Activate function blocks in the SIMIT UNIT..........................................................................100
7.5 Implemented basic functions................................................................................................100
7.6 Cycle time of runtime system...............................................................................................108
7.7 Flag memory........................................................................................................................108
8 The programming interface of SIMULATIONUnit.....................................................................................109
8.1 General................................................................................................................................109
8.2 Configuration........................................................................................................................109
8.2.1 Set Simbakern.dll path.........................................................................................................109
8.2.2 Downloading the project.......................................................................................................109

SIMULATIONUnit V9.1
System Manual, 06/2018 5
Table of contents

8.2.3 Query project status.............................................................................................................110


8.2.4 Close project........................................................................................................................110
8.3 Online...................................................................................................................................110
8.3.1 Establish connection to simulation modules........................................................................110
8.3.2 Query connection status......................................................................................................110
8.3.3 Disconnect connection to simulation modules.....................................................................111
8.3.4 Download hardware configuration to simulation modules....................................................111
8.3.5 Query progress of download................................................................................................111
8.3.6 Read data from image..........................................................................................................111
8.3.7 Write data to image..............................................................................................................112
8.3.8 Enable/disable simulation of a slave....................................................................................112
8.3.9 Enable/disable simulation of a module within a slave..........................................................112
8.3.10 Query hardware status.........................................................................................................113
8.3.11 Starting firmware functions...................................................................................................113
8.3.12 Reading and writing of complete slave images....................................................................114
8.3.13 Data records.........................................................................................................................114
8.3.14 Reading or writing a project ID.............................................................................................115
8.3.15 Autostart project...................................................................................................................115
8.3.16 Exporting/importing the I/O image........................................................................................116
8.3.17 Reading the configuration....................................................................................................116
8.3.18 Alarms and other device operations.....................................................................................117
8.3.19 Using Windows events for effective programming...............................................................117
8.4 Functions for using the DLL with your own GUI...................................................................118
8.4.1 Creating an empty project....................................................................................................118
8.4.2 Saving a project under a different name..............................................................................118
8.4.3 "Save" project.......................................................................................................................119
8.4.4 Importing hardware..............................................................................................................119
8.5 Read/change parameter in project.......................................................................................119
8.5.1 Import of TIA Portal projects................................................................................................120
8.5.2 Importing symbols................................................................................................................120
8.5.3 Display of last used projects / SDBs / CFG / symbol lists....................................................121
8.5.4 Language settings................................................................................................................121
8.5.5 Message texts......................................................................................................................121
8.5.6 Adjust PROFIBUS baud rate................................................................................................121
8.5.7 Adjust MAC address range..................................................................................................122
8.5.8 Import of GSD(ML) files into the SIMULATIONUnit hardware library..................................122
8.5.9 Synchronizing I/O data with the simulation hardware..........................................................123
8.5.10 Determination of version......................................................................................................123
8.6 Load sequence (example)....................................................................................................124
8.7 Return codes........................................................................................................................124
9 OPC server...............................................................................................................................................127
9.1 Purpose................................................................................................................................127
9.2 Installation............................................................................................................................127
9.3 OPC server start / stop.........................................................................................................127
9.4 User interface.......................................................................................................................128
9.5 Cycle time............................................................................................................................129

SIMULATIONUnit V9.1
6 System Manual, 06/2018
Table of contents

10 XML import of hardware data...................................................................................................................131


10.1 Basics for XML import..........................................................................................................131
10.2 XML format for the import of a PROFIBUS line...................................................................131
10.3 XML format for the import of a PROFINET line....................................................................132
10.4 Simultaneous import of several lines...................................................................................135
10.5 Syntactic validation of generated XML files.........................................................................135
11 FAQs (Frequently Asked Questions)........................................................................................................139
11.1 In the SIMULATIONUnit project, there are more PROFIBUS devices behind a DP/PA
link than in the STEP7 project. Why does the simulation of the PA slaves that exist in
both projects not work?........................................................................................................139
11.2 A module allocates 3 bytes (EB0 - EB2), the following module allocates 2 bytes (EB3 -
EB4). What happens when you write to ED0?.....................................................................139
11.3 Can I simulate the active bus line of two fault-tolerant systems with two successive
channels of a SIMBAProfibus-Box/SIMIT UNIT PB?...........................................................139
11.4 How do I assign parameters to fail-safe modules in SIMULATIONUnit?.............................139
11.5 SIMULATIONUnit does not recognize the device which I would like to simulate. What
can I do?..............................................................................................................................140
11.6 How do I get rid of a topology error?....................................................................................140
11.7 Can I simulate multiple PROFINET lines with one SIMIT UNIT PN and one
SIMULATIONUnit project?...................................................................................................140
11.8 My project is correct, but the simulation does not work. What can I do?.............................140

SIMULATIONUnit V9.1
System Manual, 06/2018 7
Table of contents

SIMULATIONUnit V9.1
8 System Manual, 06/2018
Task 1
For the effective and fast setup of a test environment for function and FAT tests of S7/PCS7
systems, it is necessary, in addition to simulating pure fieldbus components, to replicate the
behavior of complete aggregates or aggregate groups. SIMULATIONUnit (SU) is a powerful
tool for this.

1.1 Simulation of PROFINET IO DP with SIMIT UNIT PN

With a SIMIT UNIT PN, up to 256 PROFINET I/O devices (e.g. ET200S PN, CP1616 as device)
can be simulated at one PROFINET IO line.
The SIMULATIONUnit software allows the configuration of up to 32 PROFINET channels in
one project. It is also possible to simulate SIMIT UNIT PNs and SIMIT UNIT PBs in a project.
The simulation of PROFINET IO can be carried out using any PROFINET IO controller:
● PROFINET CPU from the SIMATIC S7-300 and S7-400 product range
● External Ethernet CPs, e g. CP443-1 Advanced, CP343-1 Advanced
● CP1616 as master
● Additional PROFINET IO standard controllers

SIMULATIONUnit V9.1
System Manual, 06/2018 9
Task
1.2 Simulation of PROFIBUS DP with SIMIT UNIT PB

See also
Quick Start Guide (Page 13)

1.2 Simulation of PROFIBUS DP with SIMIT UNIT PB

With a SIMIT UNIT PB up to 125 DP standard slaves (e.g. ET200M, SIMOCODE) can be
simulated on 2 channels at PROFIBUS DP buses with a user selectable transmission rate. In
total, up to 250 PROFIBUS slaves can be simulated.
SIMULATIONUnit enables the configuration of up to 32 SIMIT UNIT PBs in one project.
The simulation of PROFIBUS DP can be carried out using any PROFIBUS master system:
● DP CPU from the SIMATIC S7-300 and S7-400 product range
● DP CPU or DP CP from the S7-1200 and S7-1500 product range
● External DP communication processors e g. CP443-5, IM467
● CP 581 with PROFIBUS DP coupling
● Additional PROFIBUS DP standard masters

See also
Quick Start Guide (Page 13)

SIMULATIONUnit V9.1
10 System Manual, 06/2018
Task
1.3 Name

1.3 Name

SIMULATIONUnit Simulation software

SIMIT UNIT PB Simulation hardware for PROFIBUS

SIMIT UNIT PN Simulation hardware for PROFINET IO

Simba Old name of the SIMIT UNIT


SU Abbreviation for SIMULATION UNIT or SIMIT UNIT

SIMULATIONUnit V9.1
System Manual, 06/2018 11
Task
1.3 Name

SIMULATIONUnit V9.1
12 System Manual, 06/2018
Quick Start Guide 2
This page contains a short description for installing and setting up a simulation project.
Click on the links for more detailed information on the individual points.

2.1 Installation of SIMULATIONUnit


SIMULATIONUnit software installation: Run SIMULATIONUnit_Vx.x.x_Setup.exe on a
simulation PC with Windows 7 or Windows 10.

2.2 Connecting a SIMIT UNIT


Connect a 24 V power supply.

SIMIT UNIT PN Connect the simulation PC to the socket labeled CTRL.


Connect the PROFINET IO controller to the socket labeled P1.
SimbaPNIO Connect the simulation PC to the socket labeled Control Port 1.
Connect the PROFINET IO controller to the socket labeled Real-time Ethernet 1.
SIMIT UNIT PB Connect the simulation PC to the socket labeled CTRL.
Use one or two PROFIBUS cables to connect to the corresponding PROFIBUS ports
SimbaProfibus Connect the simulation PC to the socket labeled Control Port 1.
Connect one or more PROFIBUS cables to the corresponding PROFIBUS ports.
With redundant systems, an even-numbered channel and the next odd-numbered channel
always belong together (e.g. 0 and 1).
PROFIBUS migration gate‐ Connect the simulation PC to the socket labeled Control Port 1.
way You can connect 2 PROFIBUS connectors of a real system to PROFIBUS port 0 and 1. These
channels listen to the data transfer between the PROFIBUS master and the connected slaves.
The master is connected in each case to the simulating system at port 2 and 3. The migration
gateway mirrors in real time the data of the real system in the simulated part.

2.3 Data export from Step 7


When STEP7 and SIMULATIONUnit were installed on the same computer, you do not need
to do anything.
If not, copy the "UnlockHWConfig.exe" program (you can find the program in the installation
folder in the "TIAImport" folder when you have selected "TIA Import" during installation) to the
PC on which STEP7 is installed. Run the "UnlockHWConfig.exe" program with administrator
rights.
When you now click on "Save and compile" in the hardware configuration of Step 7, the
necessary SDB files for the import to the SIMULATIONUnit are created in the directory
<STEP7>/S7tmp/SDBData/program/DOWN/rXXsXX.

SIMULATIONUnit V9.1
System Manual, 06/2018 13
Quick Start Guide
2.4 Data export from TIA Portal

Also export the hardware configuration as a .cfg file. Menu Station → Export…

2.4 Data export from TIA Portal


Select a PLC in TIA Portal and compile the hardware. The folder C:\TIAExports then contains
sdb**.dat or .oms files to be exported to SIMULATIONUnit.
If SIMULATIONUnit is not installed on the PC with the TIA Portal, run the "UnlockHWConfig"
application in the installation folder \TIA. The * .oms- or *.sdb files are then available under "C:
\TIAExports".

SIMULATIONUnit V9.1
14 System Manual, 06/2018
Quick Start Guide
2.5 Creation of a simulation project

2.5 Creation of a simulation project


● Setting up a new project: Select the “Create project” button in the portal view (Page 19).
● Enter any project name in a folder in the following file box. After "OK", SIMULATIONUnit
creates a project folder (*.spf) with the necessary files for managing an empty project and
automatically changes to the project view (Page 23) for performing further steps.

SIMULATIONUnit V9.1
System Manual, 06/2018 15
Quick Start Guide
2.5 Creation of a simulation project

● Select and configure SIMIT UNIT: Menu "Configuration" -> "Import hardware". In the
following program view "Import hardware (Page 40)", you can add the import files such as
system data blocks (.dat), OMS files (.oms) and HW Config export (*.cfg), TIA OMS files
(.oms) or XML files with hardware information. Finally, you can press the "Import" button
to start the import for all bus systems.

SIMULATIONUnit V9.1
16 System Manual, 06/2018
Quick Start Guide
2.5 Creation of a simulation project

● After successful hardware import the program is located in the hardware editor
(Page 29). Here you can change the imported configuration, if necessary.

● The imported hardware must be assigned (Page 29) to a SIMIT UNIT located in the network.
You must either enter the IP address of the SIMIT UNIT in the field IP or click on Scan
network and drag a module from the list onto the imported hardware.
Note
The selected IP address has to be in the same subnet as the simulation computer!
When simulating PNIO systems, the IP address of the SIMIT UNIT must be in a different
IP subnet than the simulated devices!

IP address of the simulation PC: 140.80.123.1 Subnet mask: 255.255.0.0


IP address of the SIMIT Unit: 140.80.123.110 Subnet mask: 255.255.0.0
IP address of the simulated de‐ 140.90.x.y Subnet mask: 255.255.0.0
vices:

SIMULATIONUnit V9.1
System Manual, 06/2018 17
Quick Start Guide
2.5 Creation of a simulation project

● The configuration is saved using the "Apply changes" button.


● Load project to the SIMIT UNIT: Press button. If the SIMIT UNITs are connected, the
button becomes active for downloading the boxes.

SIMULATIONUnit V9.1
18 System Manual, 06/2018
Program structure of SIMULATIONUnit 3
SIMULATIONUnit uses two different views (Portal view and Project view) for arranging control
functions into logical groups.

3.1 The portal view


The portal view of the program contains all the necessary control elements for the
administration of simulation projects, for global system adjustments and the help system.

3.1.1 Project
Open, create or delete simulation projects.

SIMULATIONUnit V9.1
System Manual, 06/2018 19
Program structure of SIMULATIONUnit
3.1 The portal view

Creating a project: Select a folder in which the new project is created and select a project
name.
SIMULATIONUnit creates a folder with the entered project name and the ending .spf
(SIMULATIONUnit project folder). The project must not be created in an existing folder with
the ending .spf.
Open project: Double-click on a project under "Last opened projects" or click on the button and
select the file Project.xml within a SIMULATIONUnit project folder with the ending .spf.
Delete project: If you answer the question "Delete project from disk?" with Yes, the project is
deleted from the list and from the disk.

3.1.2 System
The "System" mask, in turn, contains several system functions.

Device import
Here, new devices can be imported from GSD (for Profibus) or GSDML files (for Profinet) to
the SIMULATIONUnit database.

The new devices are available if you create a new project after this or perform a hardware
import.
One or more GSD or GSDML (xml) files can be selected. The system checks whether this
gateway is already installed, and whether the file to be installed is newer than the existing one.
If you click on "Import", all files with the checkbox selected in the Import column are imported.

Note
The imported files are stored in the user directory (C:\Users\User\AppData\Roaming
\SIMULATIONUnit\hwlib) and are still available after a software update.

SIMULATIONUnit V9.1
20 System Manual, 06/2018
Program structure of SIMULATIONUnit
3.1 The portal view

Scan network
In this view you can find or configure SIMIT UNITs available in the network and carry out
firmware updates.

Column Meaning Can be


changed
Type Type of the simulation module. Simba is displayed for SIMIT UNITs as they are com‐
patible with the old Simba modules.
Name Any name of the SIMIT UNIT ✓
IP address, netmask, IPv4 settings ✓
gateway
MAC address Unique device address worldwide
DHCP If selected, the IPv4 settings are automatically obtained from a DHCP server in the ✓
network.

Click into the corresponding field to change a value and then enter a new value. Then press
the "Save changes" button.
To perform a firmware update, select a SIMIT Unit from the list and click on firmware update.
The current firmware is displayed. A suitable .upd file must be selected for the device. Follow
the instructions of the software.

SIMULATIONUnit V9.1
System Manual, 06/2018 21
Program structure of SIMULATIONUnit
3.1 The portal view

Language settings
In this view you can select the language setting of the program.

"German" and "English" are currently implemented.


SIMULATIONUnit is restarted after changes to the language setting.

SIMULATIONUnit V9.1
22 System Manual, 06/2018
Program structure of SIMULATIONUnit
3.2 The Project view

3.2 The Project view


The Project view is the "working view" of SIMULATIONUnit, in which the user can create, edit
and run simulation projects.

3.2.1 Project navigator


At the left side of the Project view you can find a navigation tree that shows all elements of the
opened simulation project in a tree structure. Double-clicking on an element opens the
respective view of the element.

Elements

Type Comment
Hardware Hardware tree of the configured SIMIT UNITs or bus lines.
I/Os IO addresses of the imported or configured devices.

SIMULATIONUnit V9.1
System Manual, 06/2018 23
Program structure of SIMULATIONUnit
3.2 The Project view

Type Comment
Bit memories A list of all variables used in the function instances.
Function blocks User-defined function blocks and their installed instances.
Worksheets For a better overview, you can drag and drop individual IO values and function
blocks onto a worksheet.

Note
Operator control and monitoring of IO values is possible in all of the above-mentioned views
at the same time.

3.2.2 Menu and Quick Launch toolbar


In addition to text menus, the menu bar also contains a Quick Launch toolbar.

Menu File
● "Create project…" - create a new, empty .spf project folder
● “Open project…"
● “Close project"
● "Save Project As..."
● "Export I/O mapping" - saves all I/O values to a .csv file
● “Import I/O mapping" - loads all I/O values from a .csv file
● "Exit" - Close project and exit SIMULATIONUnit

Menu Configuration
● Edit hardware
● Import hardware
● Devices GSD import

Menu Simulation
● "Connect all" - Establish a connection to all SIMIT UNITs
● "Disconnect" - Disconnect from all SIMIT UNITs
● "Load" - Load project to the SIMIT UNITs
● "Delete" - Delete loaded project from the SIMIT UNITs
● Start runtime system
● Stop runtime system

SIMULATIONUnit V9.1
24 System Manual, 06/2018
Program structure of SIMULATIONUnit
3.2 The Project view

● New function block


● Copy function

Menu Settings
● Options

Menu Help
● "Info" - Version information and copyright
● “Manual" - this help
At the far right, there is a small icon which displays the usage of the selected cycle time.
Setting options or a more accurate view can be found under cycle time setting. If the symbol
is shown against a yellow background, the set cycle time cannot be achieved.

3.2.3 The hardware view

The hardware view shows the SIMIT UNITs and their configuration in a tree structure.
Depending on the element, direct control of the IOs or different actions with the hardware
elements via shortcut menus are possible (e.g. device failure, alarms, module failure, etc.).
The mask on the right contains a search field to search for all elements in the tree view. Press
the Return button to search for the next element.

Meaning of the symbols in the hardware view


SIMIT UNIT PN
SIMIT UNIT PB

SIMULATIONUnit V9.1
System Manual, 06/2018 25
Program structure of SIMULATIONUnit
3.2 The Project view

PROFIBUS slave
Redundant PROFIBUS slave
PROFINET device
PROFINET device, active at port P2
Redundant PROFINET device, active at port P1
Redundant PROFINET device, active at port P2
Module or submodule
I/O
I/O bit with value 0 (false)
I/O bit with value 1 (true)
The background color indicates the state
colorless - only exists in the project / not connected
green - simulation active, I/O data exchange available
light blue - downloaded but there is no connection to the controller
red - fault
gray - listening mode: I/Os are controlled by a different program
yellow - passive redundant PROFIBUS slave
yellow-green - fail-safe operation active

Listening mode
If more than one instance of a simulation program accesses the same channel of a SIMIT
UNIT, then all instances except one switch to listening mode.
In listening mode all inputs and outputs of the SIMIT UNIT are read and displayed, but cannot
be operated. Downloading is not possible. The background color of all devices, modules and
channels is gray in the hardware view. In the hardware view, behind the SIMIT UNIT, you will
see the text "Controlled by SimWhatever.exe".
● If SIMULATIONUnit and another simulation program (e.g. Simit) are accessing the same
channel, then the SIMULATIONUnit instance changes to listening mode.
● If two or more instances of the same simulation program are accessing the same channel,
then the first started instance is active and all others switch to listening mode.
● Connection attempts from different PCs to the same SIMIT UNIT are blocked by the box.

SIMULATIONUnit V9.1
26 System Manual, 06/2018
Program structure of SIMULATIONUnit
3.2 The Project view

Save project in the box permanently

With online connected boxes, it is possible to permanently save the projects in the boxes via
a shortcut menu in the hardware view. In this way, you can easily configure pre-configured
simulation boxes, which after power on immediately simulate the required devices again.
In the hardware view, the corresponding box then has the comment * AutoStartProject *.
If a USB stick is inserted in the front of the SIMIT UNIT PN or PB, an Autostart project can be
written to the USB mass storage device or loaded from there.
A cover is found on the rear of the SIMIT UNIT PN/PB. A Micro SD card is located behind it.
If an SD card and not a USB stick is inserted in the SIMIT UNIT PN/PB, the Autostart project
is written to the SD card or loaded from there.
If neither the SD card nor the USB stick is inserted, the Autostart project is saved in the internal
flash memory of the SIMIT UNIT PN/PB or loaded from there if available.

SIMULATIONUnit V9.1
System Manual, 06/2018 27
Program structure of SIMULATIONUnit
3.2 The Project view

3.2.4 The IO view

The IO view shows all IOs configured in the project in a list view. Here, in addition to logical
addresses, any imported signal names or comments are displayed. The I/Os can also be
controlled and observed here. The IO view can be restricted to certain I/Os using a filter.

SIMULATIONUnit V9.1
28 System Manual, 06/2018
Program structure of SIMULATIONUnit
3.2 The Project view

3.2.5 The hardware editor

The menu command Configuration → "Edit hardware" opens the hardware editor. Here you
can see the hardware tree of the project in the left section (analog to the hardware view). In
the right section, either the properties of the object selected on the left are displayed or can
be edited here.
Example: If a SIMIT UNIT is selected in the hardware tree, its properties such as the IP address
are shown on the right. This can be freely edited or found using network scan. After a network
scan in the bottom part of the window, all SIMIT UNIT boxes found are shown. The IP address
can be dragged to the SIMIT UNIT in the hardware tree.
If a SIMIT UNIT PN is selected in the hardware tree, you can also edit the topology settings.
If a topology was configured in Step 7 / or in the TIA Portal, you must enter the device number
and port number of the first simulated device behind the PNIO controller here. In addition, the
port number of the first device must be entered. If the project contains additional redundancy,
these values have to be edited also for the second controller.
If no topology is set up in Step 7 / TIA, you can use the default settings.
Optionally you can also import an export file (.cfg) for each channel into your hardware. In this
case, all module names from the S7 project are copied to the SIMULATIONUnit project. If you

SIMULATIONUnit V9.1
System Manual, 06/2018 29
Program structure of SIMULATIONUnit
3.2 The Project view

do not import a cfg file, the original device names from the device catalog in the
SIMULATIONUnit project are shown.
You can also assign a symbol file from PCS 7 to the imported hardware here.
The second tab on the right contains the hardware catalog of SIMULATIONUnit. You can use
it to configure hardware configurations manually. Devices can be dragged and dropped into
the hardware tree with the mouse.
Right-clicking a device/module in the hardware tree opens a menu for editing:
● Remove removes the selected elements from the hardware tree
● Copy copies the selected elements to the clipboard
● Cut copies the selected elements to the clipboard and then deletes them
● Paste inserts the elements from the clipboard
Ctrl + mouse-click selects an additional element
Shift + mouse-click selects all elements from the previous to the element currently selected
The set options are saved with Save changes and the respective files are also imported.

3.2.6 Function blocks

Double-clicking on a saved function opens the view of the function instances for operator
control and monitoring. For more detailed information on functions and function instances,
refer to Runtime system (Page 95).

SIMULATIONUnit V9.1
30 System Manual, 06/2018
Program structure of SIMULATIONUnit
3.2 The Project view

3.2.7 Worksheets

Worksheets are freely configurable windows in which the user can place any I/Os and function
instances using "drag and drop". This allows objects to be grouped by function to obtain a
better overview in the simulation project.

3.2.8 Log window

At the bottom of the project view window, you can find the view of the log file. Important events,
warnings and errors that occurred during the simulation are written here. The log file can be
saved to any text file for further diagnostics.

SIMULATIONUnit V9.1
System Manual, 06/2018 31
Program structure of SIMULATIONUnit
3.2 The Project view

3.2.9 System settings (Options)

The menu command "Settings" → "Options" opens a mask for adjusting global program options.
In the upper part of this mask you can set whether SIMULATIONUnit should save the input
image on closing. That is useful to get the same scenario when opening the project again.
It is also possible to adjust the internal program cycle.
The program cycle should be adjusted in such a way that a safe transmission of all telegrams
from and to the box within one cycle is guaranteed!
In the lower section, the range of used MAC addresses for the import of PNIO devices can be
specified.

SIMULATIONUnit V9.1
32 System Manual, 06/2018
Program structure of SIMULATIONUnit
3.2 The Project view

3.2.10 Window arrangement


The display windows in the right part of the program can be grouped as needed by "grabbing"
their header with the mouse and then dropping them into the markings that appear afterward.

SIMULATIONUnit V9.1
System Manual, 06/2018 33
Program structure of SIMULATIONUnit
3.2 The Project view

SIMULATIONUnit V9.1
34 System Manual, 06/2018
Simulation of PROFIBUS components 4
4.1 Setup and coupling of the simulation of PROFIBUS systems with the
SimbaProfibus box / SIMIT UNIT PB
PROFIBUS components are simulated using the SimbaProfibus box / SIMIT UNIT PB on the
real PROFIBUS master.
Data exchange between the SIMBAProfibus box / SIMIT UNIT PB and the PC takes place
over the network at the control port of the box.
The following requirements apply with regard to PROFIBUS parameters or the number of
PROFIBUS slaves to be simulated:
● Maximum number of devices on a bus: 125
● Maximum baud rate (DP): 12 MBaud

4.1.1 Information on creating a simulation


The SIMBAProfibus box / SIMIT UNIT PB is not integrated in the hardware configuration in
the SIMATIC S7 project. The box is not logged on as a PROFIBUS device. The SimbaProfibus
box / SIMIT UNIT PB behaves neutrally in the SIMATIC system. You can manage up to 32
bus lines in one simulation project.

4.2 SIMIT UNIT PB

SIMULATIONUnit V9.1
System Manual, 06/2018 35
Simulation of PROFIBUS components
4.2 SIMIT UNIT PB

4.2.1 Cabling

Power supply

L+ Power supply 24 V, min 1 A (e.g. PS307 (24 V) from Siemens).


M Ground

Connection to simulation computer


The simulation PC can be connected at the CTRL port with the SIMIT UNIT PB in order to load
the PROFIBUS box from SIMULATIONUnit with the project data and to organize the data
exchange in process mode between the box and SIMULATIONUnit.
The CTRL port can be directly connected to a simulation PC or indirectly connected by one or
more switches. The baud rate (100 Mbps or 1 Gbps) and Ethernet cable polarity are set
automatically, which means normal or cross-connect cables can be used.

Connection of the PROFIBUS lines


Connect up to two PROFIBUS lines to the 9-pin D-sub connectors on top of the housing. The
top PROFIBUS line is identified as SU-Profibus_x[0] in the SIMULATIONUnit project, the
bottom one as SU-Profibus_x[1].

4.2.2 Installation and heat dissipation


The SIMIT UNIT PB can be mounted on a standard mounting rail and an S7-300 mounting
rail. The ambient temperature must not exceed 70 °C.

4.2.3 Description of the LEDs

LEDs on the cover of the SIMIT UNIT PB


PB1, PB2 Lights up on activity at one of the PROFIBUS ports
CTRL Lights up when connected to a network
Flashes orange during data exchange
PWR Lights up green if the power supply is connected
RDY Flashes green while booting after power on or reset
Lights up green when the box is operational

SIMULATIONUnit V9.1
36 System Manual, 06/2018
Simulation of PROFIBUS components
4.3 SimbaProfibus

4.3 SimbaProfibus

4.3.1 Cabling

Power supply
The power for the box can be supplied over either PS1 or PS2.

PS1 You can connect to a power supply with a voltage between 9 V and 36 V, 2 A here.
PS2 The connection has to be made with 2 wires linked to a power supply with a voltage between 9 V and 36 V,
2 A (for example 24 V supply PS307 from Siemens).

Connection to simulation computer


The simulation PC can be connected to control port 1 with the SimbaPROFIBUS box to load
the SimbaPROFIBUS Box from SIMULATIONUnit with the project data and to organize the
data exchange between the box and SIMULATIONUnit during process mode.
Control port 1 can be directly connected to a simulation PC or indirectly by one or more
switches. The baud rate (100 Mbps or 1 Gbps) and Ethernet cable polarity are set
automatically, which means normal or cross-connect cables can be used.

Connection of the PROFIBUS lines

SimbaProfibus
Connect up to 8 PROFIBUS lines to the 9-pole D-sub connector at the sides of the enclosure.
The PROFIBUS line connected to CH0 is identified as SU-Profibus_x[0] in the
SIMULATIONUnit project. CH1 corresponds to SU-Profibus_x[1], etc.
If you want to simulate a redundant system, you have to connect the redundant PROFIBUS
lines to opposite ports on the SIMBAProfibus. You can therefore simulate H systems only at
channels 0 and 1, or at channels 2 and 3, or at channels 4 and 5, or at channels 6 and 7.

SIMULATIONUnit V9.1
System Manual, 06/2018 37
Simulation of PROFIBUS components
4.3 SimbaProfibus

Migration gateway
If a migration gateway box is used, the lines to be simulated must be connected to channel 0
or 2. The PROFIBUS lines to be listened to are connected on the respective opposite side to
channel 1 or 3.

4.3.2 Installation and heat dissipation


The SimbaPROFIBUS Box can be set up as a table unit or can be attached to a DIN rail using
the clip on the back. The enclosure of the box also serves for heat dissipation of the chipset
in the SimbaPROFIBUS. The box can heat up to temperatures above 40 C during operation.
This does not have a negative impact on functionality. To ensure faultless operation, please
make sure that the heat of the enclosure can be dissipated to the surrounding air. The ambient
temperature must not exceed 40 °C.

4.3.3 Description of the LEDs

LEDs on the cover of the SimbaProfibus


Power lights up yellow if the power supply is connected
Ready Sys‐ Flashes green while booting after power on or reset
tem Lights up green when the box is operational
Ready DP lights up if the PROFIBUS DP simulation module is activated
Config lights up if a project was previously loaded to the SIMBAProfibus
available

SIMULATIONUnit V9.1
38 System Manual, 06/2018
Simulation of PROFIBUS components
4.4 Addressing the box

LEDs on the cover of the SimbaProfibus


Activity LAN Lights up when connected to a network
Activity DP Lights up on activity at one of the PROFIBUS ports

4.4 Addressing the box


IP address are assigned to the SIMBAProfibus/SIMIT UNIT PB in SIMULATIONUnit using the
hardware editor or via the Portal view → System → Scan network.
Scan the connected network and configure an IP address in your network IP band.

The imported hardware must be assigned to a SIMIT UNIT located in the network. You must
either enter the IP address of the SIMIT UNIT in the field IP or click on Scan network and drag
a module from the list onto the imported hardware.

SIMULATIONUnit V9.1
System Manual, 06/2018 39
Simulation of PROFIBUS components
4.6 Creating a project

4.5 Web interface


With the Web interface, the user can verify the hardware and firmware versions of the box and
display log files.
Start a Web browser (for example, Internet Explorer) and enter the IP address of your SIMIT
UNIT PB:

4.6 Creating a project


Perform the following steps in succession to create a simulation project:
Menu "File"→ "Create project" or select the "Create project" button in the Portal view.
First create an empty project. Choose a directory on your hard disk and a name for the project.
SIMULATIONUnit will create a new folder with the ending .spf for the simulation project.

NOTICE
Do not create a (*.spf) project folder within a different project folder.

4.6.1 Configuring the hardware


The hardware configuration of the PROFIBUS to be simulated can either be done manually
with the integrated configuration tool "Configure Hardware" or automatically with the import of
the S7 or TIA Portal hardware configuration.
The Project.xml file can also be imported from one or more different SU projects.

Manual configuration
Menu "Configuration" → "Edit hardware"
When configuring SIMULATIONUnit using the hardware editor, the hardware components
have to be dragged from a library with drag and drop. SIMULATIONUnit only checks the logical
consistency of the configuration (for example, device numbers).

NOTICE
SIMULATIONUnit does not check the consistency of the logical addresses like STEP7
Hardware Config! This means that in the event of duplicate assignment of logical addresses,
inconsistencies or unintended signal changes may occur during simulation.

SIMULATIONUnit V9.1
40 System Manual, 06/2018
Simulation of PROFIBUS components
4.7 STEP 7 Hardware Config export

Importing hardware
Menu "Configuration" → "Import hardware".

In the following program view, import files from Step 7 such as system blocks (.dat), TIA Portal
OMS files (.oms) or XML files can be selected and the selection can be imported into the
SIMULATIONUnit project.
It is also possible to import hardware data from an XML file from a different SU project.

4.7 STEP 7 Hardware Config export

4.7.1 SDB file export


In order to import the hardware configuration from a STEP 7 project, the system data blocks
of the automation system must be read into SIMULATIONUnit. This also ensures that the
assignment of the hardware components to the logical addresses of the system is correct.
In SIMATIC Manager, open the hardware configuration of the required STEP 7 project. All
slaves or devices from the hardware configuration can be exported to a simulation project.
Save and compile this configuration. This action generates the SDB files which are required
later.

SIMULATIONUnit V9.1
System Manual, 06/2018 41
Simulation of PROFIBUS components
4.7 STEP 7 Hardware Config export

The sdb????.dat files are located on the SIMATIC PC in the directory: ~\SIEMENS
\STEP7\S7tmp\SDBDATA\program\DOWN\rXXsXX or ~\SIEMENS\STEP7\S7tmp\SDBDATA
\s7hwcnfx\DOWN\rXXsXX
If the SDB files cannot be found in the specified directory, they have been deleted again after
compilation or download by S7/PCS7. To initiate for S7/PCS7 to get the SDB files after
compilation and download, copy the "UnlockHWConfig.exe" program (you can find the
program in the installation folder in the "TIAImport" folder when you have selected "TIA Import"
during installation) to the PC on which STEP7 is installed. Run the "UnlockHWConfig.exe"
program with administrator rights.
After a restart of S7/PCS7 and after recompilation or download of the hardware structure, the
SDB files are then available in the folder specified above.

4.7.2 cfg file export


In addition, you have the option of importing device names assigned in STEP 7 with the help
of an export file (.cfg). If this file is missing, default names from the SIMBA library are used. In
addition, it is also useful for further work to additionally import the symbol list generated in
PCS7.

Note
For a correct hardware import of packed addresses with PROFINET, it is absolutely necessary
to complete the hardware import by importing the *.cfg file.

SIMULATIONUnit V9.1
42 System Manual, 06/2018
Simulation of PROFIBUS components
4.7 STEP 7 Hardware Config export

SIMULATIONUnit V9.1
System Manual, 06/2018 43
Simulation of PROFIBUS components
4.7 STEP 7 Hardware Config export

4.7.3 Symbols
Symbolic addresses from the symbol table of an S7 project can be adopted by importing a
symbol file (.seq or .asc) in SIMULATIONUnit. It is possible to assign a symbol file to the system
data block directly during the hardware import. The symbol file can, however, also be imported
later (also possible if, for example, the SIMULATIONUnit configuration was created manually).
In this case, only one symbol table and no system data block must be assigned to the
corresponding box in the list.

SIMULATIONUnit V9.1
44 System Manual, 06/2018
Simulation of PROFIBUS components
4.8 Hardware export from TIA Portal

NOTICE
This step is only necessary if you have edited the symbols and want to also use them in
SIMULATIONUnit. In SIMATIC Manager, open the symbol table of the STEP 7 project in
question and export it in *.seq format. The language set up in SIMULATIONUnit must be the
same as the project language of the STEP 7 project.

4.7.4 Copying the export files to the simulation computer


Copy the .cfg file (if created), .seq file (if created) and the complete folder /Siemens/Step7/
S7tmp/SDBData/program/DOWN/rXXsXX (or /Siemens/Step7/S7tmp/SDBData/s7hwcnfx/
DOWN/rXXsXX) to your simulation PC.
When copying from this directory, you must ensure that all sdbxxx.dat files are copied because
SIMULATIONUnit links within an SDB file are evaluated for other SDB files. Every SDB file
contains the hardware information for a PROFIBUS or PROFINET structure. A defined
assignment between the file number and PROFIBUS is not given. All existing files can be
selected.
To import the SDBs of a technology CPU (e.g. 315T-2DB), please select the SDB number
range SDB2xxx in the file selection box for the CPU part and the SDB number range SDB1xxx
for the technology part.

4.8 Hardware export from TIA Portal


Data export from the TIA Portal is possible only as of TIA version V13 and higher.
If you use SIMULATIONUnit and TIA-Portal on the same computer and have selected the
menu command "TIA import" during installation, you don’t need to do anything else. After
hardware compilation by the TIA Portal, the folder C:\TIAExports contains the exported
hardware data (OMS files). During import of the hardware data, select the "OMS files" button
and navigate to the folder C:\TIAExports.
If you use TIA Portal and SIMULATIONUnit on different computers, you also have to select
the menu command "TIA import" during the installation of SIMULATIONUnit. In the

SIMULATIONUnit V9.1
System Manual, 06/2018 45
Simulation of PROFIBUS components
4.8 Hardware export from TIA Portal

%SIMULATIONUnit installation folder%\TIAImport you will find the setup program


"UnlockHWConfig.exe", which you have to run on the computer with the installed TIA Portal
"as administrator". Make a note of the directory in which the files are generated. The directory
may differ from "C:\TIAExports". After that you can convert the OMS files exported from the
TIA Portal with the program "TIA2SUConvert" into an XML file, which you can then import into
SIMULATIONUnit on your simulation computer.
For S7-300 and S7-400 CPUs, sdb????.dat files are generated in C:\TIAExports as with Step
7 Classic.

SIMULATIONUnit V9.1
46 System Manual, 06/2018
Simulation of PROFIBUS components
4.9 Download, display and diagnose hardware

4.8.1 Export symbols from TIA Portal


If the TIA Portal is used, you can export the symbols (PLC tags) as an Excel file (.xlsx). This
Excel file can also be imported in SIMULATIONUnit.

In the TIA Portal, PLC tags → Show all tags. Then click on the Export button.

4.9 Download, display and diagnose hardware


After successful import of the hardware configuration, every imported line must first be
assigned to a physical SIMIT UNIT. Please select the SIMIT UNIT on the left in the hardware
tree and complete the IP address on the right in the properties. You can also find out the IP
address by scanning the network (see also Addressing the box (Page 39)).
Afterwards you can connect the box to the PC and download the configuration to the box.

NOTICE
The slave type or modules are not queried here. In addition, slaves which are available in the
simulation box but which are not configured are not detected.
Checking is only project-wide and is displayed as a warning in the log file.
In case of doubt, the entire configuration should always be downloaded again.

SIMULATIONUnit V9.1
System Manual, 06/2018 47
Simulation of PROFIBUS components
4.9 Download, display and diagnose hardware

4.9.1 Displays
After connection, the box is first shown against a green background in the hardware tree.

If a different project than the opened one is loaded to the SIMIT UNIT, the SIMIT UNIT is
marked orange.

After successful download of the configuration the PROFIBUS devices are shown as
"defective" (shown in red).

If communication takes place between the master and the devices, the devices are displayed
against a green background.

In the last case, it will be additionally shown whether devices are redundant (one or two bus
connections) and in case of redundancy whether the device is the active (green) or the inactive
device (yellow).

SIMULATIONUnit V9.1
48 System Manual, 06/2018
Simulation of PROFIBUS components
4.10 Redundant H systems

4.10 Redundant H systems


With SIMBAPROFIBUS boxes / SIMIT UNIT PBs, redundant systems, "H systems", such as
ET200M-H or DP-Y-Link can be simulated. For this, a channel of the SIMBAPROFIBUS boxes /
SIMIT UNIT PBs is connected to a system of the redundant AS (an "even numbered" and the
subsequent channel can be used together for H simulation).
For the configuration of a redundant system, the system data blocks of the right and left
PROFIBUS line must be imported simultaneously in SIMULATIONUnit. A general description
of automatic import can be found in Import hardware (Page 40). The import routine of
SIMULATIONUnit will then automatically detect any existing redundant slaves and will add
instances of the "redundancy block" as an addition to the hardware configuration with the
necessary parameters to the runtime system.

Note
When configuring an H system for 4-channel or 8- channel PROFIBUS boxes, it is necessary
to always configure the H system for an "even numbered" channel (0,2,4,6) and the subsequent
channel.
Simulation of two "half" H machines on two consecutive channels is not possible.

SIMULATIONUnit V9.1
System Manual, 06/2018 49
Simulation of PROFIBUS components
4.10 Redundant H systems

Supported PROFIBUS configuration for to redundant, fault-tolerant systems


● One redundant controller with one redundant PROFIBUS DP line.

352),%86'3
352),%86'3

(WKHUQHW

3URILEXV'36ODYHV

● Two redundant controllers with a one-sided PROFIBUS DP line.


Note
Note that the station must actually be configured at one end only in STEP 7.

SIMULATIONUnit V9.1
50 System Manual, 06/2018
Simulation of PROFIBUS components
4.10 Redundant H systems

352),%86'3

(WKHUQHW
352),%86'3

3URILEXV'3VODYHV
352),%86'3

● One redundant controller with one redundant PROFIBUS DP line and Y-link.
Note
The simulation of F-modules downstream from the Y-link is not supported.

SIMULATIONUnit V9.1
System Manual, 06/2018 51
Simulation of PROFIBUS components
4.10 Redundant H systems

352),%86'3
352),%86'3

(WKHUQHW

3URILEXV'36ODYHV
</LQN

</LQN

4.10.1 Handling and data transfer of H systems


The IO modules of redundant systems exist in duplicate in the SIMULATIONUnit interface.
However, only channel 0 of the card is relevant for handling, displaying, functionality of the
runtime system or programming using the programming interface.
SIMULATIONUnit automatically ensures that the active channel, from the system view, is read
from the card for the process value display of the IO outputs. In addition, it is ensured that
operation takes place in both channels (prevention of redundancy errors) for operating
operations.
The display of the active channel is indicated by different colors for the slave in the hardware
view. (see also Display (Page 47)).

SIMULATIONUnit V9.1
52 System Manual, 06/2018
Simulation of PROFIBUS components
4.11 Fail-safe

4.11 Fail-safe
The fail-safe functionality can also be simulated with SIMBAProfibus boxes / SIMIT UNIT PBs.
Operation is possible for both fail-safe "F" on the first channel as well as in combination with
a redundant system "FH".

4.11.1 Configuration and operation of fail-safe components


The import routine of SIMULATIONUnit automatically detects any configured fail-safe
components. If modules for fail-safe operation were selected in the HW configuration, then
SIMULATIONUnit automatically adds an instance of the "FailSafeBlock" function for each slave
with the necessary parameters to the runtime system.

SIMULATIONUnit V9.1
System Manual, 06/2018 53
Simulation of PROFIBUS components
4.12 Systems with Foundation Fieldbus components

Some digital fail-safe modules contain an assigned enable bit (yellow) in addition to the actual
data bits; the enable bit can be used to lock or enable the respective channel.
In older faceplates, any existing additional input bits must always be set to 0. The fail-safe
block in SIMIT UNIT PB only works in conjunction with the integrated redundancy block (also
with non-redundant fail-safe).

4.11.2 Loading the module and starting the fail-safe functionality


After the download of the PROFIBUS line with the fail-safe components to the simulation box,
it might be necessary to restart the PROFIBUS master. The parameter assignments for fail-
safe operation are transferred to the simulation and the CRC checksums are automatically
generated.

4.12 Systems with Foundation Fieldbus components


With SIMBAProfibus boxes and SIMIT UNIT PBs, FF systems can be simulated redundant or
not redundant behind a DP-FF Link. The hardware configuration is imported from PCS7 as
described under Redundant H systems. This step already ensures the complete simulation of
the system and its cyclic data exchange.

4.12.1 Data import from PDM


For more advanced functionality of the FF system, such as diagnostic functions or download
to the FF devices, the SIMBAProfibus box requires additional information from the PDM
configuration.
For this, the configuration first has to be exported from HW Config.

Then export the PDM configuration to the same folder in which the cfg file is located. It is useful
to manually delete any old PDM export files as this is not done by PDM.

SIMULATIONUnit V9.1
54 System Manual, 06/2018
Simulation of PROFIBUS components
4.12 Systems with Foundation Fieldbus components

During PDM export, select the object with all subordinate objects and networks in the lower
left.

SIMULATIONUnit V9.1
System Manual, 06/2018 55
Simulation of PROFIBUS components
4.12 Systems with Foundation Fieldbus components

Now import the cfg file for each PROFIBUS line during the HW import in SIMULATIONUnit.
See also Import hardware (Page 40).

NOTICE
It is currently not possible to map all functions of the FF system in the simulation. Error
messages are issued for certain FF functions because the SIMBAProfibus box acknowledges
missing functions or functions for which no data is not available in the box with FF system
error messages.

SIMULATIONUnit V9.1
56 System Manual, 06/2018
Simulation of PROFIBUS components
4.13 Restrictions when simulating PROFIBUS components

4.13 Restrictions when simulating PROFIBUS components


The SIMBAProfibus boxes / SIMIT UNIT PBs do not support connection setup for MSAC2
services. This can cause errors being displayed by driver blocks that try to read diagnostic
information from lower-level devices or modules via MSAC2 services. The simulation of the
user data of these devices is, however, not affected.
During download of a hardware configuration to the SIMBAProfibus boxes, all PROFIBUS
networks with a speed above 1.5 MBd are briefly disconnected for performance reasons. This
results in "neighboring" controllers displaying a short-term bus fault.

SIMULATIONUnit V9.1
System Manual, 06/2018 57
Simulation of PROFIBUS components
4.13 Restrictions when simulating PROFIBUS components

SIMULATIONUnit V9.1
58 System Manual, 06/2018
Simulation of PROFINET components 5
5.1 Introduction to simulation with PROFINET

SIMIT UNIT
6,08/$7,218QLW
5HDGDQG:ULWH ,QSXW 2XWSXW ,QSXW 2XWSXW ,QSXW 2XWSXW 31,2 3/&
6LPXODWLRQ
3URFHVV9DOXHV 9DOXHV 9DOXHV 9DOXHV 9DOXHV 9DOXHV 9DOXHV &RPPXQLFDWLRQ 8VHUSURJUDP
SURJUDP
6LPXODWHG3URFHVV9DOXHV
5HDO
&38
7&3,3
3RUW

5HDOWLPH
(WKHUQHW
3RUW
,3 ,3 ,3

6LPXODWHG31,2'HYLFHV 352),1(7

PROFINET components are simulated with the SIMBA PNIO or SIMIT UNIT PN box at the
real PROFINET IO controller. Data between a SIMBA PNIO box / SIMIT UNIT PN and the
simulation PC is transmitted over a TCP/IP connection. With a SIMBA PNIO Standard or SIMIT
UNIT PN 128, up to 128 PROFINET IO devices can be simulated on a PROFINET IO line.
With a SIMBA PNIO Premium or SIMIT UNIT PN 256, up to 256 PROFINET IO devices can
be simulated.
The SIMBA PNIO box / SIMIT UNIT is not integrated in the hardware configuration in the
SIMATIC S7 project. The box is not logged on as a PROFINET device.
The SIMBA PNIO box / SIMIT UNIT behaves in a neutral manner in the SIMATIC system and
is an independent hardware module.

Note
Substitute values for CPU stop:
SIMBA PNIO box/SIMIT UNIT generally supports the function "Substitution values with CPU
Stop" of devices, especially of ET 200SP. If necessary, request device description files form
the manufacturer which include information on substitute values. Import the device description
files into SIMULATIONUnit. If the function is recognized during the import, the following
functions are generated in the project:
● DQ_substitute
● AQ_substitute

SIMULATIONUnit V9.1
System Manual, 06/2018 59
Simulation of PROFINET components
5.1 Introduction to simulation with PROFINET

5.1.1 Scope of the simulation


The following features are supported by SIMIT UNIT:

Feature SIMBA PNIO Standard SIMBA PNIO Premium SIMIT UNIT PN 128 SIMIT UNIT PN 256
Article No.: 9AE4120-1AA00 9AE4120-1AB00 9AE4120-2AA00 9AE4120-2AB00
Max. number of devi‐ 128 256 128 256
ces
PROFINET interfaces 1 1 1 2 z)
I/O data ✓ ✓ ✓ ✓
Minimum cycle time 250 μs 250 μs 250 μs 250 μs
Data records ✓ ✓ ✓ ✓
Device and module fail‐ ✓ ✓ ✓ ✓
ure
Bus failure ✓ ✓ ✓ ✓
Channel diagnostics ✓ ✓ ✓ ✓
IRT class 2 ✓ ✓ ✓ ✓
IRT class 3 ✓ ✓
PROFIsafe V1.0 (PN/ ✓ ✓ ✓ ✓
PN coupler)
PROFIsafe V2.4 ✓ ✓ ✓ ✓
PROFIsafe V2.6 ✓ ✓
Fast Startup ✓ ✓ ✓ ✓
Advanced startup ✓ ✓
(CPU 1200/1500)
Multidevices (IE/PB restricted 2) restricted 2) restricted 2) restricted 2)
Link)
I&M data ✓ ✓ ✓ ✓
Shared Device ✓ 1)
✓ 1)
✓ 1)
✓ 1)
Redundancy MRP ✓ 3) ✓
System redundancy S2 ✓
System redundancy ✓
R1
System redundancy
R2
Save project perma‐ ✓ ✓ ✓ ✓
nently
Save project to USB/ ✓ ✓
SD
Integrated switch ✓
Extended diagnostics
via SNMP
Dynamic Frame Pack‐
aging
Fail-safe values at ✓ ✓
CPU Stop
High-precision time
stamping

SIMULATIONUnit V9.1
60 System Manual, 06/2018
Simulation of PROFINET components
5.2 SIMIT UNIT PN

Feature SIMBA PNIO Standard SIMBA PNIO Premium SIMIT UNIT PN 128 SIMIT UNIT PN 256
Shared I/O (MSI/MSO)
Time Based I/O
Fragmentation
IRT with highest per‐
formance
Isochronous mode
MRPD
1)
Projects with Shared Devices can be loaded into the SIMBA PNIO / SIMIT UNIT PN, but only access by one PNIO controller
is supported.
2)
Some devices support the ISO protocol for exchange of configuration and diagnostic data by STEP 7 (e.g. IE/PB Link).
The ISO protocol and the associated simulation of the configuration and diagnostic data transmission for the devices in
question is not supported by SIMBA PNIO / SIMIT UNIT PN; the PNIO part of the device will work, however. Simulation of
IE/PB links with S7-300 CPU does not work.
3)
MRP client configurations are supported, but the ring cannot be closed with the single-channel SU.
z)
You cannot simulate two separate PROFINET networks, but only one network with two interfaces to two PNIO controllers
(e.g. for redundancy).

5.2 SIMIT UNIT PN

5.2.1 Hardware connections


Power supply
L+ : +24 V DC, min 0.5 A
M : Mass
Ethernet ports network P1 and P2
For communication between the communication processor (CP module) of the automation
system (AS) and the PNIO module (directly or indirectly via switch).
For modules with only one PROFINET interface (SIMIT UNIT PN 128), only the top port P1
can be used.
Control Port CTRL

SIMULATIONUnit V9.1
System Manual, 06/2018 61
Simulation of PROFINET components
5.2 SIMIT UNIT PN

Ctrl: RJ45 Ethernet port


The TCP/IP interface can be directly connected to a simulation PC or indirectly by one or more
switches.
The baud rate (100 Mbps or 1 Gbps) and Ethernet cable polarity is set automatically, which
means normal or cross-connect cables can be used.
USB host
The module has one USB host port. An external mass storage device (USB stick or hard disk)
can be connected to the port to save a simulation project.
The standards USB 1.1 and USB 2.0 are supported.
The USB port can supply connected devices with a max. current of 500 mA.
Micro SD card
At the rear of the housing there is a metal cover which can be removed. A slot for a Micro SD
card is located behind it. SD and SDHC standards with a maximum capacity of 32 GB are
supported.
An SD card can be used to save a simulation project.
Digital I/O
The module has one connector which can be used as digital input or digital output.
DI/DO: Digital input or digital output
SGND: Signal ground
Input:
log. 0: No circuit or 0 V
log. 1: 12 - 48 V, 5 - 50 mA
Output:
The output can drive up to 50 mA.
log. 0: internal 4.7K resistor to ground
log. 1: Output is connected to ground via a phototransistor
Button
The module has 1 reset button that is located under the USB port.
Function:
Reset: Following a reset, the module is reset and switches to startup mode. All data stored on
the module is lost in this case, except for the IP address setting. As long as the RDY LED is
flashing the module cannot be reached.

5.2.2 Installation and heat dissipation


The SIMIT UNIT PN can be mounted on a standard mounting rail and an S7-300 mounting
rail. The ambient temperature must not exceed 70 °C.

SIMULATIONUnit V9.1
62 System Manual, 06/2018
Simulation of PROFINET components
5.3 SIMBA PNIO

5.2.3 Description of the LEDs

Power (PWR) Lights up green when the power supply is connected.


Ready (RDY) Flashes green during startup, after power returns or reset.
Only when the Ready LED lights up is the module ready for operation.
Flashes orange when a simulation project was loaded.
Lights up orange when data exchange with a PNIO controller is taking place.
Control (CTRL) Lights up green if a link to the network has been established, flashes orange on
data exchange.
LEDs for Ether‐ Lights up green if a 100 Mbps physical link is present.
net ports P1, P2
Flashes orange if there is data traffic.

5.3 SIMBA PNIO

5.3.1 Hardware connections


For simulation, the following connectors have to be interconnected:
Control Port 1 for loading the PNIO box from SIMULATIONUnit with the project data and
organizing the data exchange in process mode between this SIMULATIONUnit.
Realtime Ethernet 1 for communication between the communication processor (CP module)
of the automation system (AS) and the PNIO module (directly or indirectly via switch).
Power supply
The power for the box can be supplied over either PS1 or PS2.

PS1 A power supply with 9 V to 36 V, min. 1.5 A can be connected here.


PS2 Power supply over two wires, for instance, with the 24 V power supply PS307 from
Siemens.

Real-time Ethernet line

SIMULATIONUnit V9.1
System Manual, 06/2018 63
Simulation of PROFINET components
5.3 SIMBA PNIO

The box comes with 4 real-time Ethernet ports.

RT Ethernet 1 This port has to be connected to the automation system. It simulates a complete
PROFINET I/O strand or parts of it. It can be either connected directly to a PROFI‐
NET IO controller (for example CP443-1) or indirectly over one or more switches
(for example SCALANCE X208). The transmission speed is 100 Mbps. The polarity
of the Ethernet cable is detected automatically, which means normal or cross-con‐
nect cables can be used.
RT Ethernet 2 Not activated.
RT Ethernet 3 Not activated.
RT Ethernet 4 Not activated.

Control Port (TCP/IP)


The box comes with 2 Control Port (TCP/IP) interfaces.

Control Port 1 The simulation program is controlled via this port. A PC with the SIMULATIONUnit
software must be connected to the SIMBA PNIO box over the interface.
Control Port 2 Not activated.

The TCP/IP port can be connected directly to your simulation computer or indirectly over one
or more switches. The transmission speed and polarity of the Ethernet cable is set
automatically, which means normal or cross-connect cables can be used.
Digital I/O
The box has 8 digital inputs and 8 digital outputs. These are electrically isolated from the rest
of the box using optocouplers.
Inputs

3LQ
3LQ 2SWRFRXSOHU

'LJLQSXW )3*$

([WJURXQG
3LQ

Input voltage < 2.7 V : logical "0"


input voltage voltage 3 V to 48 V: logical "1"
Socket assignment on the left of the enclosure
Outputs

([WYROWDJH
3LQ 2SWRFRXSOHU

3LQ N˖
3LQ )3*$

'LJRXWSXW

([WJURXQG
3LQ

8 open collector outputs are provided:

SIMULATIONUnit V9.1
64 System Manual, 06/2018
Simulation of PROFINET components
5.3 SIMBA PNIO

Max. operational voltage: 40 V, 1 A


logical "0": Voltage at pin 10 is present at the output pin via a 10k
resistor.
logical "1": The output pin is connected through to ground (at pin
5).

Inactive interfaces
This box was not only specially developed for SIMBA. In some versions it contains other
interfaces which are not used here:

Serial 1 This port is only used for development purposes and must not be used by users.
Serial 2 Not activated.
USB The box comes with 2 USB host ports. They are not activated.

5.3.2 Installation and heat dissipation


The SIMBA PNIO box can be placed on a table or snapped to a standard mounting rail with
the clamp on the rear. The housing is also used for chipset cooling in the SIMBA PNIO. The
box can heat up to temperatures above 40 C during operation. This does not have a negative
impact on functionality. To ensure faultless operation, please make sure that the heat of the
enclosure can be dissipated to the surrounding air. The ambient temperature must not exceed
40 °C.

5.3.3 Description of the LEDs

Table 5-1 LEDs on the cover

Power Lights up yellow when the power supply is connected.


Ready Flashes green while booting after power on or reset.
Lights up green when the box is operational
Simulation Port 1 Flashes green when a simulation project is loaded to the box.
Lights up green when cyclic communication between at least one simulated device and a PROFINET
I/O controller is present.
Simulation Port 2 not activated.
Simulation Port 3 not activated.
Simulation Port 4 not activated.

SIMULATIONUnit V9.1
System Manual, 06/2018 65
Simulation of PROFINET components
5.4 Configuration

Table 5-2 LEDs near the Ethernet ports

Green LED Lights up when a physical connection is present.


Yellow LED Flashes yellow for a short time in case of data exchange.

5.3.4 Reset
The box comes with one Reset button. After Reset the box switches to startup mode. All data
stored on the module is lost in this case, except for the IP address setting. While the StartUP
LED is flashing the box cannot be accessed either via the Web interface or the
SIMULATIONUnit.

5.4 Configuration

5.4.1 Availability
To access the box over the Web interface, the TCP/IP port has to be connected to a PC
(Hardware connections (Page 63) and Examples of interconnecting hardware (Page 67)). The
boot phase of the SIMBA PNIO/SIMIT UNIT PN has to be finished, which means Power and
Ready LEDs light up. Access to the Web interface is possible during simulation.
First of all, an IP address has to be assigned to the SIMBA PNIO/SIMIT UNIT PN. This address
is then used to access the module.

NOTICE
The selected IP address must be reachable from the simulation PC (same subnet) and must
be located in a different IP subnet than the simulated devices. If necessary, a second IP
address can be assigned in the PC (e.g. for simultaneous connection to a CPU 319F and a
SIMBA PNIO/SIMIT UNIT PN).

Example:

IP address of the simulation PC 140.80.123.1 Subnet mask: 255.255.0.0


IP address of the SIMBA PNIO/SIMIT UNIT PN 140.80.123.110 Subnet mask: 255.255.0.0
IP address of the simulated devices 140.90.x.y Subnet mask: 255.255.0.0

Setting the IP address in SIMULATIONUnit


Scan the network in portal view with Scan network or in the hardware editor in the project view.
If no SIMBA PNIO/SIMIT UNIT PN is found, check whether WinPcap is installed and whether
the firewall of the simulation PC is disabled.
Select a box from the list. The selected box can be identified by clicking on the "Flash" button.
The LEDs on the box flash until you press the "Stop” button. Here you can configure the IP

SIMULATIONUnit V9.1
66 System Manual, 06/2018
Simulation of PROFINET components
5.4 Configuration

address, subnet mask and ,if necessary, the default gateway and the name of the box. Click
on the "Save changes" button to save this information in the box.

5.4.2 Web interface


With the Web interface, the user can verify the hardware and firmware versions of the box and
display log files.
Start a Web browser (for example Internet Explorer) and enter the IP address of your SIMBA
PNIO/SIMIT UNIT PN:

5.4.3 Examples of the interconnection of hardware

5.4.3.1 2 PCs, 3 networks

3&6,08/$7,21
(6 8QLW

(WKHUQHW (WKHUQHW

&3

&3$GY
68
6

352),1(7,2

Each controller is separate and so is the simulation.


An external fault does not exist in this case. All connections are directly interconnected here.
However, switches can be used in any network. If real devices are present, they can be
interconnected by using switches, bearing in mind any configured topology.

SIMULATIONUnit V9.1
System Manual, 06/2018 67
Simulation of PROFINET components
5.4 Configuration

5.4.3.2 2 PCs, 2 networks

3&6,08/$7,21
8QLW (6

6ZLWFK

(WKHUQHW

&3

&3$GY
68
6

352),1(7,2

Both controllers (for ES and for SIMBA PNIO/SIMT UNIT PN) are connected in the same
network.
The PROFINET IO line is separate. If real devices are present, they can be interconnected by
using a switch, bearing in mind any configured topology.

SIMULATIONUnit V9.1
68 System Manual, 06/2018
Simulation of PROFINET components
5.4 Configuration

5.4.3.3 1 PC, 3 networks

(66,08/$7,21 QHWZRUN
8QLW
LQWHUIDFHFDUGV

(WKHUQHW

(WKHUQHW

&3

&3$GY
68
6

352),1(7,2

Each controller is separate and so is the simulation.


An external fault does not exist in this case. If real devices are present, they can be
interconnected by using a switch, bearing in mind any configured topology.

SIMULATIONUnit V9.1
System Manual, 06/2018 69
Simulation of PROFINET components
5.5 Network connection

5.4.3.4 1 PC, 1 network

(66,08/$7,21 QHWZRUN
8QLW LQWHUIDFHFDUG

(WKHUQHW

&3$GY
68
6

352),1(7,2

This solution works but is not the best if the network is also connected to an external network.
The external network may cause a disruption of the cyclic I/O communication if there is a lot
of data traffic.
Important: For the following CPUs as of version 5.1 and higher, the control interface (TCP/IP
interface of SIMBA PNIO) and the simulation interface (real-time Ethernet interface of SIMBA
PNIO) must be separated from a hardware perspective:
● CPU 414-3PN/DP
● CPU 416-3PN/DP
● CPU 416F-3PN/DP

5.5 Network connection


There are several ways of interconnecting the SIMBA PNIO box (also applies to SIMIT UNIT
PN). The best solution is to separate the PROFINET network from the simulation PC and the
rest of the network.
The IP addresses of the SIMBA PNIO/SIMIT UNIT PN and those of the simulated devices
must be in different subnets.

SIMULATIONUnit V9.1
70 System Manual, 06/2018
Simulation of PROFINET components
5.5 Network connection

SIMULATIONUnit and engineering station can be on the same PC or on different PCs.

You can also connect all networks with the help of switches. The network may cause a
disruption of the PROFINET IO communication if there is a lot of data traffic. In addition,
communication between SIMULATIONUnit PC and SIMIT UNIT is slowed down.

See also
Simulation of the topology (Page 78)

SIMULATIONUnit V9.1
System Manual, 06/2018 71
Simulation of PROFINET components
5.5 Network connection

5.5.1 Network with redundant systems


One side of a redundant H machine must be connected to Port P1 of a SIMIT UNIT PN 256,
the other side to Port P2. The SIMIT UNIT PN 128 has only one active port and cannot be
used for redundancy simulation.

6+&38

6,08/$7,213&

352),1(7,2

(WKHUQHW

6,0,781,731

When you simulate redundancy at R1, disconnect the ports in the simulation project (see also
Simulation of the topology (Page 78)).
By connecting two ports, P1 and P2 of a SIMIT UNIT PN 256, to the two ports of a single PLC,
you create a ring.

6&38

0535LQJ

6,0,781,731

NOTICE
Do not connect both ports P1 and P2 to a single CPU without an MRP configuration; otherwise
you create a loop that results in a very high network load.

SIMULATIONUnit V9.1
72 System Manual, 06/2018
Simulation of PROFINET components
5.6 Creating a project

5.5.2 Network with multiple SIMIT UNITs and real PROFINET devices
Real PROFINET devices can also be integrated into the network. They must be deleted from
the SIMULATIONUnit project.

● Several SIMIT UNITs can be connected to one SIMULATION PC by using a switch.


● The SIMIT UNIT PN 256 has two ports (P1 and P2). They can be used for cascading SIMIT
UNITs or for connecting real devices before or after the SIMIT UNIT.
● The SIMIT UNIT PN 128 has only one active simulation port (P1) and must be connected
to the end of a line topology.

5.6 Creating a project


Perform the following steps in succession to create a simulation project:
Menu "File" → "Create project" or select the "Create project" button in the Portal view.
First create an empty project. Choose a directory on your hard disk and a name for the project.
SIMULATIONUnit will create a new folder with the ending .spf for the simulation project.

NOTICE
Do not create a (*.spf) project folder within a different project folder.

SIMULATIONUnit V9.1
System Manual, 06/2018 73
Simulation of PROFINET components
5.6 Creating a project

5.6.1 Configuring the hardware


The hardware configuration of the PROFINET devices to be simulated can be done either
manually with the integrated configuration tool "Configure Hardware" or automatically by
importing the PCS 7 or TIA Portal hardware configuration.
The Project.xml file can also be imported from one or more other SIMULATIONUnit projects.

Manual configuration
Menu "Configuration" → "Edit hardware"
When configuring SIMULATIONUnit using the hardware editor, the hardware components
have to be dragged from a library with drag and drop. SIMULATIONUnit only checks the logical
consistency of the configuration (for example, device numbers).

NOTICE
SIMULATIONUnit does not check the consistency of the logical addresses such as STEP7
Hardware Config. This means that in the event of duplicate assignment of logical addresses,
inconsistencies or unintended signal changes may occur during simulation.

Configuration of "packed addresses"


Configure first module as normal.
Integrate additional modules with * attribute in HW lib.
PNIO data records
In the "Hardware edit" window it is possible to define data records and provide default values
(see PROFINET standard).
When you right-click on a PNIO module or a subslot, the item "Add dataset" is displayed in the
shortcut menu.

SIMULATIONUnit V9.1
74 System Manual, 06/2018
Simulation of PROFINET components
5.6 Creating a project

In the "Default data" field, data can be entered which is available as default values on every
download in the SIMIT UNIT PN. The data must be entered as hex values separated using
commas.
If necessary, a record can also be deleted from the project. To do this, right-click on the data
record and select in the menu: Remove element

Importing hardware
Menu "Configuration" → "Import hardware".

In the following program view, import files from Step 7 such as system blocks (.dat), TIA Portal
OMS files (.oms) or XML files can be selected and the selection can be imported into the
SIMULATIONUnit project.
It is also possible to import hardware data from an XML file from a different SU project.
Hardware export from STEP 7 is performed in exactly the same way as for PROFIBUS projects.
Hardware export from the TIA Portal is performed in exactly the same way as for PROFIBUS
projects.
When copying the SDB files, you must ensure that all sdbxxx.dat files are copied because
SIMULATIONUnit or links within an SDB file are evaluated for other SDB files.
Avoiding MAC address conflicts
If you use more than one SIMBA PNIO box / SIMIT UNIT PNs in the network and load and
configure them from different computers, it is important that the devices used in the project do
not use a MAC address that is already in use on another box to avoid conflicts. For this reason,
you can assign the MAC addresses to be used by the SIMBA PNIO/SIMIT UNIT PN and the
maximum number of devices under Settings → Options before importing.

SIMULATIONUnit V9.1
System Manual, 06/2018 75
Simulation of PROFINET components
5.7 Download, display and diagnose hardware

5.7 Download, display and diagnose hardware


After successful import of the hardware configuration, every imported line must first be
assigned to a physical SIMIT UNIT. To do this, in the hardware editor select the SIMIT UNIT
on the left in the hardware tree and complete the IP address on the right in the properties. You
can also find out the IP address by scanning the network (see also Addressing the box
(Page 39)).
Afterwards you can connect the box to the PC and download the configuration to the box.

5.7.1 Displays
After connection, the box is first shown against a green background in the hardware tree.

If a different project than the opened one is loaded to the SIMIT UNIT, the SIMIT UNIT is
marked orange.

After successful download of the configuration, you can see the PROFINET devices as
"downloaded" (turquoise background).

SIMULATIONUnit V9.1
76 System Manual, 06/2018
Simulation of PROFINET components
5.7 Download, display and diagnose hardware

If the communication between the PNIO controller and the devices is established, the devices
are displayed against a green background.

In the latter case you can also see that a fail-safe module (yellow) is active.

NOTICE
Devices which are present in the simulation box but not configured are not detected. In case
of doubt, the entire configuration should always be downloaded again. Real devices should
be manually deleted after import.

SIMULATIONUnit V9.1
System Manual, 06/2018 77
Simulation of PROFINET components
5.8 Simulation of the topology

5.8 Simulation of the topology


If no topology was configured in STEP 7 or TIA Portal, this step is not relevant.

SIMIT UNIT PN
6,08/$7,2181,7
5HDGDQG:ULWH 3/&
6LPXODWLRQ
3URFHVV9DOXHV 8VHUSURJUDP
SURJUDP

5HDO
'HYLFH 'HYLFH 'HYLFH &38
7&3,3
3RUW

3RUW 3RUW 3RUW 5HDOWLPH


(WKHUQHW
3RUW 3RUW 3RUW
3RUW

6LPXODWHG31,2'HYLFHV 352),1(7

SIMBA PNIO/SIMIT UNIT PN simulates the behavior of a PROFINET network at a single point
in the network: the defined port of the first simulated device. It is directly connected to the
controller.
In the case of the SIMIT UNIT PN 256, an additional device, which communicates as the first
device with the connected PNIO controller, can be configured for simulation port P2.
Therefore when the configuration is created, the number of the first device and port number
which is connected to the rest of the world must be specified. In this example, Device 1 and
Port No. 2 must be configured.
● Topology information cannot be imported from STEP 7 or TIA Portal.
● The topology of all devices behind the first device does not matter when you are creating
a SIMULATIONUnit project.
● If no or incorrect topology information is configured in SU, then Port 1 of the next best device
in the project is declared as the first device.
The topology information can be entered in the menu Configuration → Edit hardware if an
SIMIT UNIT PN is selected.

SIMULATIONUnit V9.1
78 System Manual, 06/2018
Simulation of PROFINET components
5.8 Simulation of the topology

Simulation of the topology on a CPU with a 2-port switch


The configuration shown in the following figure is supported by SIMIT UNIT under the following
conditions:
● Both lines are connected to a 2-port switch
● Topology is configured.
● Ring topology is not supported.

The following figure shows the settings required in SIMULATIONUnit. Select the "Disconnect
SU channels" option in any case. This setting is used to prevent switch communication on the
SIMIT UNIT:

Connection with SIMIT Unit


A network topology is configured in the hardware configuration in which PROFINET devices
are connected to two different ports of a CPU. Both ports of the CPU are connected to the two
interfaces P1 and P2 of a SIMIT UNIT PN 256.
The SIMIT UNIT PN 128 has only one active port and therefore cannot be used for this
configuration.

SIMULATIONUnit V9.1
System Manual, 06/2018 79
Simulation of PROFINET components
5.10 Simulation of fail-safe modules (PROFIsafe V2)

5.9 Simulation of IRT-capable devices


You have to set up a correct topology to get IRT simulation running.
The exact timing is transferred to all simulated devices when the PNIO controller is started.
SIMIT UNIT sets the timing for all simulated devices using the timing information for the switch
port of the first device.
● The devices behind the first device can only be simulated when the first device has been
commissioned by the controller.
● If a slave fault is simulated from the first device, the entire bus is faulty. For all other devices,
the device fault can be simulated in the normal way.

5.10 Simulation of fail-safe modules (PROFIsafe V2)


SIMIT UNIT supports simulation of the PROFIsafe V2 protocol.
When a hardware configuration with fail-safe modules has been imported, a PROFIsafe
function block appears in the project navigator under function blocks.
This function block contains an instance for each F module. During download of the project,
the function blocks are downloaded to the SIMIT UNIT and activated.

SIMULATIONUnit V9.1
80 System Manual, 06/2018
Simulation of PROFINET components
5.10 Simulation of fail-safe modules (PROFIsafe V2)

Some digital fail-safe modules contain an assigned enable bit (yellow) in addition to the actual
data bits; the enable bit can be used to lock or enable the respective channel.
In addition, in the hardware view you can also see some status bits as the last channels, which
provide information about the status of the fail-safe communication.
Meaning of the most important status bits:

OA_Req Operator Acknowledge request - F block must be acknowledged in the F-program


R_cons_nr Reset fail-safe block
activate_FV Activate fail-safe values - module is passivated, IOs invalid

If fail-safe operation is activated, all status bits = 0 and the fail-safe module has a yellow border.

5.10.1 Troubleshooting
The output byte "DIAG" of the F-instance DB blocks in STEP 7/TIA provides information about
the error state.

*DIAG* (hex) *Meaning*


0 OK
10 Timeout - TIMEOUT parameter may be set too low
40 CRC error - Parameter error in SIMULATIONUnit
50 CRC error + timeout

SIMULATIONUnit V9.1
System Manual, 06/2018 81
Simulation of PROFINET components
5.11 Simulation of redundancy

One possible cause of a non-functioning F-simulation may be an F-monitoring time in STEP


7 which is set too low. In the STEP7 hardware configuration a F_WD_Time parameter or F-
monitoring time can be set for some fail-safe modules. Increasing this parameter may possibly
rectify the fault.

5.11 Simulation of redundancy


There are different types of redundancy with PROFINET:

5.11.1 MRP ring redundancy


A ring topology is set up. An MRP master in the network (usually the PNIO controller) checks
whether the ring is closed. If so, the MRP master interrupts the ring.
SIMIT UNIT PN supports the simulation of MRP clients. With the single-channel SIMIT UNIT
PN 128, the ring cannot be closed when the PNIO controller is part of the ring.
With the two-channel SIMIT UNIT PN 256, a complete MRP ring can be set up using the two
ports P1 and P2.
Redundancy switchover cannot be simulated.
Redundancy switchover for MRP is not smooth, which means all devices fail and the
connections are established again.

5.11.2 System redundancy S2


Every redundant PNIO device can establish a PNIO connection to two PNIO controllers of an
H machine.
The SIMIT UNIT PN 256 supports the simulation of system redundancy S2. For this, one PNIO
controller has to be connected to port P1 and the other one to port P2. A combination of real
and non-redundant devices is possible.
You will see a redundant device symbol indicating which channel is active (green side) and
which passive (black side). The left-hand side of the symbols shows the connection to SU port
P1, the right side shows SU port P2.

SIMULATIONUnit V9.1
82 System Manual, 06/2018
Simulation of PROFINET components
5.11 Simulation of redundancy

You can simulate a redundancy switch by simulating a device failure at port P1 or P2. Right-
clicking on a PROFINET device displays these items in the menu.

Note
For a non-redundant device on the second line
● Manually attach a non-redundant device in SIMULATIONUnit to the first line:
Example: All redundant devices and non-redundant devices which are attached to
PROFINET line 100 were imported at SU line 0. An additional non-redundant device, which
was imported on SU line 1, was configured on the PROFINET line 101.
Possible solution: Change to the "Edit hardware" mode in SIMULATIONUnit. Attach the
individual device from SU line 1 to SU line 0.
● Use an additional SIMIT UNIT PN for the non-redundant devices on the second line.
Possible solution: Connect both SIMIT UNITS to the CPU. The first SIMIT UNIT simulates
all redundant devices on the first line. The second SIMIT UNIT simulates all non-redundant
devices on the second line.

5.11.3 System redundancy R1 and R2


The PNIO devices have two heads which can establish connections to two PNIO controllers
of an H machine independently.
● R1: Is supported and is treated in a similar way for S2. A maximum of 128 devices can be
simulated at R1. When you simulate redundancy at R1, disconnect the ports in the
simulation project.
Both buttons must not have the same IP address even if the networks are configured
separately.
● R2: This kind of redundancy is currently not supported.

SIMULATIONUnit V9.1
System Manual, 06/2018 83
Simulation of PROFINET components
5.13 Shared Device simulation

5.12 Prioritized startup


Some PNIO devices use the feature "Fast Startup", activated from the PNIO controller, for
running a parametrized device faster after Power On. A simulated device has to be
parametrized once in the normal way by the PNIO controller. After that you can simulate fast
startup via "Device failure" and "Device return" or "Line failure" and "Line return".

5.13 Shared Device simulation


SIMULATIONUnit supports the simulation of a Shared Device. To do so, import both lines (one
line per CPU with Shared Device) simultaneously into the same simulation project.

Note
Procedure for STEP 7 V5.6
1. Create a project in SIMULATIONUnit.
2. Import (Page 40) the hardware in the following order:
– SDB files of the first CPU which configures the header module of the Shared Device.
– CFG file of the first CPU
– SDB files of the second CPU that does not configure the header module of the Shared
Device.
An error message is displayed which signals that the header module was not
recognized. The error is remedied in the next step.
3. Import the CFG file of the second CPU to the hardware editor.
4. Click "Apply changes".
Only the modules that are assigned to the respective devices are displayed. The header
module is necessary for the SIMIT UNIT PN for the first as well as the second CPU.

SIMULATIONUnit V9.1
84 System Manual, 06/2018
Manipulation of the simulated devices 6
6.1 I/O values
I/O values in SIMULATIONUnit can be controlled and monitored in the hardware view, the I/O
view and in function instance windows in the runtime system or even self configured
worksheets. It is ensured that the same IO value is always consistent in all windows. The I/O
values are updated approximately every second in all windows.

6.1.1 I/O names


The names of the I/O values in SIMULATIONUnit contain the simulation hardware index and
the address name as in a STEP 7 project. They have the following format:
S<hardware index><I/O type><log. address>
For example:
S001AW512 - SU hardware no. 001, output from AS view, word, logical address 512
S000E17.2 - SU hardware no. 000, input from AS view, bit, logical address 17, bit no. 2

Symbolic addresses
Symbolic addresses can also be managed and displayed in SIMULATIONUnit (see IO view,
second column).

6.1.2 Analog values


Analog values can be displayed in SIMULATIONUnit depending on the simulated hardware
or as a technological unit. Physical units are already predefined in the system. The display is
always the same in the hardware tree, in the I/O view and in the instance view of runtime
functions.
To select the unit, select the corresponding channel and right-click on the menu command
"Select unit".

SIMULATIONUnit V9.1
System Manual, 06/2018 85
Manipulation of the simulated devices
6.2 Alarm generation and triggering

The menu shown contains the conversion definitions for the most used sensors and actuators.
In addition, the analog value can also be displayed as "raw data" as a decimal or hexadecimal
value.
If you have selected an analog value in the hardware view, you will also see the menu
command "Use unit as default for the module”, which can be used to simultaneously set all
analog values of the selected module to the same unit.

6.2 Alarm generation and triggering

6.2.1 For PROFIBUS


In SIMULATIONUnit, for every slave type, the alarms to be triggered can be edited via a type-
related XML file and then triggered in the menu or runtime system.

Device fault
Open the hardware view. Right-clicking on an element of the hardware view opens a shortcut
menu with the possible actions. With a SIMIT UNIT, you can let the entire line fail, for example.
Right-click on devices to have the corresponding device fail.
It is also possible to simulate device faults with the help of the runtime system. Use the
"DeviceAusfall" basic function for this.

SIMULATIONUnit V9.1
86 System Manual, 06/2018
Manipulation of the simulated devices
6.2 Alarm generation and triggering

The three inputs of the function must be parameterized with the line number (HwId), slave
number (Slv) and the control bit (Control). The slave number can be assigned parameters as
follows:
● HwId = Number of the SU line
● Slv = PROFIBUS address of the slave
● Control = 0: Slave has failed
● Control = 1: Slave simulated

Description of a PROFIBUS alarm in the XML file


The folder "<SIMULATIONUnit program folder>\ALM\Profibus" contains an XML file
(DiagDP.xml) which defines the alarm behavior of a PROFIBUS slave in accordance with the
PROFIBUS standard.
Type-related alarm files can still be created for each slave type here. The file name is formed
from the PROFIBUS ID of the slave:
For example: ET200M type (hexadecimal): 0x801D -> file name: "Diag801D.xml".
In a Simba project folder, you can find the PROFIBUS ID in the project.xml file under the XML
key "TYPE".
The alarm files have the following syntax:

<Diagnose>
<MENU>
<INDEX>0</INDEX> // Index via which the alarm can be triggered (index 0 should always
be the reentry of standard diagnostics!)
<LEVEL>1</LEVEL> //Abstraction level to which the entry relates (0 = Slave, 1 = Module,
2 = Channel)
<ITEMTYPE>MODULE</ITEMTYPE> //Object type for which the entry is displayed.
<FUNCTION>DPALARM</FUNCTION> //Editing function, currently always "DPALARM"
<DATA>$IDENTBLOCK,01,02,03,04,99</DATA> //Hex. diagnostic bytes according to
standard diagnostics or pre-defined macro blocks
<ACTIVE>0</ACTIVE> //Active state of the object after triggered alarm
<NAME>Standard diagnostics</NAME> //Menu display name
</MENU>
<MENU>
...
</MENU>
</Diagnose>

A data block has to be created for every alarm if it does not already exist.
Diagnostic data can be used as comma-separated hex bytes (e.g. "43,00,00") or as pre-defined
diagnostic macros. Both entry types can be used in any combination.

SIMULATIONUnit V9.1
System Manual, 06/2018 87
Manipulation of the simulated devices
6.2 Alarm generation and triggering

Diagnostics macros
Diagnostic macros are defined keys which can be inserted in the "DATA" area. When the
program detects a key of this sort, a data block is automatically generated. In addition, for
every macro there must be a Tag of the same name with the required parameterization data
in the XML file, if necessary.

Identifier-related diagnostics (must always be at the start of diagnostics)


<DATA>$IDENTBLOCK,.... </DATA>
<IDENTBLOCK>
<ISERROR>0</ISERROR> //defines whether the error bit is set for the selected module
</IDENTBLOCK>

Module status
<DATA>...,$MODULEBLOCK,.... </DATA>
<MODULEBLOCK>
<ERRORVALUE>1</ERRORVALUE> //0 module ok, 1 defective, 2 - wrong module, 3 - no module
<MODULEBLOCK>

Channel-related diagnostics
<DATA>...,$CHANNELBLOCK,.... </DATA>
<CHANNELBLOCK>
<ERRORVALUE>3</ERRORVALUE> //Error type in accordance with PROFIBUS standard
<CHANNELBLOCK>

Alarm block
<DATA>...,$ALARMBLOCK,.... </DATA>
<ALARMBLOCK>
<REASON>PullModule</REASON>
//Alarm type: "PullModule", "PlugModule", "Process", "DiagError", "DiagOK"
<MODULEERROR>00101007</MODULEERROR>
//Module error type for diagnostic interrupts (32 bit)
<CHANNELERROR>10</CHANNELERROR>
//Channel error type for diagnostic interrupts (here, for example, wire break)
<ALARMBLOCK>

Standard block
<DATA>$STANDARDBLOCK</DATA>
This block does not have any parameterized data. Its inclusion in the menu only causes the reset of
any diagnostic information to standard diagnostics.
The index must be unique across the entire diagnostics file. The "DiagDP.xml" file is read first. If a type-
related alarm file is present, this is also read in. If identical indices are detected, the type-related alarm
file overwrites the standard alarm.

SIMULATIONUnit V9.1
88 System Manual, 06/2018
Manipulation of the simulated devices
6.2 Alarm generation and triggering

Triggering the alarm by menu


In the same way as the device fault, the respective alarm can be triggered with the help of the
shortcut menu for the module in the hardware view of SIMULATIONUnit.

Triggering the alarm via the runtime system


For triggering alarms by event you have to create a new function block with the function editor.
There are integrated basic functions for this in the system: "SlaveAlarm".
The basic function "SlaveAlarm" is used to trigger the alarm. Four parameters are required for
this function: A random I/O address of the object that is to signal the alarm, a control bit that
triggers the event, and two constants which represent various alarms at the edges of the control
bit. These constants correspond to the "INDEX" keyword for the corresponding alarm in the
XML file.

6.2.2 For PROFINET IO


In SIMULATIONUnit, the alarms to be triggered for a device type can be edited in a type-related
XML file and then triggered by menu or by runtime system.

Device fault
Open the hardware view. Right-clicking on an element of the hardware view opens a shortcut
menu.
Here you will find different menu commands for simulating device faults, depending on the
simulated device type, e.g. for PROFINET: Device fault, device return. In addition, you can
also simulate a fault of the whole line. For this, right-click on the symbol of the SU module and
the "Line fault" function is executed in the shortcut menu.
It is also possible to simulate device faults with the help of the runtime system. Use the
"DeviceAusfall" basic function for this.
The three inputs of the function must be parameterized with the SU number (HwId), device
number (Slv) and the control bit (Control). The device number can be assigned parameters as
follows:
● HwId = Number of the SU line
● Slv = PROFINET address of the device
● Control = 1: Device simulated
● Control = 0: Device has failed

Description of a PROFINET IO alarm in the XML file


The alarm file for a PROFINET device is located in the folder "<SIMULATIONUnit program
folder>\ALM\PNIODEV". The file name is formed from the VendorID and the DeviceID of the
device:
e.g.: ET200S type (hexadecimal): VendorID=0x002a, DeviceID=0x0301 ->
file name: "Diag002a0301.xml"

SIMULATIONUnit V9.1
System Manual, 06/2018 89
Manipulation of the simulated devices
6.2 Alarm generation and triggering

In a Simba project folder you can find the VendorID and DeviceID in
the "project.xml" file under the XML key "TYPE".
The alarm file has the following structure:

<Diagnose>
<MENU>
<INDEX>0</INDEX>
<NAME>short circuit</NAME>
<SUBTYPE>CHANNEL</SUBTYPE>
<FUNCTION>PNIOALARM </FUNCTION>
<ACTIVE>2</ACTIVE>
<ERRTYPE>1</ERRTYPE>
</MENU>
<MENU>
...
</MENU>
</Diagnose>
A data block has to be created for every alarm if it does not already exist.

Table 6-1 Meaning of the keys:

NAME Is used to show the alarm in the shortcut menu.


INDEX Identifies the alarm in the file. All indexes have to be unique in the .xml file.
FUNCTION Please do not change. Instead of the "DATA" key you can use the "FUNCTION" key to specify the name of
a C function.
The diagnostic data is then calculated by a C function if this was implemented in SIMULATIONUnit.
ACTIVE Determines which status is to be displayed for the object after triggering of the alarm. Valid values are:
0 - inactive
1 - active
2 - disrupted
ERRTYPE Defined PROFINET IO error code

Triggering the alarm by menu


The respective alarm can be triggered with the help of the shortcut menu for the device, slot
or channel in the hardware view of SIMULATIONUnit.

Triggering the alarm via the runtime system


For triggering alarms by event you have to create a new function block with the function editor.
For this, the system features are integrated basic functions for PROFINET:
"PNIO_Module_Alarm" and "PNIO_Channel_Diag".
The basic function "PNIO_Module_Alarm" triggers a module-dependent alarm.

SIMULATIONUnit V9.1
90 System Manual, 06/2018
Manipulation of the simulated devices
6.3 PROFIsafe V1 (F_SEND, F_RECV)

Four parameters are required for this function:


● Line number
● Device number
● Slot number
● Control bit triggering the alarm (Control= 1 → all OK, Control = 0 → Module failed)
The basic function "PNIO_Channel_Diag" triggers a channel-dependent alarm.
Three parameters are required for this function:
● A random I/O address of the object that is to signal the alarm
● An alarm index (see xml file)
● A control bit that triggers the event

6.3 PROFIsafe V1 (F_SEND, F_RECV)


This chapter describes the simulation of fail-safe master-master communication (PROFIsafe
V1) with SIMULATIONUnit. For this, the counterpart of a real F_SENDDP/F_RCVDP block
configured in the CPU is simulated with SIMULATIONUnit. The SIMIT UNIT PROFIBUS or
PROFINET simulates the configured DP/DP coupler or PN/PN coupler with the respective
universal modules, the F-communication is simulated using the user data of the modules.

6.3.1 Import of a configuration with PROFIsafe


The hardware import in SIMULATIONUnit works in the same way as in a standard project. In
the HW Config of the S7 project, you only need to ensure that the universal modules in the DP/
DP coupler have the correct length for the F-communication blocks.
+----------+ ----12 bytes----> +----------+
| F_SENDDP | | F_RECVDP |
+----------+ <----6 Bytes----- +----------+
If an incorrect length is configured (e.g. a larger range), SIMULATIONUnit recognizes the
module as a standard I/O module.
A PROFIsafe_V1 function is automatically installed in SIMULATIONUnit for PROFINET. Each
F_SENDDP/F_RCVDP block in the real CPU has a counterparty in SIMULATIONUnit.

6.3.2 Necessary parameters in the SIMULATIONUnit function instances


In the function instances of the simulated blocks, you have to configure two parameters relating
to a secure connection to establish the connection correctly.
DP_DP_ID
System-wide unique connection ID. This parameter must be identical to the parameter with
the same name of the partner block in the CPU.

SIMULATIONUnit V9.1
System Manual, 06/2018 91
Manipulation of the simulated devices
6.3 PROFIsafe V1 (F_SEND, F_RECV)

CRC_enable
To enable CRC processing in the SIMIT UNIT, this parameter must contain the value 80h.

6.3.3 Simulation F_RCVDP


For simulation of an F_RCVDP, only the values DP_DP_ID and CRC_enable have to be correct.

6.3.4 Simulation F_SENDDP


When simulating the send block F_SENDDP, the DP_DP_ID and CRC_enable must be
specified correctly in the faceplate. If the values are correct before the CPU starts, the
connection will be established after starting the CPU. If the CPU was running before this, the
F_RCVDP block has to be reintegrated in the CPU via the ACK_REI input.

NOTICE
In case of a broken connection (e.g. pulling the PROFIBUS cable), the CPU has to be
restarted for reintegration. Otherwise, its internal telegram counter is not reset.

SIMULATIONUnit V9.1
92 System Manual, 06/2018
Manipulation of the simulated devices
6.3 PROFIsafe V1 (F_SEND, F_RECV)

6.3.5 Troubleshooting
The output byte DIAG of the F_SENDDP/F_RECV_DP blocks in Step 7/TIA provides
information about the fault condition.

*DIAG* (hex) *Meaning*


0 OK
10 Timeout - TIMEOUT parameter may be set too low
40 CRC error - Parameter error in SIMULATIONUnit
50 CRC error + timeout

SIMULATIONUnit V9.1
System Manual, 06/2018 93
Manipulation of the simulated devices
6.3 PROFIsafe V1 (F_SEND, F_RECV)

SIMULATIONUnit V9.1
94 System Manual, 06/2018
Runtime system 7
The runtime system integrated in SIMULATIONUnit is used for processing aggregate and
typical functions which are essential for the FAT test of PCS 7 systems. These functions are
generated as a block and can then be instanced as often as required.
The SIMIT UNIT PN also offers the possibility of downloading most aggregate and typical
functions to the box and then executing them in the real-time runtime system.
The cycle time of the functions is the PROFINET send clock.

7.1 Copy block types to the project


Block types can be copied to the project navigator from a globally available type library or from
a different simulation project. They are then available to the runtime system and can be
instanced for this project.

Menu Simulation → Copy function


or right-click in the project navigator on "Function blocks" or on any function. Then select "Copy
function" in the menu.
To exit, click Cancel in the project navigation on the left.
If SIMULATIONUnit was installed in the folder C:\Programs, the
default path of the library functions is write-protected.

SIMULATIONUnit V9.1
System Manual, 06/2018 95
Runtime system
7.2 Editing function block types

7.2 Editing function block types


Function blocks can be created from a list of basic functions.

Double-click "Function blocks" in the navigation bar on the left to create a new function block.
Right-clicking on a function block and selecting the menu command "Edit function" opens a
function block for editing.
Name: The name of the function block must be entered here. If another block with the same
name already exists, it is overwritten at Save.
Type: The place where the function block is to be executed.

Software function Simulation PC

SU PB function SIMIT UNIT PB

SU PNIO function SIMIT UNIT PN

Some of the basic functions are suitable for several types. The table 'Implemented basic
functions' provides information on which basic functions can be executed where.
Integration of basic functions

SIMULATIONUnit V9.1
96 System Manual, 06/2018
Runtime system
7.2 Editing function block types

Here, one or more basic functions from the list on the right are added, which can be executed
from top to bottom. In this example the basic functions Switch and PT_1 are added.
Switch has 3 inputs and 1 output
PT_1 has 2 inputs and 1 output

Global inputs
Global inputs are inputs for the function block to which you can interconnect I/Os, flags or
constants in the function instances.
A global input can be created by right-clicking → "Add global input"
An entry IN0, IN1, IN… then appears in the column Global input.
If the same global input is to be interconnected to several basic function inputs, then the same
input can be selected from the drop box in different lines. Click the text in the Input column to
change the name of the global input.

Global outputs
Global outputs are outputs for the function block to which you can interconnect I/Os or flags
in the function instances.
A global output can be created by right-clicking → "Add global output"
A text with the name of the output then appears in the Global output column. Click on the text
to change it.

Constants
Constants can be interconnected to individual inputs of the basic functions.
Right-click on the input of a basic function and select "Constant as input". The value 0 is
displayed in the Input column.
Click on the value to change it. Only numerical values are possible.

Interconnections between the basic functions


In this example, the output of the function Switch was interconnected to the first input of the
function PT_1. To do this, click on the output and drag it to the input.
Important: The functions are performed from top to bottom.

SIMULATIONUnit V9.1
System Manual, 06/2018 97
Runtime system
7.3 Block instances

7.3 Block instances


All instances of a block type are displayed in the instance view for the respective block. (Double-
click on the block type in the project navigator window)

Inserting an instance
Right-click on Instances → Add instance.
All inputs and outputs of the instance must be interconnected in order to activate the instance.
From the hardware view, the I/O view or flag view, I/Os can be dragged to an input or output
with the mouse. It is also possible to enter the name of the I/O in the input field. Numerical
constants can also be connected to the inputs. To do this, enter the number in the input field.

(De)activating instances
/ Activate/deactivate instance If the instance is deactivated, it is not processed by the
runtime system.

Mark an instance
/ ✓ The user can mark an instance as "checked" here. This setting does not affect the
simulation.

Renaming an instance
Right-click on an instance name → Rename instance. Any instance name can be entered.

7.3.1 Export and import of block instances


Instances can be imported from a .csv file (text file where the columns are separated by a
semicolon, comma or tab, compatible with Excel).
Right-click in the instance window and in the menu select: "Export instances" or "Import
instances"

SIMULATIONUnit V9.1
98 System Manual, 06/2018
Runtime system
7.4 Start/stop runtime system

Five columns, which must have the following entries, are evaluated:
● Name of the function
● Name of the instance
● I/O address, flag or constant
● Parameter number
● I/O type
– 1 = input
– 2 = output
– 3 = flag at input
– 4 = flag at output
– 5 = constant
To obtain a template, you can create function instances as described under Inserting an
instance and then export them as .csv files. To do this, right-click in the block instance window
and select "Export instances" in the pop-up menu.
To import instances, right-click in the block instance window and select "Import instances" in
the pop-up menu.
The structure of a .csv file for import or export can be seen in the following example:

Function name; Instance name; Log. address; Parameter number; I/O type;
Motor; Motor_0; S000A0.0; 0; 2;
Motor; Motor_0; S000AW256; 1; 2;
Motor; Motor_0; S000E0.0; 0; 1;
Motor; Motor_0; S000EW256; 1; 1;

Motor; Motor_1; S000A0.1; 0; 2;


Motor; Motor_1; 1000; 1; 5;
Motor; Motor_1; S000E0.1; 0; 1;
Motor; Motor_1; S000EW258; 1; 1;

This file contains two instances of the function block Motor.

7.4 Start/stop runtime system


If the runtime system is started, all block instances are activated where the option "System
= activated" is enabled. If the option "System = deactivated" is enabled for the instance, the
runtime system does not process the instance.
A successful connection to the simulation box is required to run the block functions.
Menu "Simulation" → "Stop runtime system"
Menu "Simulation" → "Start runtime system"
If the runtime system is stopped, all instances of the block instances are deactivated.

SIMULATIONUnit V9.1
System Manual, 06/2018 99
Runtime system
7.5 Implemented basic functions

7.4.1 Activate function blocks in the SIMIT UNIT


Block instances that contain a reference to one of the function blocks used in the SIMIT UNIT
PN/PB (e.g. "RedundanzBlock" or "FailsafeBlock") are executed in the SIMIT UNIT. The
insertion of the function blocks requires a successful connection to the simulation box. The
functions are inserted and removed on download. These function blocks cannot be selectively
stopped. If an instance is deactivated, it is skipped on the next download.
Most runtime system functions which can be executed on the simulation PC can also be
downloaded to the SIMIT UNIT PN. All instances of a function block are downloaded as a real-
time runtime system function to the simulation box if the function type "SU PB function" (for
SIMIT UNIT PB) or "SU PNIO function" (for SIMIT UNIT PN) is selected in the function editor.
In addition to each function block, a symbol indicating the place of execution is displayed in
the navigation bar. If the runtime system is running, the symbols have a green border.

Software function Simulation PC

SU PB function SIMIT UNIT PB

SU PNIO function SIMIT UNIT PN

The SU PNIO function Functions is always executed cyclically. The cycle time is the
PROFINET send clock.
Existing PC software functions can be converted to SU PNIO functions and vice versa if all
basic functions are present for both function types. Compatible functions are listed in the
following chapter.
Restrictions:
All inputs, outputs or flags that are connected to the inputs and outputs of the simulation box
hardware functions must belong to the same simulation box. The connection of constants to
function inputs is also possible. Flags can be connected for operation at function inputs. Flags
at function outputs are allowed, they are, however, only managed internally and are not
displayed in the SIMULATIONUnit interface.

7.5 Implemented basic functions

Table 7-1 Arithmetic:

Name Description PC function SU PB func‐ SU PN func‐ Inputs Outputs Function /


tion tion Comment
Add Adder ✓ ✓ X, Y X+Y Add X+Y
Sub Subtractor ✓ ✓ X, Y X-Y Subtract X-Y
Mul Multiplier ✓ ✓ X, Y X*Y Multiplier X*Y
Div Divider ✓ ✓ X, Y X/Y Divider X/Y
Pow Power of ✓ ✓ X, Y X^Y X power of Y

SIMULATIONUnit V9.1
100 System Manual, 06/2018
Runtime system
7.5 Implemented basic functions

Table 7-2 Comparator:

Name Description PC function SU PB func‐ SU PN func‐ Inputs Outputs Function /


tion tion Comment
Equal equal to ✓ ✓ X, Y X==Y if X = Y: Out‐
put = 1 if X is
not equal to
Y: Output = 0
Gt greater than ✓ ✓ X, Y X>Y if X > Y: Out‐
put = 1 if X <=
Y: Output = 0
Limit Limitation ✓ ✓ XO, X, XU Y if X > XO: Y =
XO if X < XU:
Y = XU, else
Y=X
LevelTrigger Threshold ✓ ✓ IN, Level Trig if IN >= Level:
(greater than Trig = 1, else
or equal) Trig = 0

Table 7-3 Copy functions:

Name Description PC function SU PB func‐ SU PN func‐ Inputs Outputs Function /


tion tion Comment
Bits2Byte Copy 8 Bits ✓ ✓ X0, X1, X2, Y Groups 8 bits
to Byte X3, X4, X5, to form one
X6, X7 byte (X0 =
LSB)
Byte2Bits Copy Byte to ✓ ✓ X Y0, Y1, Y2, Splits a byte
8 Bits Y3, Y4, Y5, into 8 bits (Y0
Y6, Y7 = LSB)
Bytes2DW Copy 4 Bytes ✓ ✓ X0, X1, X2, Y Combines 4
to Double‐ X3 bytes into a
word double word
(X0 = LSB)
DW2Bytes Copy Double‐ ✓ ✓ X Y0, Y1, Y2, Splits a dou‐
word to 4 Y3 ble word into
Bytes 4 bytes (Y0 =
LSB)
Connect Copy ✓ ✓ X Y Copies X to Y
Con‐ Copies to 2 ✓ X Y0, Y1 Copies X to
nect4Two outputs Y0 and Y1
SlaveMirror Slave Mirror ✓ Slv Copies all
outputs of the
slave with the
addr. slv to its
inputs

SIMULATIONUnit V9.1
System Manual, 06/2018 101
Runtime system
7.5 Implemented basic functions

Table 7-4 Digital:

Name Description PC function SU PB func‐ SU PN func‐ Inputs Outputs Function /


tion tion Comment
And log. AND ✓ ✓ X, Y X&Y AND bitwise
Neg Inverter ✓ ✓ X /X If X=0: /X=1,
else /X=0
Or log. OR ✓ ✓ X, Y XorY OR bitwise
XOR log. exclu‐ ✓ ✓ X0, X1 Y Exclusive OR
sive OR bitwise
Counter Counter / ✓ ✓ Step, Clk, Clr Y The L-H edge
Ramp of Clk increa‐
ses Y by
Step, Clr=1
sets Y to 0
Bin2Gray Binary to ✓ ✓ BinCnt GrayCnt A binary
Gray Code counter value
converter at the input
BinCnt gener‐
ates Gray‐
Code counter
value
GrayCnt
Shift1 1-bit shift reg‐ ✓ ✓ X, CLK Y At the L-H
ister edge of the
created
"Clk", the val‐
ue at X is cop‐
ied to the
memory and
the old mem‐
ory value is
output at Y, X-
> Mem0 -> Y
Switch Analog value ✓ ✓ X1, X2, S X1/X2 S=1: X1/X2 =
switch X1, S=0: X1/
X2 = X2
OneOf8 1 of 8 multi‐ ✓ ✓ X Y1, Y2, Y3, X=1: Y1=1,
plexers Y4, Y5, Y6, others=0 ,
Y7, Y8 X=2: Y2=1,
others=0,
X=3: Y3=1,
others=0, …,
X>8 or X<0:
all outputs =0
FlipFlop RS-FlipFlop ✓ ✓ Set, Reset Q If R=1: Q=0
(S is ignored)
if S=1, R=0:
Q=1, if S=0,
R=0: Q
keeps last
value

SIMULATIONUnit V9.1
102 System Manual, 06/2018
Runtime system
7.5 Implemented basic functions

Table 7-5 Timers:

Name Description PC function SU PB func‐ SU PN func‐ Inputs Outputs Function /


tion tion Comment
PT_1 PT 1 part ✓ ✓ X, TA Y Start value Y
= 0, the input
signal is out‐
put to the out‐
put signal
with a delay,
after expiry of
TA, Y is
about 63% of
the end value.
Impuls Pulse encod‐ ✓ ✓ Trigger, Imp When trigger
er Time[ms] = positive
edge (0 -> 1):
"Imp" is
switched for
"Time"[ms]
from 1, after‐
wards Imp = 0
DelaySwitch ON time ✓ ✓ X, Time[ms] Y When X =
positive edge
(0 -> 1): on
expiry of time
Time[ms] Y is
set from 0 to
1 if X = 0: Y =
0
SqareWave Square wave ✓ ✓ Period[ms] Y generates a
signal square wave
signal, with
the specified
period[ms]
Integral Ramp func‐ ✓ ✓ Step, Clk, Clr Y The L-H edge
tion of Clk increa‐
ses Y by
Step, Clr=1
sets Y to 0

SIMULATIONUnit V9.1
System Manual, 06/2018 103
Runtime system
7.5 Implemented basic functions

Name Description PC function SU PB func‐ SU PN func‐ Inputs Outputs Function /


tion tion Comment
ZigZag Ramp func‐ ✓ Clk, Reset, Y Reset=1:
tion StepUp, Y=Min, for
StepDown, each L>H
Min, Max edge at Clk,
Y is in‐
creased by
StepUp if Y
>Max:
Y=Max, from
now Y is in‐
creased by
StepDown
(StepDown
should be
negative), if Y
< Min:
Y=Min, from
now Y is in‐
creased by
StepUp
ImpulseStep increase/de‐ ✓ Reset, Imp‐ Y If Reset=1:
crease Up, Imp‐ Y=0 if L>H
Down, Step‐ edge at Imp‐
Up, Step‐ Up: Y=Y
Down +StepUp if L-
>H edge at
ImpDown:
Y=Y-Step‐
Down
SysClk System timer ✓ Enable Y If Enable = 1,
the timer will
change its
output status
according to
the adjusted
system clock.
ClkDiv Clock divider ✓ Clk, Period Y Clk counts
one counter
back internal‐
ly, with zero
crossing an H
pulse ap‐
pears at Y
and the coun‐
ter is preset
again with
Period

SIMULATIONUnit V9.1
104 System Manual, 06/2018
Runtime system
7.5 Implemented basic functions

Table 7-6 Slave functions:

Name Description PC function SU PB func‐ SU PN func‐ Inputs Outputs Function /


tion tion Comment
SlaveAd‐ PROFIBUS ✓ EA Slv "Slv" returns
dress address the address
of the associ‐
ated slave of
any I/O
SlaveAlarm PROFIBUS ✓ EA Control "EA" = IO
alarm start address
of the alarm
slave, "Con‐
trol" bit trig‐
gers an
alarm, L -> H
Idx : ALARM
INCOMING,
H → L Idx :
ALARM OUT‐
GOING
DeviceAus‐ Slave/device ✓ HwId, Slv, Control = 1:
fall fault/return Control Slave return,
control = 0:
Slave failure
is simulated
PNIO_Mod‐ Pull/plug ✓ HWIdx, DE‐ active 0->1:
ule_Alarm module VIdx, MOD‐ Plug module,
Idx, active active 1->0:
Pull module
PNIO_Chan‐ PROFINE‐ ✓ IOAddr, Dia‐ IOAddr:
nel_Diag TIO channel gIdx, active channel ad‐
fault dress
(S000I1.2),
DiagIdx: In‐
dex from the
diagnostics
file, active 0-
>1: Trigger
channel diag‐
nostics, ac‐
tive 1->0: Re‐
move chan‐
nel diagnos‐
tics

SIMULATIONUnit V9.1
System Manual, 06/2018 105
Runtime system
7.5 Implemented basic functions

Name Description PC function SU PB func‐ SU PN func‐ Inputs Outputs Function /


tion tion Comment
GetDeviceS‐ Return de‐ ✓ HwId, Slv State HwId: SU line
tate vice status number
Slv: Slave ad‐
dress.
These bits
can be set in
State:
- 0 = is not si‐
mulated
- 1 = active
- 2 = fault
- 4 = data ex‐
change with
controller (on‐
ly with slaves)
- 8 = redun‐
dant 16 : ac‐
tive redun‐
dant partner
TM_COUN‐ Teleperm ✓ HWid, BG,
TER counter Ch, Cnt, Dist
TM_SQRT Teleperm ✓ X Y
square root

Table 7-7 Special functions:

Name Description PC function SU PB func‐ SU PN func‐ Inputs Outputs Function /


tion tion Comment
GetTimerVal‐ PROFIBUS ✓ Slv, Ena/Res ActTime, Min‐
ue Global-Con‐ Time, Max‐
trol-Operate Time,
Time DsTime
GetCycleInfo Cycle times ✓ Cycle, Time Configured
of the run‐ cycle time in
time system [ms], meas‐
ured process‐
ing time of a
cycle in ms
NullFunction Dummy, ✓ ✓ Value:
does nothing

SIMULATIONUnit V9.1
106 System Manual, 06/2018
Runtime system
7.5 Implemented basic functions

Table 7-8 SIMIT UNIT hardware functions:

Name Description PC function SU PB func‐ SU PN func‐ Inputs Outputs Function /


tion tion Comment
F_SLAVE Fail-safe ✓ HW_ID, Slv, is automati‐
module func‐ Slot4..11 cally created
tions during import
of the hard‐
ware configu‐
ration
H_DIAG‐ Redundancy ✓ HW_ID, Slv is automati‐
NOSE module func‐ cally created
tion during import
of the hard‐
ware configu‐
ration
MC_FIRM‐ Module func‐ ✓ For internal
WARE tion use only
WATCHDOG Module func‐ ✓ For internal
tion use only
PROFIsafe Profisafe V2 ✓ A, A_Len, Fail-safe
E_Len, Re‐ function, is
cord1, E automatically
inserted
PROFI‐ Profisafe V1 ✓ A, A_Len, F_send/F_re‐
safe_V1 E_Len, Re‐ ceive func‐
cord1, E tion, is auto‐
matically in‐
serted
sinamicsSim Motor axis ✓ TelIn TelOut simulates
according to sign of life
Profidrive and Profi‐
specification drive state
machine
DigitalIn ✓ InByte Reads the
digital inputs
on the SU
module
DigitalOut ✓ OutByte switches the
digital output
at the SU
PNIO mod‐
ule.
DQ_substi‐ Substitute ✓ Record, Output Installed au‐
tute value for NrBits tomatically if
CPU stop the informa‐
module func‐ tion is availa‐
tion ble in
GSDML and
GSML has
been impor‐
ted

SIMULATIONUnit V9.1
System Manual, 06/2018 107
Runtime system
7.7 Flag memory

Name Description PC function SU PB func‐ SU PN func‐ Inputs Outputs Function /


tion tion Comment
AQ_substi‐ Substitute ✓ Record, Output Installed au‐
tute value for NrBytes tomatically if
CPU stop the informa‐
module func‐ tion is availa‐
tion ble in
GSDML and
GSML has
been impor‐
ted
DIx_Proces‐ Hardware in‐ ✓ Input, device, Installed au‐
sAlarm terrupt mod‐ slot, subslot, tomatically if
ule function record the informa‐
tion is availa‐
ble in
GSDML and
GSML has
been impor‐
ted

7.6 Cycle time of runtime system


The cycle time with which the functions are executed can be set under Settings / Options.

7.7 Flag memory


For free use by the runtime system, a flag area of 4096 bytes is available in SIMULATIONUnit
for every item of hardware in the project. This flag area can be freely described and read by
the user software.
The addressing of the flag memory is carried out in the same way as the I/O addresses by a
logical address specification (e.g. "S000M0.1", "S000MB10", "S000MW256", "S003MD500").
With the help of flags, data can be operated and monitored in function instances and connected
between different instances.
The flag view
Double-click on the flag in the navigation bar on the left.
Users are provided with the flag view for operator control and monitoring of flags. All the flags
used in the function instances are displayed here.

SIMULATIONUnit V9.1
108 System Manual, 06/2018
The programming interface of SIMULATIONUnit 8
8.1 General
The programming interface integrated in SIMULATIONUnit offers a user-friendly API which
enables the convenient coupling of almost any simulation system to SIMULATIONUnit or to
the simulation hardware. The simulation system does not need to take care of the functioning
of the hardware, this function is covered by the configuration with SIMULATIONUnit.

8.2 Configuration
The following commands can be used to access SIMIT UNITs outside of
SIMULATIONUnit.exe. This is an API interface from simbakern.dll for 32-bit systems or
simbakern64.dll for 64-bit systems. The commands may be executed even if
SIMULATIONUnit.EXE has not been started before. SIMULATIONUnit.exe can run in the
background, however, while a different program takes over control. SIMULATIONUnit.exe then
switches to listening mode.
Supported operating systems are WINDOWS 32-bit (Win7) or WINDOWS 64-bit (Win7/8/10).
Exported functions therefore always have the call format PASCAL (corresponds to the WINAPI
definition). Structure elements in structures have BYTE alignment (close-packed).
Input and Output names are always seen from a CPU view. The return codes are identical for
all functions (see Return codes (Page 124)).
The simbakern.dll exports more functions than are described in this documentation. In order
not to endanger the project consistency, only the functions described in this chapter can be
used.

8.2.1 Set Simbakern.dll path


The path of the SIMULATIONUnit installation must be known to the simbakern.dll.
int SIMBA2_SetSimbaproPath(char *path)
If this function is not called, the simbakern.dll always refers to the current work directory.

8.2.2 Downloading the project


int SIMBA2_OpenProjectFile(char *FileName)
The complete path of a SIMULATIONUnit project (folder with the ending .spf) must be entered
as the file name. SIMULATIONUnit opens projects in the background. A project is only opened
when the project state = 3. This can be queried using SIMBA2_CheckProjectState.

SIMULATIONUnit V9.1
System Manual, 06/2018 109
The programming interface of SIMULATIONUnit
8.3 Online

8.2.3 Query project status


int SIMBA2_CheckProjectState(int *state)
state [out] may assume the following values:

Value Name Meaning


0 EMPTY No project configured
1 CLOSED Project is closed
2 OPEN Project is being opened
3 READY Project is open.
6 FAIL Project faulty

8.2.4 Close project


int SIMBA2_CloseProjectFile()
Closes the project. Is automatically executed when SIMBA2_OpenProjectFile( …) is called.

8.3 Online

8.3.1 Establish connection to simulation modules


int SIMBA2_ConnectAll(int hwindex)
int SIMBA2_ConnectAllEx(int hwindex, bool wait)
A connection to all configured simulation modules is established.
hwindex [in] is the index of a SIMIT UNIT channel. The function for all channels in the project
is executed with hwindex = -1.
SIMBA2_ConnectAll() and SIMBA2_ConnectAllEx(with wait = true) blocks until the connection
has been established or the connection attempt has been interrupted due to a timeout.

8.3.2 Query connection status


int SIMBA2_IsConnected(int hwindex, int *active)
The index of the hardware is transferred with hwindex [in].
active [out] may return the following values:
● active = 0: no connection
● active = 1: connected
● active = 2: Module disabled

SIMULATIONUnit V9.1
110 System Manual, 06/2018
The programming interface of SIMULATIONUnit
8.3 Online

8.3.3 Disconnect connection to simulation modules


int SIMBA2_DisconnectAll(int hwindex)
All configured simulation modules are disconnected.
hwindex is the index of a SIMIT UNIT channel. The function for all channels in the project is
executed with hwindex = -1.

8.3.4 Download hardware configuration to simulation modules


int SIMBA2_DownloadAll(int hwindex)
The hardware configuration from the current project is downloaded to the simulation module.
The download is started in the background. You can query the progress of the download
process with SIMBA2_GetDownloadStatus().
hwindex is the index of a SIMIT UNIT channel. The function for all channels in the project is
executed with hwindex = -1.
The download is started in the background. You can query the progress of the download
process with SIMBA2_GetDownloadStatus()

8.3.5 Query progress of download


int SIMBA2_GetDownloadStatus(int hwindex, int *percent)
hwindex [in]: ID of module or -1 for all
percent [out]: Download progress as percentage value 0-100

8.3.6 Read data from image


int SIMBA2_ReadIO(char *name, char *value)
int SIMBA2_ReadIO_Bin(char *name, long *value)
int SIMBA2_ReadIO_Double(char *name, double *value)
int SIMBA2_ReadIO_Unit(char *name, char *value)
The name consists of the index of the SIMIT UNIT module and the I/O name (e.g. S000IW512).
The index of the module always starts with S. The triple-digit number that follows represents
the index of the module which is also displayed in the hardware view of SIMULATIONUnit
before the respective module.
The following I/O names are valid: EDx, EWx, EBx, Ex.y, ADx, AWx, ABx, Ax.y analog to the
SIMATIC notation), and EFx, AFx for float values. The English identifiers for the above-
mentioned notations are also supported.

SIMULATIONUnit V9.1
System Manual, 06/2018 111
The programming interface of SIMULATIONUnit
8.3 Online

SIMBA2_ReadIO_Double converts the read value to the type double.

NOTICE
When using SIMBA2_ReadIO and SIMBA2_ReadIO_Unit, sufficient buffer space for the
resulting string value must be assigned by the application program.

8.3.7 Write data to image


int SIMBA2_WriteIO(char *name, char *value)
int SIMBA2_WriteIO_Bin(char *name, long value)
int SIMBA2_WriteIO_Double(char *name, double value)
int SIMBA2_WriteIO_Unit(char *name, char *value)
int SIMBA2_WriteIO_BinMask(char *name, long value, long mask)
For parameter description refer to SIMBA2_ReadIO.
The function SIMBA2_WriteIO_BinMask uses the additional parameter mask for bit selection
(bit n in mask=1 → bit n is processed).

8.3.8 Enable/disable simulation of a slave


int SIMBA2_Activate(int hwindex, int slave, int active)
For hwindex the hardware index must be transferred; slave represents the address of the slave
in question.
For active the following values are valid:
● 1 - active
● 2 - Slave is not being simulated

8.3.9 Enable/disable simulation of a module within a slave


SIMBA2_ActivateModule(int hwindex, int slave, int module, int active)
The hardware index must be entered for hwindex, slave represents the address of the slave
in question, module represents the address of the module in question.
For active the following values are valid:
● 1 - active (plug module)
● 2 - inactive (pull module)
SIMBA2_ActivateModule is not valid for PROFIBUS boxes.

SIMULATIONUnit V9.1
112 System Manual, 06/2018
The programming interface of SIMULATIONUnit
8.3 Online

8.3.10 Query hardware status


int SIMBA2_IsActive(char* indexstring, int *active)
indexstring [in] : Comma separated indexes of the hardware tree
Example of indexstring:
"1" addresses simulation module no.1. "0,4,3" addresses the 3rd module of the 4th slave in
SimbaProfibus 000.
active: State of the hardware object, 0 = not simulated, for others see combinations below.
The following bits can be set in active:
● 1 = activated
● 2 = faulty
The following bits can be set in slaves/devices in the first layer:
● 4 = data exchange with controller present
● 8 = redundant
● 16 = active redundant partner
● 128 = Listen mode

8.3.11 Starting firmware functions


int SIMBA2_StartCardFunction(void)
int SIMBA2_StartCardFunction2(int hwindex)
hwindex: Index of simulation module, or -1 for all
SIMULATIONUnit automatically detects the presence of H or F machines on SDB import and
generates the associated information files in the project. These are then also loaded to the
module during download. In order for this information to be processed, the respective function
must be explicitly activated after each download for SIMIT UNIT PB.
For SIMIT UNIT PN, the PNIO function blocks (e.g. PROFIsafe) must also be downloaded to
the box again and the function restarted.
int SIMBA2_CheckFunctionDownload(int hwindex, int *present, int
*active)
hwindex [in]: Hardware index or -1 for entire project
present [out]: Number of functions available in the project
active [out]: Number of functions downloaded
The call of SIMBA2_CheckFunctionDownload checks whether the simbakern.dll has
already downloaded all the functions (then present = active).

SIMULATIONUnit V9.1
System Manual, 06/2018 113
The programming interface of SIMULATIONUnit
8.3 Online

8.3.12 Reading and writing of complete slave images


int SIMBA2_ReadSlaveOutputImage(int hwindex, int slave, BYTE *buffer)
int SIMBA2_ReadSlaveInputImage(int hwindex, int slave, BYTE *buffer)
int SIMBA2_WriteSlaveInputImage(int hwindex, int slave, BYTE *buffer)
These functions read or write the corresponding data images of DP slaves or PNIO devices
directly from the hardware. Buffer management of the respective SIMIT UNIT is taken into
consideration (also for fail-safe functions). These functions are only relevant for PROFIBUS
and PNIO boxes and return an error code when other hardware definitions are called.

8.3.13 Data records


With PROFIBUS and PNIO, the following functions can be used to access cyclic data:

Insert data record in SIMULATIONUnit project


int SIMBA2_DefRecordDataExt(int hwindex, int dev, int slot, int sub,
int index, int length, int offset)

Delete data record from the project


int SIMBA2_DeleteRecordDataExt(int hwindex, int dev, int slot, int
sub, int index)

Write default data to the project


int SIMBA2_WriteDefaultRecordDataExt(int hwindex, int dev, int slot,
int sub, int dsnum, char* data)
The parameter data is a text string with hex values separated by commas "0x01,0x22,0xab,
0xcd").

Reading/writing data records


int SIMBA2_WriteRecordDataExt(int hwindex, int dev, int slot, int
sub, int index, char* data, int maxlen)
int SIMBA2_ReadRecordDataExt(int hwindex, int dev, int slot, int
sub, int index, char* data, int *maxlen)
hwindex [in]: hardware index
dev [in]: device number
slot [in]: slot no. of module
sub [in]: subslot no. (is ignored with PROFIBUS, for PNIO modules without subslot, set sub=1)
index [in]: Data record number
data: [in for Write, out for Read] data record Bytes, Byte Array
maxlen [inout]: Number of bytes in data

SIMULATIONUnit V9.1
114 System Manual, 06/2018
The programming interface of SIMULATIONUnit
8.3 Online

Read/delete data record event queue


int SIMBA2_ReadDataBlockQueueExt(int hwindex, int* slave, int* slot,
int *subslot, int* dsnum, BYTE* buffer, int* len)
int SIMBA2_ResetDataBlockQueue(int hwindex)
When the box receives a new data record from PNIO / PROFIBUS controller, this will be added
to a queue. The queue can be read to obtain information about which data records were
received.
Returnvalue: 0 = OK, -1 = data record queue is empty
hwindex [in]: hardware index, with SIMBA2_ResetDataBlockQueue hwindex can also be -1
(for "all").
dev [in]: device number
slot [in]: slot no. of module
subslot [in]: subslot no. (is ignored with PROFIBUS, for PNIO modules without subslot, set
sub=1)
dsnum [in]: Data record number
data [out]: Data record bytes, bytes array
maxlen [inout]: Number of bytes in data

8.3.14 Reading or writing a project ID


The PNIO and PROFIBUS boxes support the loading and comparison of a generated project
ID with which the download status of a box can be determined. With PROFIBUS boxes, this
is carried out line by line. If the box is connected, this function returns the unique ID of the
open project/line, the ID of a project downloaded to the box and the name of a possibly
permanently saved project/line.
int SIMBA2_GetProjectIDs(int hwindex, DWORD *phardwareProjectID,
DWORD *pspfProjectID, char *AutoStartProjectName)

8.3.15 Autostart project


It is possible to permanently save the loading sequence of a simulation and to process it again
when the box is started. This enables pre-configured simulators to be set up.
int SIMBA2_SaveProjectFlash(int hwindex)
int SIMBA2_DeleteProjectFlash(int hwindex)
hwindex is the index of a SIMIT UNIT channel.

NOTICE
hwindex == -1 (alll channels) is not possible here.

The functions are used to save and delete the Autostart project. To permanently save a project,
SIMBA2_SaveProjectFlash must first be called with the appropriate hardware index and

SIMULATIONUnit V9.1
System Manual, 06/2018 115
The programming interface of SIMULATIONUnit
8.3 Online

subsequently SIMBA2_DownloadAll with the same hardware index. This results in the
configuration being saved when loading in the flash of the module. The download process can
be monitored with SIMBA2_GetDownloadStatus.

8.3.16 Exporting/importing the I/O image


int SIMBA2_SaveProcessIOFile(char *PathName)
This function saves all I/O data of the opened project to a .csv file.
int SIMBA2_LoadProcessIOFile(char *PathName)
reads I/O values from a .csv file

8.3.17 Reading the configuration


int SIMBA2_ReadStringConfiguration(char *configurationstring, int
maxlen, int first)
This function returns the I/Os of the SIMULATIONUnit configuration offline. There is no check
whether the configuration was loaded to the hardware.
configurationstring [out]: string that represents an I/O or data record channel with associated
project hierarchy.
Example of format: "HARDWARE0\PNIODEV1\PNIOSLOT2\E20.0"
maxlen [in]: Size of the configuration string buffer in bytes.
first [in]: On the first call the parameter must be set to 1 by the user program, then to 0 on every
call.
The user program must provide suitable buffers which are then filled by the function. The user
program calls the function until a negative return code appears.
int SIMBA2_Get_Channels(char *IOName, int *direction, int *datatype,
char *SymbolName, char *Comment, int first)
direction [out]: 0 = readable signal, 1 = writable signal
datatype [out]: 0 = binary, 1 = integer 8-32 Bit, 2 = float
IOName [out]: The signal name (e.g. S000EW512)
SymbolName [out]: optional symbolic name of the signal
Comment [out]: Signal comment
first [in]: first must be set to 1 on the first read call at one level, then to 0
first = 0 is read until a negative return code is issued.

SIMULATIONUnit V9.1
116 System Manual, 06/2018
The programming interface of SIMULATIONUnit
8.3 Online

8.3.18 Alarms and other device operations


Modules or channel alarms can be triggered for some PROFIBUS and PNIO devices. The
alarms are defined in .xml files in the folder "SIMULATIONUnit_V9.1\alm". The following API
functions are designed to support any future device operations.
int SIMBA2_ReadMenuName(char* indexstring, char *name, int menuindex)
reads a possible alarm for a specific object in the hardware tree (module or channel)
indexstring [in]: path index of the object over all hierarchical levels, divided by comma. (e.g. if
slave 3 in SIMIT UNIT line 0 has the index string "0,3", the module in slot 5, slave 31,
SIMIT UNIT line 1 has the index string "1,31,5").
name Description of the alarm
menuindex: ID number of an alarm
Returnvalue: 0 = OK, -1: no alarm configured
To read all existing alarms for an object of the hardware tree, the function has to be called
several times, with menu index being incremented after each call beginning with 0 until the
return value is not 0.
int SIMBA2_SetMenuCommand(char *indexstring, int menuindex)
triggers an alarm. For parameter description refer to SIMBA2_ReadMenuName(). The channel
diagnostic alarms for PNIO devices are toggle alarms. The first call of
SIMBA2_SetMenuCommand activates the alarm, the second deactivates it again. If the alarm
is activated, the character * is the first character in the parameter name in
SIMBA2_ReadMenuName() .

8.3.19 Using Windows events for effective programming


For effective programming of applications, Windows events generated by the application for
specific events can be registered and used in SIMULATIONUnit.

NOTICE
The application is responsible for the validity of an event to be registered.
If you are running your application as a second instance together with SIMULATIONUnit.exe,
you can only use SIMBA2_Register…NamedEvent for registration as cross-process events
must have names.

Detection of the end of transmission of the I/O data between the PC and box.
If the application performs the synchronization between the PC and the box itself, the end of
data transmission can be signaled by an event.
int SIMBA2_RegisterCyclicIOReadyEvent(int hwindex, HANDLE
eventhandle)
int SIMBA2_UnRegisterCyclicIOReadyEvent(int hwindex)
Parameter:

SIMULATIONUnit V9.1
System Manual, 06/2018 117
The programming interface of SIMULATIONUnit
8.4 Functions for using the DLL with your own GUI

hwindex: Hardware index


eventhandle: WINDOWS system event handle

Detection of end of download


If SIMBA2_DownloadAll is executed, the end of the download can be signaled by an event.
int SIMBA2_RegisterDownloadReadyEvent(HANDLE eventhandle)
int SIMBA2_UnRegisterDownloadReadyEvent()
Parameter:
eventhandle: WINDOWS system event handle

Detection of incoming records in the record queue


The application can register a Windows system event for the data record queue (per channel).
This is activated if data records received are entered in the queue.
int SIMBA2_RegisterDataBlockQueueEvent(int hwindex, HANDLE
eventhandle)
int SIMBA2_UnRegisterDataBlockQueueEvent(int hwindex)
Parameter:
hwindex: Hardware index
eventhandle: WINDOWS system event handle

8.4 Functions for using the DLL with your own GUI
The following functions can only be executed from the first instance which has loaded
"SIMBAkern.dll". This essentially involves functions for configuration, hardware import and the
display of the configured I/Os.

8.4.1 Creating an empty project


int SIMBA2_CreateProjectFile(char *PathName)
The function creates a new folder and generates the files required for the project. The folder
must have the extension "*.spf".

8.4.2 Saving a project under a different name


int SIMBA2_SaveAsProjectFile(char *OldPathName, char *NewPathName)
The project under OldPathName is copied to NewPathName.

SIMULATIONUnit V9.1
118 System Manual, 06/2018
The programming interface of SIMULATIONUnit
8.5 Read/change parameter in project

8.4.3 "Save" project


int SIMBA2_SaveProjectFile()
By definition, the "Project.xml" project file is always consistent. The save call only sets the
project state to "SAVED" to ensure that the project is recompiled the next time it is opened
(creation of the necessary binary files).

8.4.4 Importing hardware


int SIMBA2_SDBImport(char *simbaname, char *sdbpath, char *cfgpath,
int clear, int start_idx, ind end_idx, char* parameter, int
device_idx, int port_idx)
int SIMBA2_SDBImportWait(int hwindex, char *sdbpath, char *cfgpath,
int clear, int start_idx, int end_idx)
The import of the hardware configuration may overwrite an existing SIMIT UNIT hardware or
a new unassigned SIMIT UNIT hardware is created.
SIMBA2_SDBImportWait() waits after the import until the new project has been opened.
sdbpath - path of a n sdb30??.dat for PROFINET or sdb20??.dat file for PROFIBUS
cfgpath - optional, path of an HWConfig export file (*.cfg)
If the simbaname already exists in the project, the data record is overwritten if the parameter
clear = 1 is set. If clear = 0, the information from the system data block (sdbpath) is appended
to the existing data record.
hwindex: Hardware index
The parameters start_idx and end_idx are ignored on import of PROFIBUS slaves from an
sdb20xx file. For the SIMIT UNIT PN, you can define which devices are to be imported with
the parameters start_idx and end_idx. The device indexes from the STEP 7 project must be
specified or -1 for import of all devices.
The IP address via which the SIMULATIONUnit communicates with the SIMIT UNIT PN
module can be specified with parameters. (Assignment can also be carried out later with
SIMBA2_SetHWParameter(...) The IP address must be transferred in ASCII format (e.g.
strcpy(parameter, "192.168.0.1");).
Important: With SIMIT UNIT PNs, the IP address must be configured in a different IP range
than the addresses of the devices to be simulated.
A system data block must be present; the configuration file is optional.

8.5 Read/change parameter in project


SIMBA2_SetHWParameter(char* IndexString, char* key, char* value)
IndexString [in]: Hardware index
key [in]: parameter name, see below
Value [in]: Value, see below

SIMULATIONUnit V9.1
System Manual, 06/2018 119
The programming interface of SIMULATIONUnit
8.5 Read/change parameter in project

Read out set values


SIMBA2_GetHWParameter(char* IndexString, char* key, char* value, int
index)
IndexString [in]: Hardware index
key [in]: parameter name, see below
value [out]: Value, see below
index [in]: 0 = first parameter. If index >= number of parameters, the return value is -1, otherwise
0 = ok. If there are no parameters, -1 is returned for index=0.
The following parameters can be set/read with the above-mentioned functions:

Key value
IPADDR The IP address (e.g."192.168.0.1")
CHANNELNO Channel number of an SU box
FIRSTDEVICE Device number of first device behind the PNIO controller
FIRSTPORT Port number of the first device behind the PNIO controller at SU port P1
SECONDDE‐ Device number of the second device behind a second PNIO controller (with two-
VICE channel SU)
SECONDPORT Port number of the first device behind a second PNIO controller (with two-channel
SU)

8.5.1 Import of TIA Portal projects


int SIMBA2_ImportXMLProject(char *XMLpath, char *simbaname, char*
parameter)
The program TIA2XMLConverter can convert .oms files from TIA Portal to .xml files. These
xml files can be imported.
XMLpath: Path of the XML file The file type is recognized from the content of the file.
simbaname: e.g. SimbaPNIO_0[0]
parameter: IP address of the SIMIT Unit in ASCII format

8.5.2 Importing symbols


int SIMBA2_SymbolImport(char *simbaname, char *symbolpath)
A symbol file exported from PCS7 (ASCII format) is imported to the project.

SIMULATIONUnit V9.1
120 System Manual, 06/2018
The programming interface of SIMULATIONUnit
8.5 Read/change parameter in project

8.5.3 Display of last used projects / SDBs / CFG / symbol lists


int SIMBA2_GetRecentProjectPath(int index, char *path)
int SIMBA2_GetRecentSDBPath(int index, char *path)
int SIMBA2_GetRecentCfgPath(int index, char *path)
int SIMBA2_GetRecentSymbolPath(int index, char *path)
Delivers up to 16 last used project names (also SDB / CFG / SYM, addressed by "index"), but
only if the project is found.

8.5.4 Language settings


int SIMBA2_GetLanguage()
int SIMBA2_SetLanguage(int language)
In SIMULATIONUnit there is a language setting used for generating message texts, but also
for managing the I/Os. Language codes are currently 0 for "German", 1 for "English".
After changing the language code, the project has to be closed and the SIMBAkern.dll has to
be unloaded and reloaded.

8.5.5 Message texts


int SIMBA2_GetErrorString(char *error, int *typeicon)
SIMBAkern.dll creates messages (especially in case of errors) which can be retrieved and
displayed using the API.
After retrieval of the message, it is deleted from the alarm log. The current alarm log exists
only in memory and is lost when the application is terminated.
The parameter "typeicon" contains a classification of the message (0 = error, 1 = warning, 2
= notice) on return.

8.5.6 Adjust PROFIBUS baud rate


int SIMBA2_SetBaudRate(int hwindex, int BaudIdx)
Setting the PROFIBUS baud rate. The following baud rates are supported:

BaudIdx Baud rate


0 9600 Bd
1 19200 Bd
2 93.75 kBd
3 187.5 kBd
4 500 kBd
5 750 kBd
6 1.5 MBd
7 3 MBd

SIMULATIONUnit V9.1
System Manual, 06/2018 121
The programming interface of SIMULATIONUnit
8.5 Read/change parameter in project

BaudIdx Baud rate


8 6 MBd
9 12 MBd

8.5.7 Adjust MAC address range

Read/write MAC addresses for assigning to PNIO devices


int SIMBA2_MACListRead(char* firstmac, int* number)
int SIMBA2_MACListWrite(char* firstmac, int number)
firstmac: first MAC address in the format String with colons (default ="08:00:06:9d:37:3f")
number: Max. number of MAC addresses

Read MAC addresses which are used in the open project


int SIMBA2_GetProjectMACs(char* firstmac, int* number)

Regenerate MAC addresses in project


int SIMBA2_GenerateMACs()
Addresses are assigned to the PNIO devices in the project which have been defined with
SIMBA2_MACListWrite().

8.5.8 Import of GSD(ML) files into the SIMULATIONUnit hardware library

Import of PROFIBUS GSD files


int SIMBA2_GSD_Import(char* gsdfilepath, char* SlvName, char*
SlvTyp, char* SlvRev)
reads a GSD file into memory.
gsdfilepath: Path of the GSD file
SlvName: Slave name
SlvType: Slave ID
SlvRev: Slave Revision
int SIMBA2_GSD_SaveXML2(char* gsdfilepath)
saves the data imported with SIMBA2_GSD_Import( …)
gsdfilepath: Path of the GSD file

SIMULATIONUnit V9.1
122 System Manual, 06/2018
The programming interface of SIMULATIONUnit
8.5 Read/change parameter in project

Import of PROFINET GSDML files


int SIMBA2_PNIOXML_Import(char* xmlfilepath, char* SlvName, char*
SlvTyp, char* SlvRev, char* existingFile)
reads a GSDML file into memory
xmlfilepath: Path of the GSDML file
SlvName: Slave name
SlvType: Slave ID
SlvRev: Slave Revision
existingFile: if the file has already been imported, the file name of the already imported GSDML
file is output
int SIMBA2_PNIOXML_SaveGSDML(char* xmlfilepath)
saves the data imported with SIMBA2_PNIOXML_Import
xmlfilepath: Path of the GSDML file

8.5.9 Synchronizing I/O data with the simulation hardware


int WINAPI SIMBA2_SetThreadCycle(int milliseconds)
In SIMULATIONUnit there is a thread which cyclically synchronizes the I/O image with the
simulation hardware.
The cycle time can be changed with SIMBA2_SetThreadCycle().
milliseconds: Valid values are 1, 2, 5, 10, 20, 50, 100, 200, 500, 1000, 5000, 10000 and -1
SIMBA2_SetThreadCycle(-1) switches off the cyclic synchronization. In this case, the user
application has to call SIMBA2_Synchronize to perform synchronization.
int WINAPI SIMBA2_Synchronize(int hwindex)
Writes the input data for the simulation hardware and requests the output data.
The output data is only available to the user after SIMBA2_Synchronize has been called again.
Parameter:
hwindex: Index of the simulation hardware or -1 for all
int SIMBA2_GetCommunicationDiagnostics(int hwindex, DWORD
*syncinterval, DWORD *synctime, int *telegramsleft)
Reading the performance info of the synchronization.
hwindex: Index of the simulation hardware
syncinterval: adjusted time synchronization interval (see SIMBA2_SetThreadCycle)
synctime: measured duration of a synchronization cycle
telegramsleft: Number of telegram blocks not yet updated

8.5.10 Determination of version


int WINAPI SIMBA2_GetVersion(char *version, int para)

SIMULATIONUnit V9.1
System Manual, 06/2018 123
The programming interface of SIMULATIONUnit
8.7 Return codes

The version of the SIMBAkern.dll is output with para = 0, the version of the hardware library
with para = 1. The SIMIT UNIT modules send their version ID after SIMBA2_ConnectAll is
called. After successful connection, the version ID can be read out with
SIMBA2_GetErrorString.

8.6 Load sequence (example)


Call the following functions in succession to open a simulation project, load it into the hardware
and start the simulation:
1. int SIMBA2_OpenProjectFile(char *FileName)
2. int SIMBA2_CheckProjectState(int *state) ... wait until state ==
3
3. int SIMBA2_ConnectAll(-1)
4. int SIMBA2_DownloadAll(-1)
5. int SIMBA2_GetDownloadStatus(-1, int* percent) ... return value
has to be 0, percent == 100
Only required for PROFIBUS projects:
6. int SIMBA2_StartCardFunction()
7. int SIMBA2_CheckFunctionDownload(-1, int *present, int
*active) ... wait until present == active

8.7 Return codes

Name Value Description


SIMBA_QUIT_POS 0 O.K.
SIMBA_QUIT_NEG -1 Negative acknowledgment, unspecified error
SIMBA_PARAMETER_INVA‐ -2 Wrong call parameter (syntax or value not available)
LID
SIMBA_NOT_SUPPORTED -3 The function is not supported by the current delivery status
SIMBA_WRONG_SIMBATYPE -4 Function is not supported by the SIMULATIONUnit
SIMBA_SYS_DRIV‐ -5 Hardware driver was already closed
ER_CLOSED
SIMBA_THREAD_NOT_STAR‐ -6 Task thread cannot be launched (WINDOWS problem)
TED
SIMBA_CHANNEL_LOCKED -7 No access as reserved by another process.
SIMBA_MULTI_ACCESS_ER‐ -8 Simultaneous access of different applications has caused a WINDOWS
ROR error
SIMBA_MAIN‐ -9 SIMULATIONUnit was not started
PROG_NOT_RUNNING
SIMBA_BUSY -10 SIMULATIONUnit is utilized to full capacity, job is taking too long
SIMBA_HARDWARE_NO_AC‐ -11 No access to hardware, hardware index is not present in project
CESS

SIMULATIONUnit V9.1
124 System Manual, 06/2018
The programming interface of SIMULATIONUnit
8.7 Return codes

Name Value Description


SIMBA_FUNCTION_TIMEOUT -12 Timeout
SIMBA_QUIT_NOT_CONNEC‐ -20 Module not connected
TED
SIMBA_WRONG_FIRMWARE -23 Wrong firmware version used in the module
SIMBA_QUIT_FULL_BUFF -29 Request buffer is full
SIMBA_REQUEST_TIME_OUT -30 SIMULATIONUnit does not respond
SIMBA_DRIVER_ERROR -40 SIMULATIONUnit driver not available or not working
SIMBA_MEM_ERROR -41 Driver cannot allocate memory for I/O image
SIMBA_PROJECT_FAIL -48 SIMULATIONUnit cannot open project or project not available
SIMBA_PROJECT_CLOSED -49 No open project
SIMBA_FILEIO_ERROR -50 File access error

SIMULATIONUnit V9.1
System Manual, 06/2018 125
The programming interface of SIMULATIONUnit
8.7 Return codes

SIMULATIONUnit V9.1
126 System Manual, 06/2018
OPC server 9
9.1 Purpose
The OPC server for SIMULATIONUnit enables an OPC client to access the process values of
an open project.
The server supports the OPC communication service "Data access" (OPC DA) in accordance
with specification V2.0.

9.2 Installation
During the installation of SIMULATIONUnit, the OPC server is registered on the PC. OPC
clients running on the same computer are now able to get access via the OPC interfaces.
OPC clients which are running on remote systems connected over a network may require
additional information in order to access the SIMULATIONUnit OPC server.
For this purpose the file SimbaOpcServerProgId.reg is provided. This file is located in the
SIMULATIONUnit directory in the directory OPC (usually under "C:\%32-bit programs%\
%SIMULATIONUnit Installation folder%\OPC\" ).
To register the server on the remote client, copy the file SimbaOpcServerProgId.reg to the
client computer. The data content is then entered in the client’s registry with a double-click.
This gives the client all the necessary information to connect to the OPC server.
Remote OPC communication usually requires for adjustments to be made to the DCOM
security settings. The DCOM settings can be edited with the Microsoft program dcomcnfg.exe.
Please refer to the documentation provided by Microsoft for more information.

9.3 OPC server start / stop


To start the OPC server it is necessary to start SIMULATIONUnit and to load a project file first.
Menu command "Simulation → Start OPC server".

SIMULATIONUnit V9.1
System Manual, 06/2018 127
OPC server
9.4 User interface

The OPC server starts with the same project and takes control of the IOs. It automatically
connects to the SIMIT UNITs and starts the exchange of data.

NOTICE
The OPC server cannot modify a hardware configuration or download it to boxes. This must
be done with SIMULATIONUnit before the OPC server is started.

The program terminates automatically when the last client logs off.

9.4 User interface


The OPC server provides a simple user interface to display the following statistical values:

Number of OPC items The number of process values defined in the SIMULATIONUnit project.
Number of active items Shows the number of process values that are currently being exchanged with
connected clients.

SIMULATIONUnit V9.1
128 System Manual, 06/2018
OPC server
9.5 Cycle time

Number of OPC clients The number of connected OPC clients.


Scan cycle[ms] Scan cycle in milliseconds. The server checks the process outputs for
changes within this cycle.

9.5 Cycle time


The cycle time for monitoring the I/O values for changes can be set in SIMULATIONUnit in the
menu "Settings → Options".
The OPC server then has to be restarted.
A cycle time less than 100 ms is rounded up to 100 ms by the OPC server.

SIMULATIONUnit V9.1
System Manual, 06/2018 129
OPC server
9.5 Cycle time

SIMULATIONUnit V9.1
130 System Manual, 06/2018
XML import of hardware data 10
10.1 Basics for XML import
SIMIT supports the import of the hardware configuration of controllers of third-party vendors
via an XML hardware import interface.
An XML file that conforms to the formats described below can be imported into SIMIT (SU
import / XML import). This creates an executable and loadable PROFIBUS or PROFINET
project.
The user can thus configure a simulation relatively easily using a suitable export of the
hardware data from his configuration tool or also using an XML editor.

10.2 XML format for the import of a PROFIBUS line


The following describes the structure of the XML file, which contains all the data required for
SIMIT to simulate a PROFIBUS line.

<?xml version="1.0" encoding="iso-8859-1"?> XML declaration line


<HARDWARE> Root tag, (always "HARDWARE")
<COMMENT/> Comment, optional
<NAME>SimbaPROFIBUS_0[0]</NAME> Name of the simulation box, name is freely assignable, the
number in the square brackets at the end indicates the channel
of the box and must be present.

<HWTYPE>DPBOX</HWTYPE> Type of simulation box, for PROFIBUS "DPBOX"

<BAUDRATE>6</BAUDRATE> PROFIBUS baud rate: 9 = 12 Mbd, 8 = 6 MBd, 7 = 3 Mbd, 6 =


1.5 Mbd etc.
<DPSUBSYSTEM>1</DPSUBSYSTEM> PROFIBUS system ID
<CHILDTYPE>SLAVE</CHILDTYPE> Internal key for the next hierarchy level.

<SLAVE> Tag for the PROFIBUS device


<NAME>My ET200</NAME> Name (optional)
<ORDERNUMBER>6ES7 326-1BK01-0AB0</ Order number (optional)
ORDERNUMBER>
<INDEX>3</INDEX> PROFIBUS address
<TYPE>801E</TYPE> Type identification according to GSD file
<CHILDTYPE>MODULE</CHILDTYPE> Key for the next hierarchy level
<REDUNDANCY>1</REDUNDANCY> Redundancy, only for redundant bus systems

<MODULE> Tag for device modules


<NAME>My DI16</NAME> Name, optional
<INDEX>4</INDEX> Slot

SIMULATIONUnit V9.1
System Manual, 06/2018 131
XML import of hardware data
10.3 XML format for the import of a PROFINET line

<TYPE>4301009FC2</TYPE> Module type according to GSD file


<CHILDTYPE>CHANNEL</CHILDTYPE> Next hierarchy level
<INLEN>2</INLEN> Input length of the module in bytes
<OUTLEN>0</OUTLEN> Output length of the module in bytes
<LOGIN>0</LOGIN> Logical input address, must be unique AS-wide. Data is ex‐
changed from the interface via this address.
</MODULE>
... Additional modules can follow.
<MODULE>
<COMMENT/>
<NAME>DI 24xFailsafe </NAME>
<ORDERNUMBER>6ES7
326-1BK01-0AB0</ORDERNUMBER>
<INDEX>8</INDEX>
<TYPE>C2838908C1</TYPE>
<CHILDTYPE>CHANNEL</CHILDTYPE>
<INLEN>10</INLEN>
<OUTLEN>4</OUTLEN>
<LOGIN>4</LOGIN>
<LOGOUT>4</LOGOUT> Logical output address, must be unique AS-wide. Data is ex‐
changed from the interface via this address.
</MODULE>
</SLAVE>
<SLAVE> Additional devices can follow
...
</SLAVE>
...
</HARDWARE>

10.3 XML format for the import of a PROFINET line


The XML file for importing a PROFINET line differs from that of a Profibus line due to the
different bus hardware and the other associated parameters required.

<HARDWARE>
<COMMENT/>
<NAME>SimbaPNIO_2[0]</NAME> Name of the simulation box, name is freely assignable,
the number in the square brackets at the end indicates
the channel of the box and must be present.
<HWTYPE>PNIO</HWTYPE> Type of simulation box. For PROFINET "PNIO"
<IOSUBSYSTEM>100</IOSUBSYSTEM> PROFINET system ID
<FIRSTDEVICE>6</FIRSTDEVICE> Topology information, the device that is directly behind
the controller and is thus simulated at the external inter‐
face of the simulation box.
<FIRSTPORT>1</FIRSTPORT> The corresponding port for this.

SIMULATIONUnit V9.1
132 System Manual, 06/2018
XML import of hardware data
10.3 XML format for the import of a PROFINET line

<SECONDDEVICE>6</SECONDDEVICE> Topology information for the second channel for redun‐


dant systems.
<SECONDPORT>2</SECONDPORT> Second port for redundant systems.
<CHILDTYPE>PNIODEV</CHILDTYPE> Child type of the next hierarchy level.
<PNIODEV> Tag for a PROFINET device.
<NAME>My PROFINET IO</NAME> Name of the device (optional).
<INDEX>6</INDEX> Device index
<TYPE>002A0302</TYPE> Device type according to GSDML
<IPADDR>192.168.0.4</IPADDR> Simulated IP address.
<SubnetMask>255.255.255.0</ SubnetMask Subnet mask plus
>
<PRJNAME>im153-4pn</PRJNAME> Device name in the project, required by the controller to
identify the device using a DCP telegram.
<CHILDTYPE>PNIOSLOT</CHILDTYPE> Type of the next hierarchy level.
<PNIOSLOT> Tag for a PNIO slot.
<NAME>! IM153-4 PN HF V4.0</NAME> Name (optional)
<ORDERNUMBER>6ES7 153-4BA00- 0XB0</ Order number (optional), the order number can be useful
ORDERNUMBER> if a distinction should be made between different modules
with the same type identification.
<INDEX>0</INDEX> Slot, 0 is always the head module with PROFINET. In
contrast to PROFIBUS devices, this must be specified
here.
<TYPE>00000423</TYPE> Slot type according to GSDML
<API>0</API> API no.
<HEAD>8</HEAD> Identification of the slot as header module, may only be
present once in the device.
<CHILDTYPE>SUBSLOT</CHILDTYPE> Type of the next hierarchy level
<SUBSLOT> Tag for a PNIO subslot
<NAME>DIM 9 HF V4.0</NAME> Name (optional)
<INDEX>1</INDEX> Progressive index within the slot
<TYPE>00000000</TYPE> Type according to GSDML
<INLEN>0</INLEN> IO data input length in bytes
<OUTLEN>0</OUTLEN> IO data output length in bytes
<IOPS_Length>1</IOPS_Length> IO provider module status length in bytes
<IOCS_Length>1</IOCS_Length> IO consumer module status length in bytes
<CHILDTYPE>CHANNEL</CHILDTYPE> Type of the next hierarchy level
</SUBSLOT>
<SUBSLOT>
<NAME>PN-IO</NAME> Subslot for the PNIO interface
<INDEX>32768</INDEX>
<TYPE>00008002</TYPE>
<INLEN>0</INLEN>
<OUTLEN>0</OUTLEN>
<IOPS_Length>1</IOPS_Length>
<IOCS_Length>1</IOCS_Length>
</SUBSLOT>

SIMULATIONUnit V9.1
System Manual, 06/2018 133
XML import of hardware data
10.3 XML format for the import of a PROFINET line

<SUBSLOT>
<NAME>Port 1</NAME> Subslot for a port of the PNIO interface
<INDEX>32769</INDEX>
<TYPE>0000C000</TYPE>
<INLEN>0</INLEN>
<OUTLEN>0</OUTLEN>
<IOPS_Length>1</IOPS_Length>
<IOCS_Length>1</IOCS_Length>
</SUBSLOT>
<SUBSLOT>
<NAME>Port 2</NAME>
<INDEX>32770</INDEX>
<TYPE>0000C000</TYPE>
<INLEN>0</INLEN>
<OUTLEN>0</OUTLEN>
<IOPS_Length>1</IOPS_Length>
<IOCS_Length>1</IOCS_Length>
</SUBSLOT>
</PNIOSLOT>
<PNIOSLOT> Slot example for an input module
<NAME>SM 321 DI16xDC24V</NAME>
<ORDERNUMBER>6ES7 321-1BH50-0AA0</
ORDERNUMBER>
<INDEX>1</INDEX>
<TYPE>00009FC2</TYPE>
<API>0</API>
<CHILDTYPE>SUBSLOT</CHILDTYPE>
<SUBSLOT>
<TYPE>00000000</TYPE>
<INDEX>1</INDEX>
<NAME>14</NAME>
<INLEN>2</INLEN>
<OUTLEN>0</OUTLEN>
<IOPS_Length>1</IOPS_Length>
<IOCS_Length>1</IOCS_Length>
<LOGIN>6</LOGIN> Logical input address, must be unique AS-wide. Data is
exchanged from the interface via this address.
<CHILDTYPE>CHANNEL</CHILDTYPE>
</SUBSLOT>
</PNIOSLOT>
... Additional allocated slots
<PNIOSLOT>
<NAME>FDO10xDC24V/2A</NAME>
<INDEX>4</INDEX>

SIMULATIONUnit V9.1
134 System Manual, 06/2018
XML import of hardware data
10.5 Syntactic validation of generated XML files

<TYPE>000008C1</TYPE>
<API>0</API>
<CHILDTYPE>SUBSLOT</CHILDTYPE>
<SUBSLOT>
<TYPE>00000000</TYPE>
<INDEX>1</INDEX>
<INLEN>6</INLEN>
OUTLEN>6</OUTLEN>
<IOPS_Length>1</IOPS_Length>
<IOCS_Length>1</IOCS_Length>
<LOGIN>18</LOGIN>
<LOGOUT>18</LOGOUT> Logical output address, must be unique AS-wide. Data is
exchanged from the interface via this address.
</SUBSLOT>
</PNIOSLOT>
</PNIODEV>
... Additional PNIO devices
<PNIODEV>
...
</PNIODEV>
</HARDWARE>

10.4 Simultaneous import of several lines


For the simultaneous import of several bus lines, you can arrange the individual "HARDWARE"
tags within a "PROJECT" tag. This can be useful, for example, to generate the two bus lines
of an H system simultaneously.

<?xml version="1.0" XML declaration line


encoding="iso-8859-1"?> Root tag, (now "PROJECT")
<PROJECT>
<HARDWARE> first "HARDWARE"
...
</HARDWARE>
<HARDWARE> second "HARDWARE"
...
</HARDWARE>
</PROJECT>

10.5 Syntactic validation of generated XML files


The XML files generated for import in SIMIT can be checked for syntactic errors or missing
keys before the import. A document type definition (DTD file) is available for this. However,
the content of the tags is not checked for meaningfulness.

SIMULATIONUnit V9.1
System Manual, 06/2018 135
XML import of hardware data
10.5 Syntactic validation of generated XML files

To check your XML file, copy the following text block from the second line into your XML file
and then load the entire file into a DTD Validator.

<!ELEMENT HARDWARE (COMMENT?, NAME?, HWTYPE, ((DPSUBSYSTEM, BAUDRATE,


CHILDTYPE, SLAVE*) | (IOSUBSYSTEM, FIRSTDEVICE, FIRSTPORT, SECONDDEVICE?,
SECONDPORT?, CHILDTYPE, PNIODEV*)) )>
<!ELEMENT COMMENT (#PCDATA)>
<!ELEMENT NAME (#PCDATA)>
<!ELEMENT HWTYPE (#PCDATA)>
<!ELEMENT CHILDTYPE (#PCDATA)>
<!ELEMENT BAUDRATE (#PCDATA)>
<!ELEMENT DPSUBSYSTEM (#PCDATA)>
<!ELEMENT IOSUBSYSTEM (#PCDATA)>
<!ELEMENT FIRSTDEVICE (#PCDATA)>
<!ELEMENT FIRSTPORT (#PCDATA)>
<!ELEMENT SECONDDEVICE (#PCDATA)>
<!ELEMENT SECONDPORT (#PCDATA)>
<!ELEMENT SLAVE (COMMENT?, NAME?, ORDERNUMBER?, INDEX, TYPE, CHILDTYPE,
REDUNDANCY?, MODULE*)>
<!ELEMENT INDEX (#PCDATA)>
<!ELEMENT TYPE (#PCDATA)>
<!ELEMENT ORDERNUMBER (#PCDATA)>
<!ELEMENT REDUNDANCY (#PCDATA)>
<!ELEMENT MODULE (COMMENT?, NAME?, ORDERNUMBER?, INDEX, TYPE, CHILDTYPE,
INLEN, OUTLEN, LOGIN?, LOGOUT?)>
<!ELEMENT INLEN (#PCDATA)>
<!ELEMENT OUTLEN (#PCDATA)>
<!ELEMENT LOGIN (#PCDATA)>
<!ELEMENT LOGOUT (#PCDATA)>
<!ELEMENT FAILSAFE (#PCDATA)>
<!ELEMENT PNIODEV (COMMENT?, NAME?, ORDERNUMBER?, INDEX, TYPE, IPADDR,
PRJNAME, CHILDTYPE, PNIOSLOT*) >
<!ELEMENT IPADDR (#PCDATA)>
<!ELEMENT PRJNAME (#PCDATA)>
<!ELEMENT PNIOSLOT (COMMENT?, NAME?, ORDERNUMBER?, INDEX, TYPE, API, HEAD?,
CHILDTYPE, SUBSLOT*) >
<!ELEMENT API (#PCDATA)>
<!ELEMENT HEAD (#PCDATA)>
<!ELEMENT SUBSLOT (NAME?, INDEX, TYPE, INLEN, OUTLEN, IOPS_Length,
IOCS_Length, LOGIN?, LOGOUT?, CHILDTYPE?) >
<!ELEMENT IOPS_Length (#PCDATA)>
<!ELEMENT IOCS_Length (#PCDATA)>

If you do not want to copy the text every time, copy the text block into a text file (for example,
"SIMXMLImport.dtd"), and install only a link to this text file for the validation in your XML files
in the second line.
<!DOCTYPE HARDWARE SYSTEM "SIMITXMLImport.dtd">
The first and last line of the text block must be omitted for use in an external DTD file.
XML validators on the Internet are, for example:
● https://www.xmlvalidation.com (https://www.xmlvalidation.com)
● https://www.w3schools.com/xml/xml_validator.asp (https://www.w3schools.com/xml/
xml_validator.asp)

SIMULATIONUnit V9.1
136 System Manual, 06/2018
XML import of hardware data
10.5 Syntactic validation of generated XML files

However, they only work if the DTD is directly integrated into the XML file.
The "XMLNotepad2007" from Microsoft is suitable for offline XML validation.

SIMULATIONUnit V9.1
System Manual, 06/2018 137
XML import of hardware data
10.5 Syntactic validation of generated XML files

SIMULATIONUnit V9.1
138 System Manual, 06/2018
FAQs (Frequently Asked Questions) 11
11.1 In the SIMULATIONUnit project, there are more PROFIBUS devices
behind a DP/PA link than in the STEP7 project. Why does the
simulation of the PA slaves that exist in both projects not work?
The PA devices are processed as an image in the IM157. We simulate this image with
SIMULATIONUnit and not the bus structure of the PA bus.
For this reason, the position of the subsequent devices changes in the image by adding or
removing a PA device. In addition, the length of the IO data of the IM157 changes so that the
bus master no longer exchanges any cyclic data. This is why a complete PA line can no longer
be simulated. The only remedy is to use an original IM157 with a PA-SIMBA directly on the
PA bus (or use a consistent configuration).

11.2 A module allocates 3 bytes (EB0 - EB2), the following module


allocates 2 bytes (EB3 - EB4). What happens when you write to ED0?
Writing a double word will write over the first 3 bytes of the first module and over the first byte
of the second. But because S7 works in big-endian format, only the most significant byte is
written in the word of the second module, and a multiple of 256 is shown when the word is
displayed.

11.3 Can I simulate the active bus line of two fault-tolerant systems with
two successive channels of a SIMBAProfibus-Box/SIMIT UNIT PB?
No. An H system uses two CPUs which exchange information over a cross connection about
the I/O device status or if necessary, assign parameters to the existing I/O devices.
For this reason, there must also be a corresponding relationship between the channels of a
redundant slave in the SIMBAProfibus box / SIMIT UNIT PB. This relationship is created by
activating a corresponding firmware block. In the case mentioned above, one of the two H-
system would always have a bus failure because the SIMBAProfibus box / SIMIT UNIT PB
always has one channel of the slave identified as active and the other one as passive.
In addition, the SIMBAkern.dll automatically recognizes an installed H system and therefore
always reads the CPU outputs from the active channel and writes CPU inputs only from channel
0 to both PROFIBUS channels.

11.4 How do I assign parameters to fail-safe modules in SIMULATIONUnit?


Fail-safe modules are automatically imported to SIMULATIONUnit.
For PROFIBUS fail-safe modules see Fail-safe (Page 53)

SIMULATIONUnit V9.1
System Manual, 06/2018 139
FAQs (Frequently Asked Questions)
11.8 My project is correct, but the simulation does not work. What can I do?

For PROFINET fail-safe modules see Simulation of fail-safe modules (PROFIsafe V2)
(Page 80)

11.5 SIMULATIONUnit does not recognize the device which I would like to
simulate. What can I do?
You can import the device description files (Page 122) in SIMULATIONUnit.
The new devices are available if you create a new project after this or perform a hardware
import.

11.6 How do I get rid of a topology error?


A PROFINET topology cannot be imported from STEP 7 or TIA. You have to manually set the
device number and port number of the first simulated device that is connected to the outside
world.

See also
Simulation of the topology (Page 78)

11.7 Can I simulate multiple PROFINET lines with one SIMIT UNIT PN and
one SIMULATIONUnit project?
You can group several lines from a STEP 7 / TIA project to form one SIMULATION UNIT project
if the following conditions are met:
● all device names, device numbers and IP addresses are unique and only present once in
the project
● no IRT topology is configured
No devices can be grouped to form a simulation project from different STEP 7 / TIA projects
because the I/O addresses must also be unique, which is usually not the case for different
projects.

11.8 My project is correct, but the simulation does not work. What can I do?
Contact Technical Support. (https://support.industry.siemens.com/My/ww/en/
requests#createRequest)
Provide as detailed a description of the problem as possible and which error messages are
displayed. If possible, provide your STEP 7 project or at least an export of the Step 7 HwConfig
(.cfg).

SIMULATIONUnit V9.1
140 System Manual, 06/2018

You might also like