ethercat-linux/scripts/tc-errors.ps1
Tony Cao 309aaba342 EL6695 8-byte bidirectional exchange with per-byte verification
- 8B PDO config: ULINT-sized payload, no 0x1A01 diag PDO on SM3
  (device rejected SM3=8 with diag assigned: 'size not allowed, min/max 0xa')
- twin_layout_blob_sized(): single 64-bit mapping entry for 8B payloads
- Ticker: per-byte XOR 0x5A transform in 8B mode so TwinCAT can verify
  every byte individually (1KB path unchanged, const-guarded)
- TwinCAT automation scripts: deploy with RPC retry, LinkVariables-based
  whole-array relink (element links only carry 1 byte), ADS watch, diag
- Docs: 8B design, verification methodology, test report
2026-07-27 19:01:05 +08:00

28 lines
1.0 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\TwinCATProject1.sln')
Start-Sleep 25
$sm = $null
for ($i = 0; $i -lt 20; $i++) {
try { $sm = $dte.Solution.Projects.Item(1).Object; if ($sm) { break } } catch {}
Start-Sleep 3
}
if (-not $sm) { Write-Host 'no sysmgr'; exit 1 }
try { $sm.SetTargetNetId('169.254.176.217.1.1') } catch {}
Start-Sleep 2
Write-Host '--- GetLastErrorMessages ---'
try { Write-Host ($sm.GetLastErrorMessages() | Out-String) } catch { Write-Host "err: $_" }
Write-Host '--- error list ---'
try {
$el = $dte.ToolWindows.ErrorList
$items = $el.ErrorItems
Write-Host "count: $($items.Count)"
for ($i = 1; $i -le [Math]::Min($items.Count, 20); $i++) {
$it = $items.Item($i)
Write-Host " [$($it.ErrorLevel)] $($it.Description)"
}
} catch { Write-Host "errorlist: $_" }