- ticker: --spin mode polls FPRD until payload changes (phase-locks processing to TwinCAT frame arrival instead of free-running ticker), timeout at 1.5 periods keeps loop alive on master stop - verified: 238k cycles, 0 errors, exec=245us (FPWR-bound), TwinCAT PLC task confirmed at 2000.8 Hz (all three tasks 0.5ms; base tick was already 50us - no base-time change needed) - docs: 500us latency plan; scripts: task-rate ADS probe, 2kHz deploy, UI automation experiments (pywinauto) for task cycle inspection
37 lines
1.5 KiB
PowerShell
37 lines
1.5 KiB
PowerShell
#Requires -RunAsAdministrator
|
|
$ErrorActionPreference = 'Continue'
|
|
$dte = New-Object -ComObject TcXaeShell.DTE.17.0
|
|
$dte.MainWindow.Visible = $true
|
|
try { $dte.SuppressUI = $false } catch {}
|
|
$dte.Solution.Open('C:\Users\tonycao\work\twincat3-auto-cli\TwinCAT_EL6695_Primary_2kHz\TwinCATProject1.sln')
|
|
Start-Sleep 30
|
|
try { $dte.ExecuteCommand('Build.BuildSolution') } catch {}
|
|
Start-Sleep 15
|
|
for ($i = 0; $i -lt 30; $i++) {
|
|
$bs = $null
|
|
try { $bs = $dte.Solution.SolutionBuild.BuildState } catch {}
|
|
if ($bs -eq 3) { break }
|
|
Start-Sleep 2
|
|
}
|
|
Write-Host "BuildState=$($dte.Solution.SolutionBuild.BuildState) LastBuildInfo=$($dte.Solution.SolutionBuild.LastBuildInfo)"
|
|
try {
|
|
$el = $dte.ToolWindows.ErrorList
|
|
$items = $el.ErrorItems
|
|
Write-Host "error items: $($items.Count)"
|
|
for ($i = 1; $i -le [Math]::Min($items.Count, 30); $i++) {
|
|
$it = $items.Item($i)
|
|
Write-Host " [$($it.ErrorLevel)] $($it.Description) ($($it.FileName):$($it.Line))"
|
|
}
|
|
} catch { Write-Host "errorlist err: $_" }
|
|
try {
|
|
$ow = $dte.ToolWindows.OutputWindow
|
|
foreach ($pane in $ow.OutputWindowPanes) {
|
|
$td = $pane.TextDocument
|
|
$ep = $td.StartPoint.CreateEditPoint()
|
|
$content = $ep.GetText($td.EndPoint)
|
|
$lines = ($content -split "`r?`n") | Where-Object { $_.Trim() -ne '' }
|
|
Write-Host "=== pane '$($pane.Name)': $($lines.Count) lines ==="
|
|
$lines | Select-Object -Last 30 | ForEach-Object { Write-Host " $_" }
|
|
}
|
|
} catch { Write-Host "ow err: $_" }
|