using NModbus; using System; using Team.Utility; namespace Team.Communicate.Modbus { public interface IModbusTcpSlaverService:IDisposable { /// /// create and start the TCP slave /// 默认创建所有监听所有网卡ip地址和localhost /// 默认端口号为502 /// 默认slaveId为1 /// void CreateModbusTcpSlave(string ip = default, byte slaveId = 1, int port = 502); IModbusSlave GetModbusSlaveByIp(); void WriteParameter(ushort startAddress, ushort value); void WriteParameter(ushort startAddress, short value); event EventHandler> CoilDiscretesHandler; event EventHandler> InputRegistersHandler; event EventHandler> HoldeRegistersHandler; } }