@using ZB.MOM.WW.OtOpcUa.Driver.Modbus @* #145 — Driver-instance options panel for the Modbus driver. Surfaces every option group added by #136-#144 so users can configure the driver via the UI rather than hand-editing DriverConfig JSON. Bound to a ModbusOptionsViewModel; the parent page round-trips that model to the DriverConfig.json column on save. *@
Connection
Family (#144)
@if (Model.Family == ModbusFamily.MELSEC) {
}
Keep-alive (#139)
Reconnect (#139)
Protocol (#140)
@code { [Parameter, EditorRequired] public ModbusOptionsViewModel Model { get; set; } = default!; /// /// UI binding model. Maps 1:1 onto the JSON DTO the driver factory accepts; serialised /// to DriverConfig.json by the calling save handler. Defaults match /// ModbusDriverOptions defaults so unedited rows produce the historical wire /// output verbatim. /// public sealed class ModbusOptionsViewModel { public string Host { get; set; } = "127.0.0.1"; public int Port { get; set; } = 502; public byte UnitId { get; set; } = 1; public ModbusFamily Family { get; set; } = ModbusFamily.Generic; public MelsecFamily MelsecSubFamily { get; set; } = MelsecFamily.Q_L_iQR; public bool KeepAliveEnabled { get; set; } = true; public int KeepAliveTimeSec { get; set; } = 30; public int KeepAliveIntervalSec { get; set; } = 10; public int KeepAliveRetryCount { get; set; } = 3; public int ReconnectInitialDelayMs { get; set; } = 0; public int ReconnectMaxDelayMs { get; set; } = 30000; public double ReconnectBackoffMultiplier { get; set; } = 2.0; public int MaxRegistersPerRead { get; set; } = 125; public int MaxRegistersPerWrite { get; set; } = 123; public int MaxCoilsPerRead { get; set; } = 2000; public int MaxReadGap { get; set; } = 0; public bool UseFC15ForSingleCoilWrites { get; set; } = false; public bool UseFC16ForSingleRegisterWrites { get; set; } = false; public bool WriteOnChangeOnly { get; set; } = false; } }