using PLCCommunication; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace PLC { /// /// PLC接口 /// public interface IPLC { /// /// 链接 /// /// /// bool Connect(ref string msg); /// /// 断开 /// /// bool Disconnect(); #region 读取 /// /// 读取单个Bool /// /// /// bool ReadBool(string address); /// /// 读取单个Int16整数 /// /// /// short ReadInt16(string address); /// /// 异步读取单个Int16整数 /// /// /// Task> ReadInt16Async(string address); /// /// 读取Int16数组 /// /// /// /// short[] ReadArrInt16(string address, ushort length); /// /// 异步读取Int16数组 /// /// /// /// Task> ReadArrInt16Async(string address, ushort length); /// /// 读取单个32位整数 /// /// /// int ReadInt32(string address); /// /// 异步读取单个32位整数 /// /// /// Task> ReadInt32Async(string address); /// /// 读取浮点型数据 /// /// /// float ReadFloat(string address); /// /// 异步读取float数组 /// /// /// /// Task> ReadArrFloatAsync(string address, ushort length); /// /// 泛型读取 /// /// /// /// /// /// T ReadValue(string address, DataType type, ushort length = 0); #endregion #region 写入 bool WriteBool(string address, bool value); bool WriteInt16(string address, short value); bool WriteInt32(string address, int value); bool WriteFloat(string address, float value); JYResult WriteValue(string address, object value, PLC.DataType type); #endregion } }