- 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
36 lines
1.4 KiB
PowerShell
36 lines
1.4 KiB
PowerShell
#Requires -Version 5.1
|
|
#Requires -RunAsAdministrator
|
|
$ErrorActionPreference = 'Continue'
|
|
|
|
$LogFile = "C:\Users\tonycao\work\twincat3-auto-cli\TwinCAT_EL6695_Secondary\Logs\dte-commands-list.log"
|
|
$Utf8File = "C:\Users\tonycao\work\twincat3-auto-cli\TwinCAT_EL6695_Secondary\Logs\dte-commands-list-utf8.txt"
|
|
New-Item -ItemType Directory -Force -Path (Split-Path $LogFile) | Out-Null
|
|
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
|
|
}
|
|
|
|
Write-Log "=== List DTE commands ==="
|
|
$dte = New-Object -ComObject TcXaeShell.DTE.17.0
|
|
$dte.MainWindow.Visible = $true
|
|
$dte.Solution.Open('C:\Users\tonycao\work\twincat3-auto-cli\TwinCAT_EL6695_Secondary\TwinCAT_EL6695_Secondary.sln')
|
|
for ($i=1; $i -le 120; $i++) { Start-Sleep -Seconds 1; if ($dte.Solution.IsOpen) { break } }
|
|
Write-Log "Solution open: $($dte.Solution.IsOpen)"
|
|
|
|
$idx = 0
|
|
[System.IO.File]::WriteAllText($Utf8File, "TwinCAT DTE Commands:`r`n", [System.Text.Encoding]::UTF8)
|
|
foreach ($cmd in $dte.Commands) {
|
|
try {
|
|
$name = $cmd.Name
|
|
if ($name -like 'TwinCAT.*') {
|
|
$idx++
|
|
$line = "[$idx] $name avail=$($cmd.IsAvailable) enabled=$($cmd.Enabled)"
|
|
Write-Log $line
|
|
[System.IO.File]::AppendAllText($Utf8File, $line + "`r`n", [System.Text.Encoding]::UTF8)
|
|
}
|
|
} catch {}
|
|
}
|
|
try { $dte.Quit() } catch {}
|
|
Write-Log "=== done ==="
|