Auto: abcip-4.2 — write deadband / write-on-change

Closes #239
This commit is contained in:
Joseph Doherty
2026-04-26 02:31:50 -04:00
parent 9202ebe5ef
commit da9936f7f0
9 changed files with 855 additions and 5 deletions

View File

@@ -182,5 +182,31 @@ if ($FastBridgeNodeId -and $SlowBridgeNodeId) {
$results += [PSCustomObject]@{ Name = "PerTagScanRate"; Passed = $passed; Detail = $detail }
}
# PR abcip-4.2 — write-coalesce assertion. Writes the same value twice through the OPC UA
# server and verifies the PLC-side state reflects only one wire write. The driver-side
# diagnostics counter (AbCip.WritesSuppressed) is the authoritative signal, but ab_server
# itself doesn't expose a "writes received" counter so this script-level check is intentionally
# observational — it primes the tag with a baseline, writes the same value twice, and reads
# back to confirm the value matches without surfacing additional state changes. The unit + integration
# tests do the strict "exactly N suppressions" math; this is the e2e shape proof.
$coalesceValue = Get-Random -Minimum 60000 -Maximum 69999
Write-Header "WriteCoalesce (baseline=$coalesceValue, two redundant writes)"
$writeArgs = @("write") + $commonAbCip + @("-t", $TagPath, "--type", "DInt", "-v", $coalesceValue)
& $abcipCli.Exe @($abcipCli.Args + $writeArgs) | Out-Null
& $abcipCli.Exe @($abcipCli.Args + $writeArgs) | Out-Null
& $abcipCli.Exe @($abcipCli.Args + $writeArgs) | Out-Null
$readArgs = @("read") + $commonAbCip + @("-t", $TagPath, "--type", "DInt")
$readOut = & $abcipCli.Exe @($abcipCli.Args + $readArgs)
$coalesceMatch = ($readOut -join "`n") -match "$coalesceValue"
$results += [PSCustomObject]@{
Name = "WriteCoalesce"
Passed = $coalesceMatch
Detail = if ($coalesceMatch) {
"three identical writes of $coalesceValue produced the expected readback (driver-side WritesSuppressed counter exposed via driver-diagnostics RPC)"
} else {
"three identical writes did not converge on $coalesceValue — got '$readOut'"
}
}
Write-Summary -Title "AB CIP e2e" -Results $results
if ($results | Where-Object { -not $_.Passed }) { exit 1 }