- The annoying IEPG/S7DOS service
- Simulation with a single Plcsim instance
- Simulation of multple Plcsim instances
- Command line arguments
- Special for using Nettoplcsim with Step 7 V5.5 SP4 under 64 Bit Windows
The old NetToPLCsim-Version used the S7ProSim-COM-Object to exchange data with Plcsim. The version described in this document uses the so called S7online interface. The old version had to dissect the S7-protocol and read/write data through the S7ProSim interface. The new version starts a IsoOnTCP server and forwards the payload into the S7online-interface.
The main differences between 'old' and 'new' version:
- Support of multiple clients (max. 100)
- No limits in supported data areas, it's possible to read and write timer (T) and counter (C), read digital-inputs (I) and write digital-outputs (O)
- Support of multiple Plcsim instances
- Improved data throughput
- Support of other PLC functions, like Run/Stop, timesystem, reading of SZL (maybe different to a 'real' PLC)
To use this new version, you have to configure a PLC with a network interface, like a PN-CPU or a classis CPU with additional Ethernet CP. NetToPLCsim acts as intermediary between Plcsim and your real network interface.
Extract the Zip-Archive anywhere to your harddisk, and start the NetToPLCSim.exe from bin directory. No installation required.
As you have Step7 installed on your PC, then there is a Windows service called „SIMATIC IEPG Helper“ running in the background. This service holds TCP port 102 in use. But this port is used for S7-communication, so this service must be stopped before starting NetToPLCsim. At program start, NetToPLCsim checks if port 102 is free. If it's not, then it asks to stop the „SIMATIC IEPG Helper“ service. When you ended with testing with NetToPLCsim, it's recommended to restart the service before doing other work with SIMATIC software.
Alternitavely you can stop the service with the following two little batch files:
net stop s7oiehsx
net start s7oiehsx
net stop s7oiehsx64
net start s7oiehsx64
You need administrative rights to make changes on the windows service control. On Windows XP your actual user account needs admin-rights, on Windows 7 you need to start NetToPlCsim with administrative rights
Example configuration: S7-300 PN-CPU with IP-address: 192.168.1.101 LAN interface IP-address: 192.168.1.10
- Start PLCSIM out of the SIMATIC-Manager
- Set PG/PC interface in PLCSIM to 'PLCSIM(TCP/IP)'
- Load your PLC program including system data into PLCSIM
- Start NetToPLCsim
- In NetToPlCsim add a new station
- Insert unique name in „Name“ field for this station
- In „Network IP Address“ field, insert the IP-address of your LAN interface, on which Plcsim should be reachable (e.g. 192.168.1.10). Clicking on (…) shows a new windows where all interface IP-addresses are listed.
- In „Plcsim IP Address“ field, insert the IP-address of your PLC (IP-address which is shown in Plcsim status bar). Clicking on (…) shows a new windows where all PLCSIM reachable PLCs are listed.
- Apply station configuration with OK
- A click on „Start all“ will start the servers
When state changes to 'RUNNING', a client like SCADA/visualisation-systems can reach the Plcsim PLC on IP-address 192.168.1.10 To stop the simulation, at the first step stop NetToPLCsim. At the second step stop PLCSIM.
Settings in station configuration dialog:
- Unique name for the station
- IP-Address of the LAN-Interface where this server should be reachable
- IP- Address of the Plcsim-CPU
- Rack/Slot position of the CPU. This setting is only relevant for the optional TSAP check (maybe in later versions of Nettoplcsim it's possible to connect to TIA-Portal Plcsim for 1200/1500 CPUs)
- If this option is checked, the TSAP-settings on client-side and the rack/slot settings above must be consistent (for experts: Nettoplcsim allows connection ressources 1=PG, 2=OP, or 3=Step7Basic)
To connect to multiple PLCSIM-simulations at the same time, NetToPLCsim needs a separate IP-address for each server to start on. It's possible to realize this with inserting more than one network interface card, or by simply adding additional IP-addresses to the existent interface.
To avoid later network problems, you should delete the additional IP-addresses when finished with testing (my experience)
A new PLCSIM instance can be started out of the first PLCSIM instance by menu File -> „New Plc“ (or something equivalent, I've got only the german version). The following steps are equal to simulation with on PLCSIM instance. For the constellation shown in fig.2, the configuration shown in this image is needed:
When the nettoplcsim servers are started, the „Start monitoring“ entry in the contextmenu of the station list is enabled. For each station a separate monitoring-windows can be started. In the monitoring-windows only the usually telegrams for data-exchange (Read/Write-Requests) between a PLC and a SCADA-system are shown. To debug more details of the protocol, you can use Wireshark with my s7comm plugin-dll.
The activated monitoring reduces the data exchange rate significant.
The following command-line arguments are possible:
|-f=configurationfile.ini||Loads this station configuration file|
|-s=Option||Autostop control of IEPG-Helper service.|
YES=Automatically stop the service, NO=Don't stop, ASK=ask
|-autostart||Is a valid configuration file given, the servers for activated station are automatically started|
NetToPLCSim.exe -f=testconfig.ini -s=NO -autostart
Further it is possible to Drag & Drop a configuration file on the NetToPLCsim.exe file. Then this NetToPLCsim starts with this configuration.
Since this version the Service which uses Port 102 seems to have got new functions, and is now called „SIMATIC S7DOS Help Service“.
If the service is only stopped, then programming functions can't be used any more. If you want to use Nettoplcsim under this circumstances, you have to use it in this order:
- Make sure you don't have used Step7 after Windows was started, otherwise reboot
- Start Nettoplcsim with administrative rights
- Let Nettoplcsim stop the service
- Choose "Get Port 102" from Tools menu, should be ended with success
- Start Simatic Manager
- Start Plcsim and upload your station and program
- Add station in Nettoplcsim, start the Nettoplcsim server
- Use your client application
If you want to do programming real PLCs after testing with Nettoplcsim, a reboot of Windows is highly recommended!