12345678910111213141516171819202122232425262728 |
- using NModbus;
- using System;
- using Team.Utility;
- namespace Team.Communicate.Modbus
- {
- public interface IModbusTcpSlaverService:IDisposable
- {
- /// <summary>
- /// create and start the TCP slave
- /// 默认创建所有监听所有网卡ip地址和localhost
- /// 默认端口号为502
- /// 默认slaveId为1
- /// </summary>
- 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<StorageEventArgs<bool>> CoilDiscretesHandler;
- event EventHandler<StorageEventArgs<ushort>> InputRegistersHandler;
- event EventHandler<StorageEventArgs<ushort>> HoldeRegistersHandler;
- }
- }
|