Quick Start
This tutorial walks you through setting up the debug proxy and connecting VS Code to WinCC Unified.
Before starting, make sure the WinCC debugger is enabled and a browser with the runtime is open. See WinCC Setup for the full setup.
Step by step
Create a project folder
Create an empty folder and place wincc-unified-debug-proxy.exe inside it.
Open in VS Code
Open the folder in VS Code and launch a terminal (Ctrl+`).
Generate VS Code launch.json
The proxy can automatically create a launch.json with the correct configuration:
./wincc-unified-debug-proxy.exe initThis creates .vscode/launch.json with three debug configurations:
- WinCC:Dynamics - for Dynamics scripts (port 9230)
- WinCC:Events - for Events scripts (port 9231)
- WinCC:All - both at the same time
If a launch.json already exists, the tool prints the configuration so you can merge it manually.
Start the proxy
Start the proxy with default settings (WinCC on localhost):
./wincc-unified-debug-proxy.exe runFor a remote WinCC machine, specify the IP address:
./wincc-unified-debug-proxy.exe run -t 192.168.1.100See Remote Debugging for the full remote setup.
You'll see output like:
[START] Starting WinCC Debug Proxy...
[OK] Dynamics proxy ready on port 9230
[OK] Events proxy ready on port 9231
[READY] WinCC Debug Proxy is running!Start the VS Code debugger
- Open VS Code in your project
- Go to Run and Debug (Ctrl+Shift+D)
- Select WinCC:Dynamics, WinCC:Events, or WinCC:All
- Click Start Debugging (F5)
VS Code connects to the proxy, which relays traffic to WinCC.
Debug your scripts
- Navigate to the screen in WinCC Unified
- Open a loaded script and set breakpoints
- VS Code automatically stops at your breakpoints
- When screens reload, VS Code reconnects automatically
The Loaded Scripts section in the sidebar doesn't always show all scripts. Use the command palette (Ctrl+Shift+P) and run Debug: Open Loaded Script... to find and open any loaded script.
Make sure the WinCC runtime is running with debugging enabled and a screen is open in the browser before starting the proxy. You can verify this by opening http://localhost:9222/json - it should return a non-empty JSON array. Keep only one screen open to avoid multiple debug sessions.
What's next?
- CLI Options - all available parameters
- VS Code Setup - launch.json in detail
- Remote Debugging - debug on a different machine