- 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.5 KiB
PowerShell
36 lines
1.5 KiB
PowerShell
. '$PSScriptRoot\tc-common.ps1'
|
|
$LogFile = Join-Path $script:DefaultLogDir 'rot-list.log'
|
|
New-Item -ItemType Directory -Force -Path (Split-Path $LogFile) | Out-Null
|
|
function Write-Log($m) { $line = "[{0}] {1}" -f (Get-Date -Format 'HH:mm:ss'), $m; Write-Host $line; Add-Content -Path $LogFile -Value $line -Encoding UTF8 }
|
|
|
|
Write-Log "=== Enumerating ROT ==="
|
|
Add-Type -TypeDefinition @'
|
|
using System;
|
|
using System.Runtime.InteropServices;
|
|
using System.Runtime.InteropServices.ComTypes;
|
|
using System.Text;
|
|
public class RotEnum {
|
|
[DllImport("ole32.dll")] static extern int GetRunningObjectTable(int reserved, out IRunningObjectTable pprot);
|
|
[DllImport("ole32.dll")] static extern int CreateBindCtx(int reserved, out IBindCtx ppbc);
|
|
public static string[] List() {
|
|
IRunningObjectTable rot; IBindCtx bc;
|
|
GetRunningObjectTable(0, out rot);
|
|
CreateBindCtx(0, out bc);
|
|
IEnumMoniker em; rot.EnumRunning(out em);
|
|
IMoniker[] mons = new IMoniker[1];
|
|
IntPtr fetched = IntPtr.Zero;
|
|
var sb = new StringBuilder();
|
|
int n = 0;
|
|
while (em.Next(1, mons, fetched) == 0) {
|
|
string name; mons[0].GetDisplayName(bc, null, out name);
|
|
sb.AppendLine(name); n++;
|
|
}
|
|
sb.Insert(0, n + " entries:\r\n");
|
|
return sb.ToString().Split(new[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries);
|
|
}
|
|
}
|
|
'@ -ReferencedAssemblies System.Runtime.InteropServices
|
|
|
|
foreach ($e in [RotEnum]::List()) { Write-Log $e }
|
|
Write-Log "=== ROT done ==="
|