using System.Threading.Tasks;
namespace HighWayIot.Plc
{
public interface IPlc
{
bool IsConnected { get; set; }
///
/// 读取心跳
///
///
Task ReadHeart(string address);
///
/// 建立连接
///
///
///
///
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);
}
}