NetToPLCsim Manual en PDF
NetToPLCsim Manual en PDF
NetToPLCsim Manual en PDF
Thomas Wiens
February 2, 2016
i
LIST OF TABLES CONTENTS
Contents
1 Introduction 1
1.1 What you can do with NetToPLCsim . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 What you cannot do with NetToPLCsim . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.3 How does NetToPLCsim work? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.4 S7online-interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
2 Manual 2
2.1 Quickstart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
2.1.1 Plcsim with S7-300/S7-400 (Step 7 V5.5, TIA-Portal) . . . . . . . . . . . . . . . . . . 2
2.1.2 Plcsim with S7-1200/S7-1500 (TIA-Portal) . . . . . . . . . . . . . . . . . . . . . . . . 2
2.2 General operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
2.2.1 Neccessary requirement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
2.2.2 Main window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.2.3 Station dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.2.4 Protocolmonitor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.2.5 Command-line arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.3 Further informations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.3.1 Multiple Plcsim-Instances . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.3.2 Simatic S7DOS service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3 Version history 8
3.1 Version 0.9.0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3.2 Version 0.9.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3.3 Version 0.9.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3.4 Version 0.9.3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3.5 Version 0.9.4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3.6 Version 0.9.5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3.7 Version 1.0.0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3.8 Version 1.1.0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
4 License 9
List of Figures
1 NetToPLCsim Main window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2 NetToPLCsim Station dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
3 NetToPLCsim Protocolmonitor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
4 Simulation of three Plcsim instances . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
5 Adding an IP address to a network interface (Windows 7) . . . . . . . . . . . . . . . . . . . 6
6 Example configuration in NetToPLCsim for three Plcsim instances . . . . . . . . . . . . . 7
List of Tables
1 Command-line arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
ii
1 INTRODUCTION
1 Introduction
1.1 What you can do with NetToPLCsim
NetToPLCsim allows you to use network communication together with the PLC-Simulation S7-Plcsim,
using the network interface of the PC on which the simulation is running. For example, you can test
your client application (SCADA system, etc.) together with S7-Plcsim, without a real PLC.
NetToPLCsim supports most of the functions which are supported by S7-Plcsim, like:
• Tag services: reading and writing data areas
• Block services: Program upload, program block online view, . . .
• The Plcsim/NetToPLCsim CPU will not be visible if you are using "Display Accessible Nodes" in
Step 7. This method uses the LLDP protocol on MAC layer. On a PC with installed Simatic soft-
ware, your PC will always be listed as "PC-Station". Furthermore the communication behaviour
of S7-Plcsim/NetToPLCsim is slightly different to a real CPU.
I MPORTANT
A test with NetToPLCsim does not substitute the test on the real hardware.
1
2 MANUAL 1.4 S7online-interface
1.4 S7online-interface
The S7online-interface represents the OSI layers 1 to 4 for all applications inside the Simatic universe.
If a Simatic application communicates to a PLC, the data goes always through the S7online-interface.
The functions of the S7online-interface are accessible through the program library s7onlinx.dll inside
the windows system directory.
The S7online-interface passes the data from the application to the underlying transport layer, like
TCP/IP, MPI or Profibus. The transport layer which S7online is using, is configured in the dialog
"Set PG/PC interface" from the Simatic application or the Windows control panel. Also the commu-
nication to Plcsim runs through this interface. The data running through this interface are already S7-
communication. Thus the job of NetToPLCsim is to represent the IP/IsoOnTcp transport layer, and pass
the payload into the S7online-interface and back. The main problem with the S7online-interface is that
it’s not official documented, which was the main problem using this interface with NetToPLCsim.
2 Manual
2.1 Quickstart
2.1.1 Plcsim with S7-300/S7-400 (Step 7 V5.5, TIA-Portal)
Use the following steps to setup a network accessible Plcsim simulation using NetToPLCsim. The de-
scription is valid for Plcsim with Step 7 V5.5.
1. Start the Simatic manager
2. Open your S7 project you want to test
3. Start Plcsim, upload the program including system data into Plcsim. You need a CPU with a
ethernet network device (PN-CPU or CPU plus Ethernet CP)
4. Start NetToPLCsim with administrative rights (these are neccessary to stop a Siemens service)
5. If NetToPLCsim asks to stop the Siemens service, click yes
6. In NetToPLCsim click on "Add"
7. In the station configuration dialog, click on ". . . " next to the text field "Network IP Address". You
get a list with all IP addresses of the existing network devices of your computer. Choose the
address on which Plcsim should be accessible
8. Next to the text field "Plcsim IP Address" click on ". . . ". You should see the Plcsim CPU you have
uploaded. Select the device and click "OK"
9. Set a rack/slot combination of 0/2 (for S7-400 dependant of your hardwareconfiguration
10. Close the dialog with "OK"
11. In the main window click on "Start server"
12. Your Plcsim simulation is now reachable at the IP address shown under "Network IP address"
2
2 MANUAL 2.2 General operation
3
2 MANUAL 2.2 General operation
1. Unique Name
2. IP address of the network interface at which this server should be reachable
3. IP address of the Plcsim-CPU
4. Rack/Slot position of the CPU. This setting is only relevant if you set the option TSAP-check.
If you enable this option, your client application needs to use the correct TSAP corresponding
to the rack/slot combination. NetToPLCsim accepts as connection ressource 1=PG, 2=OP and
3=Step7Basic.
2.2.4 Protocolmonitor
If you have started the NetToPLCsim server, you can start the protocolmonitor via context menu (right
mouse-click) of the station you want to monitor. If you select "Start monitoring", a new window with
the protocolmomitor opens.
At this time only S7 communication for S7-300/400 is shown, and only some parts of the S7 protocol
are dissected. Only incoming telegrams using variable services (reading and writingdata areas in the
S7) and SSL-(SZL)-Requests are decoded.
With mouseclick on the statusbar, you can pause and resume the capture output. The communication
is not stopped when you pause the output.
If you want to see all details of the S7 protocol, you can use the network protocol analyzer Wireshark.
Since Wireshark version 2.0 the S7 protocol is integrated. On older versions you need a plugin-dll for
the S7 communication, you can download from the link below.
http://sourceforge.net/projects/s7commwireshark
4
2 MANUAL 2.2 General operation
N OTE
Example:
NetToPLCSim.exe -f=testconfig.ini -s=NO -autostart
Further it’s possible to Drag&Drop a configuration file on the NetToPLCsim.exe file. Then NetTo-
PLCsim starts and loads this configuration.
5
2 MANUAL 2.3 Further informations
Each Plcsim instance needs it’s own IP address, under which it’s later reachable from your network.
One option is that you’ve got more than one network interface in your computer. The other option is to
add one or more IP addresses to the existing network interface.
In the following screenshot, it is shown how to add an additional IP address to your network inter-
face under Windows 7 (german).
6
2 MANUAL 2.3 Further informations
N OTE
To avoid later network problems, you should delete the additional IP-addresses when
finished with testing.
You can start a new Plcsim instance after you started the first instance, using the menu "File" →
"New Plc" in Plcsim. When the new Plcsim instance has started, upload the PLC program including
system data into Plcsim. Only with uploaded system data the simulation has the configured "virtual" IP
address.
The setup of the stations in NetToPLCsim is done in the same way as described for a single station.
For the simulation overview shown above the following setup in NetToPLCsim is needed:
7
3 VERSION HISTORY
NetToPLCsim remembers when you have stopped the Siemens service on program start. If you close
NetToPLCsim, you can optional restart the Siemens service (recommended).
N OTE
If you want to program a real S7-PLC after testing with NetToPLCsim, it’s recommended
to restart the computer!
3 Version history
3.1 Version 0.9.0
• First version using the S7online interface
• Added Command-line Arguments, and the possibility to Drag&Drop a configuration file on the
NetToPLCsim.exe
8
4 LICENSE 3.7 Version 1.0.0
• Monitor window: With mouseclick on statusbar the capturing can be paused and resumed
• New documentation using Windows-Help files
• Changed license from GPL to LPGL
4 License
NetToPLCsim is free software: you can redistribute it and/or modify it under the terms of the GNU
Lesser General Public License as published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
NetToPLCsim is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PUR-
POSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with NetToPLC-
sim. If not, see http://www.gnu.org/licenses/.