12345678910111213141516171819202122232425262728 |
- using LogoForceTestApp.Services.Interfaces.Events;
- using NModbus;
- using System;
- namespace LogoForceTestApp.Services.Interfaces
- {
- 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;
- }
- }
|