Auto: s7-d2 — UDT / STRUCT / nested-DB fan-out

Closes #300
This commit is contained in:
Joseph Doherty
2026-04-26 06:50:26 -04:00
parent 7e62a1158f
commit 5f8d84db43
13 changed files with 1139 additions and 16 deletions

View File

@@ -96,5 +96,28 @@ $results += Test-SubscribeSeesChange `
-DriverWriteArgs (@("write") + $commonS7 + @("-a", $Address, "-t", "Int16", "-v", $subValue)) `
-ExpectedValue "$subValue"
# PR-S7-D2 / #300 — UDT-member round-trip. Exercises the byte offsets the
# driver's UDT fan-out uses when expanding a UDT-typed parent tag into per-
# member scalar leaves: Real at DB1.DBD400 and Int16 at DB1.DBW404 match the
# `MyUdt` layout seeded by Docker/profiles/s7_1500.json's udt_layout meta-seed
# and declared by S7_1500UdtFanOutTests. The CLI itself is UDT-unaware so the
# e2e step writes / reads at the explicit member byte offsets — proves the
# wire-level path the fan-out emits is sound end-to-end.
$udtPressureAddress = $Address.Substring(0, $Address.IndexOf('.')) + ".DBD400"
$udtPressureValue = "27.5"
$results += Test-DriverLoopback `
-Cli $s7Cli `
-WriteArgs (@("write") + $commonS7 + @("-a", $udtPressureAddress, "-t", "Float32", "-v", $udtPressureValue)) `
-ReadArgs (@("read") + $commonS7 + @("-a", $udtPressureAddress, "-t", "Float32")) `
-ExpectedValue $udtPressureValue
$udtStatusAddress = $Address.Substring(0, $Address.IndexOf('.')) + ".DBW404"
$udtStatusValue = Get-Random -Minimum 100 -Maximum 999
$results += Test-DriverLoopback `
-Cli $s7Cli `
-WriteArgs (@("write") + $commonS7 + @("-a", $udtStatusAddress, "-t", "Int16", "-v", $udtStatusValue)) `
-ReadArgs (@("read") + $commonS7 + @("-a", $udtStatusAddress, "-t", "Int16")) `
-ExpectedValue "$udtStatusValue"
Write-Summary -Title "S7 e2e" -Results $results
if ($results | Where-Object { -not $_.Passed }) { exit 1 }