using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Net; using System.Net.Sockets; namespace FLY.Modbus { /// /// 异常有异常事件 /// public interface IModbusClient { /// /// 读多个 COIL /// /// /// /// /// /// ModbusClient_Errno Do_01(UInt16 addr, UInt16 cnt, Action AsyncDelegate, object AsyncState); /// /// 读多个Holding REGs /// /// /// /// /// /// ModbusClient_Errno Do_03(UInt16 addr, UInt16 cnt, Action AsyncDelegate, object AsyncState); /// /// Write Single Coil /// /// /// /// ModbusClient_Errno Do_05(UInt16 addr, bool data); /// /// Write Single Coil,带返回 /// /// /// /// /// /// ModbusClient_Errno Do_05(UInt16 addr, bool data, Action AsyncDelegate, object AsyncState); /// /// 写多个coil /// /// /// /// ModbusClient_Errno Do_0F(UInt16 addr, bool[] datas); /// /// 写多个coil,带返回 /// /// /// /// /// /// ModbusClient_Errno Do_0F(UInt16 addr, bool[] datas, Action AsyncDelegate, object AsyncState); /// /// 写多个REG /// /// /// /// ModbusClient_Errno Do_10(UInt16 addr, UInt16[] datas); /// /// 写多个REG,带返回 /// /// /// /// /// /// ModbusClient_Errno Do_10(UInt16 addr, UInt16[] datas, Action AsyncDelegate, object AsyncState); } /// /// modbus客户端,指令返回值 /// public enum ModbusClient_Errno { /// /// 成功 /// OK = 0, /// /// 失败,trans 出错 /// TOO_MUCH_TRANS = -1, } }