namespace SlnMesnac.Plc { public abstract class PlcAbsractFactory { /// /// 是否连接 /// public abstract bool IsConnected { get; set; } /// /// 建立连接 /// /// /// /// public abstract bool Connect(string ip, int port); /// /// 断开连接 /// /// public abstract bool DisConnect(); /// /// 根据地址读取指定长度数据 /// /// /// /// public abstract byte[] readValueByAddress(string address,int len); /// /// 通过PLC地址读取int16类型数据 /// /// /// public abstract int readInt16ByAddress(string address); /// /// 通过PLC地址写入int16类型数据 /// /// /// /// public abstract bool writeInt16ByAddress(string address,int value); /// /// 通过PLC地址读取string类型数据 /// /// /// public abstract string readStringByAddress(string address, ushort length); /// /// 通过PLC地址写入String类型数据 /// /// /// /// public abstract bool writeStringByAddress(string address, string value); /// /// 通过PLC地址读取Bool类型数据 /// /// /// public abstract bool readBoolByAddress(string address); /// /// 通过PLC地址读取心跳结果 /// /// /// public abstract bool readHeartByAddress(string address); /// /// 通过PLC地址写入Bool类型数据 /// /// /// public abstract bool writeBoolByAddress(string address, bool value); /// /// 通过PLC地址写入Double类型数据 /// /// /// /// public abstract bool writeDoubleByAddress(string address, int value); } }