using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Admin.Core.PlcServer { public interface IPlc { /// /// 是否连接 /// bool IsConnected { get; set; } /// /// 建立连接 /// /// /// /// bool Connect(string IP, int port); /// /// 断开连接 /// /// bool DisConnect(); /// /// 读取byte数据 /// /// /// byte[] ReadBytes(string address); /// /// 读取bool /// /// /// bool ReadBool(string address); /// /// 读取int16 /// /// /// int ReadInt16(string address); /// /// 读取int32 /// /// /// int ReadInt32(string address); /// /// 读取string /// /// /// string ReadString(string address); /// /// 读取Float /// /// /// float ReadFloat(string address); /// /// 写入int16 /// /// /// /// bool WriteInt16(string address, string value); /// /// 写入int32 /// /// /// /// bool WriteInt32(string address, int value); /// /// 写入string /// /// /// /// bool WriteString(string address, string value); /// /// 写入byte /// /// /// /// bool WriteByte(string address, byte[] bytes); /// /// 写入byte /// /// /// /// bool WriteFloat(string address, float value); /// /// 心跳使用——喂狗 /// /// /// Task Read(string address); } }