Files touched — docs/drivers/Modbus-Test-Fixture.md dropped the key-files pointer at deleted Pymodbus/ + flipped "primary launcher is Docker, native fallback retained" framing to "Docker is the only supported launch path" (matching the code). docs/v2/dev-environment.md dropped the "skips both Docker + native-binary paths" parenthetical from AB_SERVER_ENDPOINT + flipped the "Native fallbacks" subsection to a one-liner that says Docker is the only supported path. docs/v2/modbus-test-plan.md rewrote §Harness from "pip install pymodbus + serve.ps1" setup pattern to "docker compose --profile <…> up" + updated the §PR 43 status bullet to point at Docker/profiles/. docs/v2/test-data-sources.md §"CI fixture (task #180)" rewrote the AB CIP section from "LocateBinary() picks binary off PATH" + GitHub Actions zip-download step to "Docker is the only supported reproducible build path" + docker compose GitHub Actions step; dropped the pinned-version SHA256 table + lock-file reference because the Dockerfile's LIBPLCTAG_TAG build-arg is the new pin. Code docstrings + error messages — these are developer-facing operational text too. ModbusSimulatorFixture SkipReason strings (both branches) now point at `docker compose -f Docker/docker-compose.yml --profile standard up -d` instead of the deleted `Pymodbus\serve.ps1`; doc-comment at the top references Docker/docker-compose.yml. Snap7ServerFixture SkipReason strings + doc-comment point at Docker/docker-compose.yml instead of PythonSnap7/serve.ps1. S7_1500Profile.cs docstring updated. Modbus Dockerfile comment pointing at deleted tests/.../Pymodbus/README.md redirected to docs/drivers/Modbus-Test-Fixture.md. DL205Profile.cs + DL205StringQuirkTests.cs + S7_1500Profile.cs (in Modbus project) docstrings flipped from Pymodbus/*.json references to Docker/profiles/*.json. Left untouched deliberately: docs/v2/implementation/exit-gate-phase-2-closed.md — that's a historical as-of-2026-04-18 snapshot documenting what was skipped at Phase 2 closure; rewriting would lose the date-stamped context. Its "oitc/modbus-server Docker container not started" + "ab_server binary not on PATH" lines describe the fixture landscape that existed at close time, not current operational guidance. Final sweep confirms zero remaining `Pymodbus/` / `PythonSnap7/` / `LocateBinary` / `AbServerSeedTag` / `BuildCliArgs` / `AbServerPlcArg` mentions anywhere in tracked files outside that historical exit-gate doc. Whole-solution build still 0 errors. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
50 lines
2.3 KiB
C#
50 lines
2.3 KiB
C#
namespace ZB.MOM.WW.OtOpcUa.Driver.Modbus.IntegrationTests.DL205;
|
|
|
|
/// <summary>
|
|
/// Tag map for the AutomationDirect DL205 device class. Mirrors what the pymodbus
|
|
/// <c>dl205.json</c> profile in <c>Docker/profiles/dl205.json</c> exposes (or the real PLC, when
|
|
/// <see cref="ModbusSimulatorFixture"/> is pointed at one).
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// This is the scaffold — each tag is deliberately generic so the smoke test has stable
|
|
/// addresses to read. Device-specific quirk tests (word order, max-register, register-zero
|
|
/// access, etc.) will land in their own test classes alongside this profile as the user
|
|
/// validates each behavior in pymodbus; see <c>docs/v2/modbus-test-plan.md</c> §per-device
|
|
/// quirk catalog for the checklist.
|
|
/// </remarks>
|
|
public static class DL205Profile
|
|
{
|
|
/// <summary>
|
|
/// Holding register the smoke test writes + reads. Address 200 is the first cell of the
|
|
/// scratch HR range in both <c>Docker/profiles/standard.json</c> (HR[200..209] = 0) and
|
|
/// <c>Docker/profiles/dl205.json</c> (HR[4096..4103] added in PR 43 for the same purpose), so
|
|
/// the smoke test runs identically against either simulator profile. Originally
|
|
/// targeted HR[100] — moved to HR[200] when the standard profile claimed HR[100] as
|
|
/// the auto-incrementing register that drives subscribe-and-receive tests.
|
|
/// </summary>
|
|
public const ushort SmokeHoldingRegister = 200;
|
|
|
|
/// <summary>Value the smoke test writes then reads back to assert round-trip integrity.</summary>
|
|
public const short SmokeHoldingValue = 1234;
|
|
|
|
public static ModbusDriverOptions BuildOptions(string host, int port) => new()
|
|
{
|
|
Host = host,
|
|
Port = port,
|
|
UnitId = 1,
|
|
Timeout = TimeSpan.FromSeconds(2),
|
|
Tags =
|
|
[
|
|
new ModbusTagDefinition(
|
|
Name: "Smoke_HReg200",
|
|
Region: ModbusRegion.HoldingRegisters,
|
|
Address: SmokeHoldingRegister,
|
|
DataType: ModbusDataType.Int16,
|
|
Writable: true),
|
|
],
|
|
// Disable the background probe loop — integration tests drive reads explicitly and
|
|
// the probe would race with assertions.
|
|
Probe = new ModbusProbeOptions { Enabled = false },
|
|
};
|
|
}
|