Remote Debugging
When the WinCC runtime runs on a separate machine (e.g. a server or industrial PC), you need some extra setup to expose the debug port.
Overview
┌─────────────────┐ ┌──────────────────┐
│ Your machine │ │ WinCC machine │
│ │ │ │
│ VS Code │ │ WinCC Runtime │
│ ↕ │ │ ↕ │
│ Debug Proxy │───────→│ Port 9222 │
│ (9230/9231) │ │ (debug server) │
└─────────────────┘ └──────────────────┘Setup
Generate the setup scripts
On your development machine, generate the .bat scripts with the WinCC machine's IP address:
./wincc-unified-debug-proxy.exe generate -a 192.168.1.100This creates three files:
wincc-debug-setup-192-168-1-100.bat— First-time setup (port proxy + firewall rules)wincc-debug-restart-192-168-1-100.bat— Re-apply port proxy after a Windows restartwincc-debug-cleanup-192-168-1-100.bat— Remove all rules
Use the machine's specific IP address (e.g. 192.168.1.100), not 0.0.0.0. Using 0.0.0.0 also binds to localhost, which prevents WinCC from starting its debugger after a reboot due to a port conflict.
Run the setup script on the WinCC machine
Copy wincc-debug-setup-192-168-1-100.bat to the WinCC machine and run it as Administrator. This configures port forwarding and firewall rules.
Verify the connection
Test that the debug endpoint is reachable from your PC. See Verify the debug endpoint for the step-by-step verification.
Start the proxy with the remote target
On your machine, start the proxy with the WinCC machine's IP address:
./wincc-unified-debug-proxy.exe run -t 192.168.1.100Connect VS Code
Start the debugger in VS Code as usual. The proxy relays traffic to the remote machine.
After a Windows restart
After restarting the WinCC machine, port forwarding may stop working.
Run wincc-debug-restart-192-168-1-100.bat as Administrator on the WinCC machine. This deletes and re-adds the port proxy rule.
Removing port forwarding
When you no longer need the port forwarding, run wincc-debug-cleanup-192-168-1-100.bat as Administrator on the WinCC machine.