PlcsimGateway is a Windows gateway for connecting external S7 clients to a Siemens PLCSIM CPU over the network.
Typical path:
WinCC / HMI / SCADA / S7 client
-> Gateway PC IP:102
-> PlcsimGateway.Gui.exe
-> S7ONLINE / PLCSIM.TCPIP.1
-> Siemens PLCSIM CPU
The project was developed after working with NetToPLCsim in real lab setups. NetToPLCsim proved the idea, but the startup flow could be hard to repeat and debug. PlcsimGateway keeps the same practical goal and wraps it in a clearer one-window workflow: editable IPs, visible sessions, live counters, and fewer manual steps.
The tool is published openly for lab, HMI, SCADA, and integration testing. Test reports, fixes, ports to other environments, and feedback are welcome.
Development and testing were done with:
- TIA Portal V16 PLC project + WinCC HMI project;
- TIA Portal V16 PLC project + EasyBuilder HMI project.
Confirmed scenarios:
- PLCSIM on one PC, WinCC Runtime on another PC;
- PLCSIM and WinCC Runtime on the same PC, with optional additional WinCC Runtime clients on other PCs at the same time;
- PLCSIM and EasyBuilder Online Simulation on the same PC;
- PLCSIM and EasyBuilder Online Simulation on the same PC, with optional EasyBuilder simulation on another PC at the same time;
- PLCSIM on one PC and a physical Weintek HMI panel connected through the gateway, with optional simulator clients connected from other PCs.
Other TIA Portal versions, PLC families, HMI runtimes, and SCADA systems have not been tested here because we did not have suitable projects and tools for them. If they use the same S7 client path over ISO-on-TCP / TCP port 102, the gateway may work, but please treat that as unverified until tested.
Example addresses:
- PLCSIM CPU IP in the PLC project:
192.168.40.10 - Gateway PC network IP:
192.168.40.50 - Standard S7 port:
102
Steps:
- Start PLCSIM from your PLC project. For example, the simulated controller
uses
192.168.40.10. - In the HMI / WinCC / SCADA connection settings, set the PLC address to the
IP of the PC where PLCSIM and PlcsimGateway are running. In this example,
use
192.168.40.50, not192.168.40.10. - Start
PlcsimGateway.Gui.exeas Administrator. - In PlcsimGateway, set:
PLCSIM IP=192.168.40.10NETWORK IP=192.168.40.50
- Select
standard (port 102). - Click
Save IPs. - Click
Start. - In Siemens
Set PG/PC Interface, make sure:S7ONLINEpoints toPLCSIM.TCPIP.1;- all higher-level connection entries above
S7ONLINE, if shown in your setup, are set toNone.
- Start your HMI simulation, HMI panel, WinCC Runtime, SCADA runtime, or other S7 client.
- In PlcsimGateway, check that
ActiveSessionappears and that log counters begin to increase.
- Windows.
- Siemens PLCSIM installed and working.
- Siemens S7ONLINE /
S7onlinx.dllavailable on the same PC. S7ONLINE -> PLCSIM.TCPIP.1configured in Siemens PG/PC Interface.- .NET Framework 4.8.
- x86 build target.
- Administrator rights when binding TCP/102 or handling a Siemens service that already owns the port.
Siemens binaries, Siemens documentation, customer projects, HMI project files, and network captures are not included in this repository.
Build the GUI release:
& "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin\MSBuild.exe" `
".\src\PlcsimGateway.Gui\PlcsimGateway.Gui.csproj" `
/p:Configuration=Release /p:Platform=x86 /m /v:minimalThe main build artifact is:
src\PlcsimGateway.Gui\bin\x86\Release\PlcsimGateway.Gui.exe
Prebuilt Windows packages are available from the repository's Releases page.
The default profile is standard (port 102).
NETWORK IP is the IP address on the PC where external clients connect.
PLCSIM IP is the simulated CPU address from the PLC project.
Starter profiles are stored in:
config\gateway-profiles.json
If you distribute only PlcsimGateway.Gui.exe, the GUI can create a default
config\gateway-profiles.json next to the exe on first start.
- No active session appears: check that the HMI points to the gateway PC IP, not directly to the PLCSIM CPU IP.
- Session appears, but counters do not grow: check the HMI runtime is actually started and polling tags.
- Client counters grow, but PLCSIM counters do not: check PLCSIM is running,
the PLC project is loaded, and
S7ONLINE -> PLCSIM.TCPIP.1is selected. - TCP/102 is busy: run the GUI as Administrator and let it handle the port conflict, or stop the conflicting Siemens service manually.
- External device cannot connect: check Windows Firewall and the selected network adapter IP.
PlcsimGateway is a gateway to Siemens PLCSIM. It is not a standalone PLC emulator, a replacement for final tests on real hardware, or a full PROFINET discovery / Accessible Nodes implementation.
Use it for lab, simulation, HMI, SCADA, and development workflows where those limitations are acceptable.
PlcsimGateway is inspired by NetToPLCsim and includes source files derived from
NetToPLCsim, whose headers state LGPL-3.0-or-later. This public copy keeps
that provenance visible. See NOTICE.md and LICENSE.md.
Siemens, SIMATIC, TIA Portal, PLCSIM, WinCC, and related names are trademarks of their respective owners. This project is not affiliated with or endorsed by Siemens.
Made by toolowinmydev with help from Mr. Gptinski.