Execute WinCC OA CTRL scripts directly from Visual Studio Code
Features β’ Installation β’ Known Issues
Disclaimer: This is one of the first releases of the WinCC OA Script Actions extension. Some edge cases may not be fully covered yet. Please check the Known Issues section for workarounds if you encounter problems.
Tip: If the extension doesn't work as expected, tryCtrl+Shift+PβReload Windowto refresh.
- Right-click execution: Context menu on
.ctlfiles in Explorer or editor - Command Palette: Execute scripts via
Ctrl+Shift+P - With Arguments: Execute scripts with custom arguments
- Event Connection Control: Run with or without event manager connection
- Cross-platform support (Windows/Linux)
- Fast Execution: Scripts run with
-nflag by default (no event connection) - Event Connection Mode: Execute scripts that need event manager connectivity
- Configurable execution modes for different use cases
- Auto-Detection: Automatic project detection via WinCC OA Control extension
- Manual Configuration: Static paths for WinCC OA installation and project
- Integration with WinCC OA Control extension for seamless project management
| Setting | Default | Description |
|---|---|---|
winccoa.scriptActions.pathSource |
automatic |
Path detection: static (manual) or automatic (via Control extension) |
winccoa.scriptActions.installPath |
- | WinCC OA installation path (e.g., C:/Siemens/Automation/WinCC_OA/3.20) |
winccoa.scriptActions.projectName |
- | Your WinCC OA project name |
| Setting | Default | Description |
|---|---|---|
winccoa.scriptActions.logLevel |
INFO |
Log verbosity: ERROR, WARN, INFO, DEBUG, TRACE |
π‘ Tip: Set log level to DEBUG when reporting bugs for detailed diagnostics.
-
Automatic Path Detection:
- Requires WinCC OA Control extension installed
- Falls back to manual configuration if Control extension not available
-
Output Capture:
- Script output not captured in VS Code terminal
- Scripts run in background WinCC OA process
- Use
DebugN()for debugging output (visible in WinCC OA logs)
-
Parameter Passing:
- Arguments passed as plain strings
- Complex data structures not supported
Found an issue? Please report it with:
- WinCC OA version
- Extension version (
1.0.0) - Script example that reproduces the issue
- Enable
DEBUGlogging and attach log output
Access via Ctrl+Shift+P:
| Command | Description |
|---|---|
WinCC OA: Execute Script |
Run current .ctl file without event connection (fast) |
WinCC OA: Execute Script with Arguments |
Run script with custom arguments |
WinCC OA: Execute Script with Event Connection |
Run script WITH event manager connection |
WinCC OA: Execute Script with Arguments and Event Connection |
Run script with arguments AND events |
Right-Click Menu:
- Right-click on
.ctlfile β "Start Script" (fast mode, no events)
- VS Code: 1.107.1 or higher
- WinCC OA: 3.19+ with
WCCOActrlexecutable - WinCC OA Control: Extension (optional, for auto-detection)
- Valid WinCC OA project
# Windows (no event connection, fast)
C:/Siemens/Automation/WinCC_OA/3.20/bin/WCCOActrl.exe script.ctl -proj ProjectName -n
# Linux (with event connection)
/opt/WinCC_OA/3.20/bin/WCCOActrl script.ctl -proj ProjectName
# With arguments
WCCOActrl script.ctl -proj ProjectName -n testCaseId// File: scripts/utils/Example.ctl
main(string arg1, int arg2) {
DebugN("Argument 1: " + arg1);
DebugN("Argument 2: " + arg2);
}Windows Performance:
The extension may run slower on Windows with longer loading times. Linux performs significantly better.
Large Projects:
Very large projects may experience slower script execution startup times.
Extension Not Responding:
If the extension doesn't work as expected (script execution fails, project detection issues), reload VS Code:
- Press
Ctrl+Shift+P - Type and select
Reload Window - This refreshes the extension
This project is licensed under the MIT License.
WinCC OA and Siemens are trademarks of Siemens AG. This project is not affiliated with, endorsed by, or sponsored by Siemens AG. This is a community-driven open source project.
Made with β€οΈ for the WinCC OA community
GitHub β’ Issues β’ WinCC OA Docs
