namespace ZB.MOM.WW.OtOpcUa.Driver.Modbus.IntegrationTests.DL205; /// /// Tag map for the AutomationDirect DL205 device class. Mirrors what the pymodbus /// dl205.json profile in Pymodbus/dl205.json exposes (or the real PLC, when /// is pointed at one). /// /// /// 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 docs/v2/modbus-test-plan.md §per-device /// quirk catalog for the checklist. /// public static class DL205Profile { /// /// Holding register the smoke test writes + reads. Address 200 is the first cell of the /// scratch HR range in both Pymodbus/standard.json (HR[200..209] = 0) and /// Pymodbus/dl205.json (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. /// public const ushort SmokeHoldingRegister = 200; /// Value the smoke test writes then reads back to assert round-trip integrity. 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 }, }; }