ethercat-linux/scripts/tc-list-commands.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

60 lines
1.4 KiB
PowerShell

#Requires -Version 5.1
[CmdletBinding()]
param(
[string]$Solution = $null
)
. "$PSScriptRoot\tc-common.ps1"
if (-not $Solution) { $Solution = $script:DefaultSolution }
New-Log $script:DefaultLogDir
$LogFile = Join-Path $script:DefaultLogDir "list-commands.log"
function Write-Log($Message) {
$line = "[{0}] {1}" -f (Get-Date -Format 'HH:mm:ss'), $Message
Write-Host $line
Add-Content -Path $LogFile -Value $line -Encoding UTF8
}
try {
$dte = New-Object -ComObject TcXaeShell.DTE.17.0 -ErrorAction Stop
} catch {
Write-Log "FATAL: Cannot create DTE: $_"
exit 1
}
$dte.MainWindow.Visible = $true
try {
$dte.Solution.Open($Solution)
for ($i = 1; $i -le 120; $i++) {
Start-Sleep -Seconds 1
if ($dte.Solution.IsOpen) { break }
}
Write-Log "Solution open: $($dte.Solution.IsOpen)"
$sysMgr = $null
for ($i = 1; $i -le 40; $i++) {
try {
$sysMgr = $dte.Solution.Projects.Item(1).Object
if ($sysMgr) { break }
} catch {}
Start-Sleep -Seconds 3
}
Write-Log "SysManager: $(if ($sysMgr) { 'OK' } else { 'null' })"
Write-Log "Listing DTE commands matching 'TwinCAT'..."
foreach ($cmd in $dte.Commands) {
try {
$name = $cmd.Name
if ($name -like '*TwinCAT*') {
Write-Log " Command: $name"
}
} catch {}
}
Write-Log "Done."
} finally {
try { $dte.Quit() } catch {}
}