@@ -94,5 +94,30 @@ $results += Test-SubscribeSeesChange `
|
||||
-DriverWriteArgs (@("write") + $commonAbCip + @("-t", $TagPath, "--type", "DInt", "-v", $subValue)) `
|
||||
-ExpectedValue "$subValue"
|
||||
|
||||
# PR abcip-3.2 — Symbolic-vs-Logical sanity assertion. Reads the same tag with both
|
||||
# addressing modes through the CLI's --addressing-mode flag. Logical-mode against ab_server
|
||||
# falls back to Symbolic on the wire (libplctag wrapper limitation; see AbCip-Performance.md
|
||||
# §Addressing mode), so the assertion is "both modes complete + return the same value" — not
|
||||
# a perf comparison. Skipped on Micro800 (driver downgrades Logical → Symbolic with warning,
|
||||
# making both reads identical-by-design + uninteresting to compare here).
|
||||
if ($Family -ne "Micro800") {
|
||||
$symValue = Get-Random -Minimum 40000 -Maximum 49999
|
||||
Write-Host "AB CIP e2e: priming gateway with $symValue then reading via Symbolic + Logical"
|
||||
$writeArgs = @("write") + $commonAbCip + @("-t", $TagPath, "--type", "DInt", "-v", $symValue)
|
||||
& $abcipCli.Exe @($abcipCli.Args + $writeArgs) | Out-Null
|
||||
|
||||
$symRead = & $abcipCli.Exe @($abcipCli.Args + @("read") + $commonAbCip + @("-t", $TagPath, "--type", "DInt", "--addressing-mode", "Symbolic"))
|
||||
$logRead = & $abcipCli.Exe @($abcipCli.Args + @("read") + $commonAbCip + @("-t", $TagPath, "--type", "DInt", "--addressing-mode", "Logical"))
|
||||
|
||||
$symMatched = ($symRead -join "`n") -match "$symValue"
|
||||
$logMatched = ($logRead -join "`n") -match "$symValue"
|
||||
$passed = $symMatched -and $logMatched
|
||||
$results += [PSCustomObject]@{
|
||||
Name = "AddressingModeSanity"
|
||||
Passed = $passed
|
||||
Detail = if ($passed) { "Symbolic + Logical both returned $symValue" } else { "Sym=$symMatched Log=$logMatched" }
|
||||
}
|
||||
}
|
||||
|
||||
Write-Summary -Title "AB CIP e2e" -Results $results
|
||||
if ($results | Where-Object { -not $_.Passed }) { exit 1 }
|
||||
|
||||
Reference in New Issue
Block a user