Windos /
BurntToast
Module for creating and displaying Toast Notifications on Microsoft Windows 10.
88/100 healthLoading repository data…
Lance0901 / repository
PowerShell module for AI-driven TwinCAT 3 automation — 34 cmdlets for IDE control, PLC build/deploy, ADS read/write, and automated testing with zero dialog popups
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
繁體中文 | English
A PowerShell module that lets any AI coding tool (Claude Code, Codex, Antigravity, etc.) fully automate TwinCAT 3 IDE and PLC runtime — from project creation to live testing — with zero dialog popups.
TwinCAT 3 has a powerful COM-based Automation Interface, but it's notoriously hard to script: modal dialogs block automation, COM type conflicts crash PowerShell, and the lifecycle has undocumented ordering requirements. This module solves all of that, providing 34 cmdlets that any AI tool can call to build, deploy, and test PLC programs autonomously.
| Category | What You Can Do |
|---|---|
| IDE Automation | Connect to VS2022 / TwinCAT XAE Shell, smart instance selection with -SolutionPath |
| Project Management | Create projects, add POUs / GVLs / DUTs / Libraries |
| PLC Code R/W | Read and write Structured Text in any POU programmatically |
| Build & Deploy | Build, activate config (ADS-based, no dialogs), login + download |
| Runtime Control | Start / Stop / Reset PLC, system state management |
| ADS Communication | Read / write any PLC variable at runtime, symbol enumeration |
| Automated Testing | Define test cases, run full Build-Deploy-Test cycles, get JSON reports |
| I/O Configuration | Scan EtherCAT devices, read I/O tree, link variables to channels |
Import-Module ./src/TwinCATAutomation/TwinCATAutomation.psm1 -Force
# 1. Connect to IDE (auto-opens solution if needed)
Connect-TcIde -SolutionPath "C:\Projects\MyProject.sln"
# 2. Build
Build-TcProject
# 3. Activate + Run (Config mode -> Run mode via ADS, zero dialogs)
Enable-TcConfig -Force
# 4. Login + Download program (Login(3) suppresses all dialogs)
Enter-TcPlcOnline
# 5. Connect ADS (AmsNetId auto-detected from IDE)
Connect-TcAds
# 6. Start PLC
Set-TcPlcState -State Run
# 7. Read/Write variables
Read-TcVariable -Path "MAIN.nCounter"
Write-TcVariable -Path "MAIN.bEnable" -Value $true
# Define test cases
$test1 = New-TcTestCase -Name "Initial state" -Assertions @(
@{ Path = "MAIN.bReady"; Operator = "IsTrue"; Expected = $null }
@{ Path = "MAIN.nCount"; Operator = "Equal"; Expected = [uint16]0 }
)
$test2 = New-TcTestCase -Name "Trigger and verify" `
-Setup @( @{ Path = "MAIN.bStart"; Value = $true } ) `
-WaitMs 2000 `
-Assertions @(
@{ Path = "MAIN.bDone"; Operator = "IsTrue"; Expected = $null }
) `
-Teardown @( @{ Path = "MAIN.bStart"; Value = $false } )
# Run full cycle: Build -> Activate -> Login -> Start -> Test -> Stop
Invoke-TcTestCycle -TestCases @($test1, $test2)
# Read current code
$code = Get-TcPouCode -PouName "MAIN" -PouPath "TIPC^MyPLC^MyPLC Project^POUs^MAIN"
# Modify and write back
$newDecl = $code.data.declaration -replace 'END_VAR', " nCycleCount : UDINT;`nEND_VAR"
$newImpl = "nCycleCount := nCycleCount + 1;`n" + $code.data.implementation
Write-TcPouCode -PouName "MAIN" -PouPath "TIPC^MyPLC^MyPLC Project^POUs^MAIN" `
-Declaration $newDecl -Implementation $newImpl
| Command | Description |
|---|---|
Connect-TcIde | Connect to TwinCAT IDE (optional -SolutionPath for one-step connect) |
Disconnect-TcIde | Disconnect from IDE |
Connect-TcAds | Connect ADS client (AmsNetId auto-detected from IDE) |
Disconnect-TcAds | Disconnect ADS client |
| Command | Description |
|---|---|
New-TcProject | Create new TwinCAT project |
Open-TcProject | Open existing solution/project |
Add-TcPou | Add POU (Program / FB / Function) |
Add-TcGvl | Add Global Variable List |
Add-TcDut | Add Data Unit Type (struct/enum/union) |
Add-TcLibrary | Add library reference |
| Command | Description |
|---|---|
Get-TcPouCode | Read declaration + implementation from a POU |
Write-TcPouCode | Write declaration + implementation to a POU |
Get-TcProjectTree | Get project tree structure |
| Command | Description |
|---|---|
Build-TcProject | Build with error/warning reporting (auto-retry on RPC busy) |
Enable-TcConfig | Activate configuration via ADS (no dialogs with -Force) |
Enter-TcPlcOnline | Login + download program (Login(3), no dialogs) |
Exit-TcPlcOnline | Logout from PLC |
Send-TcPlcProgram | Upload program to PLC |
| Command | Description |
|---|---|
Set-TcPlcState | Start / Stop / Reset PLC |
Get-TcPlcState | Read current PLC state |
Set-TcSystemState | Set TwinCAT system state (Config/Run) |
Get-TcSystemState | Read TwinCAT system state |
Set-TcTarget | Set target system (local/remote) |
Get-TcIdeInfo | Get IDE version and connection info |
| Command | Description |
|---|---|
Read-TcVariable | Read PLC variable by symbol path |
Write-TcVariable | Write PLC variable by symbol path |
Watch-TcVariable | Monitor variable with condition-based waiting |
Get-TcSymbols | Enumerate all PLC symbols (with wildcard filter) |
| Command | Description |
|---|---|
Invoke-TcIoScan | Scan for EtherCAT devices |
Get-TcIoTree | Read I/O device tree |
Set-TcVariableLink | Link PLC variable to I/O channel |
| Command | Description |
|---|---|
New-TcTestCase | Define a test case (setup / assertions / teardown) |
Invoke-TcTest | Execute a single test case |
Invoke-TcTestCycle | Full cycle: Build -> Deploy -> Test -> Report |
src/TwinCATAutomation/ # Core PowerShell module (tool-agnostic)
TwinCATAutomation.psm1 # Module loader
Public/ # 34 exported cmdlets
Private/ # Internal helpers (COM, ADS, assertions)
Invoke-TwinCATAutomation.ps1 # Unified CLI entry point (JSON in/out)
adapters/
claude-code/ # Claude Code SKILL.md adapter
codex/ # OpenAI Codex tools.json
antigravity/ # Antigravity plugin.yaml
All commands return structured JSON:
{ "success": true, "data": { "path": "MAIN.nCounter", "value": 42, "type": "UDINT" } }
{ "success": false, "error": { "message": "Build failed", "code": "BUILD_FAILED" } }
Connect-TcAds auto-detects from the active IDE target.Enable-TcConfig -Force uses ADS WriteControl, Enter-TcPlcOnline uses Login(3).VAR_INPUT every scan cycle (see Decision #17).One command to install the TwinCAT skill globally for Claude Code (works in any project after install):
pwsh ./TwinCATSetup-Claude.ps1
This checks prerequisites and installs the skill + PowerShell module to ~/.claude/skills/twincat-automation/.
To uninstall: pwsh ./TwinCATSetup-Claude.ps1 -Uninstall
One command to install the TwinCAT skill globally for Codex (works in any project after install):
pwsh ./TwinCATSetup-Codex.ps1
This checks prerequisites (Windows, TwinCAT, ADS DLL, IDE, module) and installs:
~/.agents/skills/twincat/TwinCATAutomation/ -- PowerShell module (all cmdlets)~/.agents/skills/twincat/SKILL.md -- Codex skill with full API reference~/.codex/AGENTS.md -- global project instructionsTo uninstall: pwsh ./TwinCATSetup-Codex.ps1 -Uninstall
One command to install the TwinCAT skill globally for Google Antigravity:
pwsh ./TwinCATSetup-Antigravity.ps1
This checks prerequisites and installs the skill + PowerShell module to ~/.gemini/antigravity/skills/twincat-automation/.
To uninstall: pwsh ./TwinCATSetup-Antigravity.ps1 -Uninstall
TwinCATAutomation PowerShell module alongside SKILL.md. Previously only the skill documentation was installed, so AI tools couldn't find the actual module when running from other projects.Connect-TcIde now enumerates ALL running VS2022/XAE Shell instances via the Running Object Table (ROT) instead of using GetActiveObject which only returns one per ProgID. When multiple IDEs are open, it correctly finds the one with the target solution instead of launching a new instance.Initialize-TcAdsHelper with 3 fallback strategies (explicit path → loaded assembly → common paths) to reliably compile the C# helper. Added lazy-loading guards in Get-TcSymbols, Read-TcVariable, Write-TcVariable. Connect-TcAds now warns if helper fails to compile.TwinCATSetup-Codex.ps1 installer -- checks prerequisites and installs skill + AGENTS.md to user-level (~/.agents/skills/, ~/.codex/) so Codex can use TwinCAT automation in any projectVAR_INPUT are overwritten by PLC each scan cycle. Must write MAIN-level standalone variables instead (Decision #17)Enter-TcPlcOnline: Use LookupTreeItem with constructed path instead of child enumeration (Project child hidden after TwinCAT restart)Build-TcProject: Add retry loop (5 attempts) for RPC_E_CALL_REJECTED when IDE is busyInvoke-TcTestCycle: Cache AmsNetId before Activate; don't reconnect IDE after restart (original COM reference survives XAR restart)Connect-TcIde -SolutionPath for one-step connect -- finds or launches IDE, opens solution, returns AmsNetIdWrite-TcVariable: C# helper (TcAdsHelper) bypasses PowerShell CLS compliance issue with TcAdsSymbol.Datatype vs DataTypeEnable-TcConfig -Force (ADS-based), Enter-TcPlcOnline with Login(3) -- full Build->Activate->Login->Run->Read cycle with zero popupsMIT
Selected from shared topics, language and repository description—not editorial ratings.
Windos /
Module for creating and displaying Toast Notifications on Microsoft Windows 10.
88/100 healthGerenios /
AADInternals PowerShell module for administering Azure AD and Office 365
84/100 healthdarkoperator /
PowerShell Module for automating tasks on remote systems using SSH
invictus-ir /
A PowerShell module for acquisition of data from Microsoft 365 and Azure for Incident Response and Cyber Security purposes.
87/100 healthEvotecIT /
Testimo is a PowerShell module for running health checks for Active Directory against a bunch of different tests
68/100 healthmicrosoft /
Microsoft PowerShell wrapper for GitHub API
66/100 health