namespace ZB.MOM.WW.OtOpcUa.Driver.Modbus.IntegrationTests.Mitsubishi; /// /// Tag map for the Mitsubishi MELSEC device class with a representative Modbus Device /// Assignment block mapping D0..D1023 → HR[0..1023]. Mirrors the behaviors in /// mitsubishi.json pymodbus profile and docs/v2/mitsubishi.md. /// /// /// MELSEC Modbus sites all have *different* device-assignment parameter blocks; this profile /// models the conventional default. Per-model differences (FX5U needs firmware ≥ 1.060 for /// Modbus server; QJ71MT91 lacks FC22/FC23; FX/iQ-F use octal X/Y while Q/L/iQ-R use hex) /// are handled in (PR 59) and the per-model test files. /// public static class MitsubishiProfile { /// /// Scratch HR the smoke test writes + reads. Address 200 mirrors the /// dl205/s7_1500/standard scratch range so one smoke test pattern works across every /// device profile the simulator supports. /// public const ushort SmokeHoldingRegister = 200; /// Value the smoke test writes then reads back. public const short SmokeHoldingValue = 7890; 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), ], Probe = new ModbusProbeOptions { Enabled = false }, }; }