using System; using System.Collections.Generic; using System.Linq; using System.Text; using HslCommunication.Core.Address; using HslCommunication.Profinet.Melsec; namespace HslCommunication.Profinet.Keyence { /// /// 基恩士PLC的数据读写类 /// /// /// 地址的输入的格式说明如下: /// /// /// 地址名称 /// 地址代号 /// 示例 /// 地址进制 /// 字操作 /// 位操作 /// KV-7500/7300 /// KV-5500/5000/3000 /// KV Nano /// /// /// 输入继电器 /// X /// X100,X1A0 /// 16 /// /// /// R00000~R99915 /// R00000~R99915 /// R00000~R59915 /// /// /// 输出继电器 /// Y /// Y100,Y1A0 /// 16 /// /// /// R00000~R99915 /// R00000~R99915 /// R00000~R59915 /// /// /// 链接继电器 /// B /// B100,B1A0 /// 16 /// /// /// B0000~B7FFF /// B0000~B3FFF /// B0000~B1FFF /// /// /// 内部辅助继电器 /// M /// M100,M200 /// 10 /// /// /// MR00000~MR99915 /// MR00000~MR99915 /// MR00000~MR59915 /// /// /// 锁存继电器 /// L /// L100,L200 /// 10 /// /// /// LR00000~LR99915 /// LR00000~LR99915 /// LR00000~LR19915 /// /// /// 控制继电器 /// SM /// SM100,SM200 /// 10 /// /// /// CR0000~CR7915 /// CR0000~CR3915 /// CR0000~CR8915 /// /// /// 控制存储器 /// SD /// SD100,SD200 /// 10 /// /// × /// CM0000~CM5999 /// CM0000~CM5999 /// CM0000~CM8999 /// /// /// 数据存储器 /// D /// D100,D200 /// 10 /// /// × /// DM00000~DM65534 /// DM00000~DM65534 /// DM00000~DM32767 /// /// /// 扩展数据存储器 /// D /// D100000~D165534 /// 10 /// /// × /// EM00000~EM65534 /// EM00000~EM65534 /// × /// /// /// 文件寄存器 /// R /// R100,R200 /// 10 /// /// × /// FM00000~FM32767 /// FM00000~FM32767 /// × /// /// /// 文件寄存器 /// ZR /// ZR100,ZR1A0 /// 16 /// /// × /// ZF000000~ZF524287 /// ZF000000~ZF131071 /// × /// /// /// 链路寄存器 /// W /// W100,W1A0 /// 16 /// /// × /// W0000~7FFF /// W0000~3FFF /// W0000~3FFF /// /// /// 定时器(当前值) /// TN /// TN100,TN200 /// 10 /// /// × /// T0000~T3999 /// T0000~T3999 /// T000~T511 /// /// /// 定时器(接点) /// TS /// TS100,TS200 /// 10 /// /// /// T0000~T3999 /// T0000~T3999 /// T000~T511 /// /// /// 计数器(当前值) /// CN /// CN100,CN200 /// 10 /// /// × /// C0000~C3999 /// C0000~C3999 /// C000~C255 /// /// /// 计数器(接点) /// CS /// CS100,CS200 /// 10 /// /// /// C0000~C3999 /// C0000~C3999 /// C000~C255 /// /// /// public class KeyenceMcAsciiNet : MelsecMcAsciiNet { #region Constructor /// /// 实例化基恩士的Qna兼容3E帧协议的通讯对象 /// public KeyenceMcAsciiNet() : base( ) { } /// /// 实例化一个基恩士的Qna兼容3E帧协议的通讯对象 /// /// PLC的Ip地址 /// PLC的端口 public KeyenceMcAsciiNet( string ipAddress, int port ) : base( ipAddress, port ) { } #endregion #region Address Overeride /// /// 分析地址的方法,允许派生类里进行重写操作 /// /// 地址信息 /// 数据长度 /// 解析后的数据信息 protected override OperateResult McAnalysisAddress( string address, ushort length ) { return McAddressData.ParseKeyenceFrom( address, length ); } #endregion #region Object Override /// /// 获取当前对象的字符串标识形式 /// /// 字符串信息 public override string ToString() { return $"KeyenceMcAsciiNet[{IpAddress}:{Port}]"; } #endregion } }