using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Mesnac.PlcUtils { /// /// PLC 工具类接口 /// public interface IPlc { bool IsConnected { get; set; } /// /// 建立连接 /// /// /// /// bool Connect(string IP, int port); /// /// 断开连接 /// /// bool DisConnect(); /// /// 通过地址和长度读取PLC数据 /// /// /// /// byte[] readValueByAddress(int len, string address); /// /// 通过PLC地址写入int类型数据 /// /// /// /// bool writeValueByAddress(int value, string address); /// /// 通过PLC地址清零数据 /// /// /// /// bool resetByAddress(string address, int len); /// /// 通过PLC地址读取EA值 /// /// /// string readEaByAddress(string address); /// /// 通过PLC地址读取交互信号 /// /// /// int readInteractiveSignal(string address); /// /// 通过PLC地址读取int32类型数据 /// /// /// int readInt32ByAddress(string address); /// /// 通过PLC地址写入int32类型数据 /// /// /// /// bool writeInt32ByAddress(string address, int value); /// /// 通过PLC地址读取string类型数据 /// /// /// string readStringByAddress(string address, ushort length); /// /// 通过PLC地址写入String类型数据 /// /// /// /// bool writeStringByAddress(string address, string value); /// /// 通过PLC地址读取Bool类型数据 /// /// /// bool readBoolByAddress(string address); /// /// 通过PLC地址写入Bool类型数据 /// /// /// bool writeBoolByAddress(string address, bool value); /// /// 通过PLC地址写入Double类型数据 /// /// /// /// bool writeDoubleByAddress(string address, int value); } }