#region << 版 本 注 释 >> /*-------------------------------------------------------------------- * 版权所有 (c) 2026 WenJY 保留所有权利。 * CLR版本:4.0.30319.42000 * 机器名称:Mr.Wen's MacBook Pro * 命名空间:Sln.Wcs.Plc.Service * 唯一标识:4196498E-9837-4A60-955F-D33464BFC338 * * 创建者:WenJY * 电子邮箱: * 创建时间:2026-05-06 16:48:45 * 版本:V1.0.0 * 描述: * *-------------------------------------------------------------------- * 修改人: * 时间: * 修改说明: * * 版本:V1.0.0 *--------------------------------------------------------------------*/ #endregion << 版 本 注 释 >> using System.Threading.Tasks; namespace Sln.Wcs.Plc.Service; public interface IPlc { string ConfigKey { get; set; } /// /// 是否连接 /// bool IsConnected { get; set; } /// /// 建立连接 /// /// /// /// bool Connect(string ip, int port); /// /// 断开连接 /// /// bool DisConnect(); /// /// 根据地址读取指定长度数据 /// /// /// /// byte[] readValueByAddress(string address, int len); /// /// 通过PLC地址读取int16类型数据 /// /// /// int readInt16ByAddress(string address); /// /// 通过PLC地址写入int16类型数据 /// /// /// /// bool writeInt16ByAddress(string address, int value); /// /// 通过PLC地址读取string类型数据 /// /// /// string readStringByAddress(string address, ushort length); /// /// 弃用--通过PLC地址写入String类型数据 /// /// /// /// bool writeStringByAddress(string address, string value); /// /// 使用--通过PLC地址写入String类型数据 /// /// /// /// //bool writeStringByAddress(string address, string value, int length); /// /// 通过PLC地址读取Bool类型数据 /// /// /// bool readBoolByAddress(string address); /// /// 通过PLC地址写入Bool类型数据 /// /// /// bool writeBoolByAddress(string address, bool value); /// /// 通过PLC地址写入Double类型数据 /// /// /// /// bool writeDoubleByAddress(string address, int value); }