using System; using System.Collections.Generic; using System.ComponentModel; using System.Windows.Threading; using static GeneralGommunication.Modbus_Transaction; namespace GeneralGommunication { public interface IModbusAsciiAsync : INotifyPropertyChanged { /// /// 通讯速度测量模块 /// CommSpeedMeasuring Csm { get; } /// /// 包出错次数 /// int ErrCnt { get; } /// /// 有数据需要发送 /// event SendDataEventHandler SendMsgEvent; /// /// 设备连接状态改变 /// event DeviceConnectEventHander DeviceConnectEvent; /// /// 通讯中 /// bool IsBusy(); /// /// 检查发生列表是否包含某条指令 /// /// /// /// bool Contain(int deviceNo, string desription); /// /// 设备是否连接成功 /// /// /// bool IsConnected(byte deviceNo); /// /// 接收回调调用 /// /// void RecMsg(byte[] recBuf); /// /// 复位全部状态,通常由于通讯模块检测到连接断开导致的 /// void ResetMsg(); /// /// 添加 通讯任务 /// /// void AddTran(Modbus_Transaction tran); /// /// 读多个Holding REGs /// /// /// /// /// /// /// /// /// Modbus_Transaction Do_03(int deviceNo, int addr, int cnt, string desription, ParseU16FuncPackHandler parseU16FuncPack, CallBackHandler asyncDelegate, object asyncContext); /// /// 读多个Input REGs /// /// /// /// /// /// /// /// /// Modbus_Transaction Do_04(int deviceNo, int addr, int cnt, string desription, ParseU16FuncPackHandler parseU16FuncPack, CallBackHandler asyncDelegate, object asyncContext); /// /// 写单个 Holding REG /// /// /// /// /// /// /// /// Modbus_Transaction Do_06(int deviceNo, int addr, UInt16 value, string desription, CallBackHandler asyncDelegate, object asyncContext); /// /// 写多个 Holding REG /// /// /// /// /// /// /// /// Modbus_Transaction Do_10(int deviceNo, int addr, IEnumerable datas, string desription, CallBackHandler asyncDelegate, object asyncContext); /// /// 任务内部转为发送的字节 /// 用于自定义指令 /// /// void ToSendBuf(Modbus_Transaction tran); } }