xae_com builder¶
Port: BuildRunner
Module: tckit.adapters.builders.xae_com_builder.XaeComBuilder
Status: Phase 2 — bridge + adapter validated end-to-end on TwinCAT 4026 (TcXaeShell Express).
Builds TwinCAT projects via the Windows bridge → COM automation interface and returns structured errors with file, line, message, and severity.
Configuration¶
build takes the project path as an explicit argument; deploy and start_runtime operate on the solution open in the attached XAE. Required environment variables: BRIDGE_URL. Optional: PLC_PROJECT_NAME, TCKIT_BUILD_TIMEOUT (seconds, default 600), DEVENV_PATH (path to TcXaeShell.exe if not at the default install location), TC_BUILD_CONFIG (default Release), TC_BUILD_PLATFORM (default TwinCAT RT (x64)).
How it works¶
Two-tier build inside Invoke-TcBuild.ps1:
- Tier 1 — fast in-process compile check. Calls
ITcPlcIECProject2.CheckAllObjects()on the PLC project node. ReturnsTruewhen the PLC source compiles cleanly,Falsewhen there are errors. This is the happy-path signal — no extra processes spawned. -
Tier 2 — structured diagnostics. When tier 1 returns
False(orForceLogis set), the harness reads the IDE Error List, which holds the actual PLC errors, warnings and info messages with file, line, compilercodeandproject. On full TcXaeShell or Visual Studio it reads the Error List through EnvDTE (DTE.ToolWindows.ErrorList).TcXaeShell Express doesn't expose the Error List to EnvDTE automation, so the harness reads the rendered Error List grid directly with UI Automation instead. As long as the solution is open in TcXaeShell on your desktop, the build returns the same file / line /
code/projectdetail on Express. The one thing UI Automation can't read there is the per-row severity icon, so severity is inferred: a row carrying a compiler code is a compile error (a warning when the compile otherwise succeeds), and TwinCAT's own deploy / licence / test-log lines are reported as infos. If the XAE window can't be reached (for example a headless session), the build falls back to reporting pass/fail with a message to open the solution in TcXaeShell, or to pointDEVENV_PATHat a full TcXaeShell / Visual Studio (which the harness then drives with/rebuild … /out <build.txt>).
Error format¶
{
"success": false,
"errors": [
{
"file": "FB_MotorControl.TcPOU",
"line": 42,
"message": "'nSpeed' is not declared",
"severity": "error",
"code": "C0046",
"project": "MyPlc"
}
],
"warnings": [],
"infos": [],
"duration_seconds": 5.6,
"details": { "plc": "MyPlc", "check_all_objects": false }
}
deploy() and start_runtime() route through the same bridge to Invoke-TcDeploy.ps1 / Invoke-TcRuntime.ps1, which call ActivateConfiguration() and StartRestartTwinCAT() respectively after SetTargetNetId(<TargetAmsId>).