DiscreteInputRegister.cs 1.0 KB
using System;

namespace DL.Com.Protocol.Modbus
{
    /// <summary>
    /// 离散输入寄存器
    /// 功能码0x02
    /// </summary>
    public class DiscreteInputRegister:Register
    {
        /// <summary>
        /// 离散输入寄存器
        /// 功能码0x02
        /// </summary>
        public DiscreteInputRegister() :base()
        {
            FunctionCodes.Add(RegisterFunction.Read, 0x02);
        }
        /// <summary>
        /// PLC地址
        /// </summary>
        public new string PLCAddress
        {
            get { return $"1{FrameStruct.PDU.Data.Addr.GetIntValue()}"; }
        }

        protected override bool ParseWriteMultiple(byte[] response)
        {
            throw new NotImplementedException();
        }

        protected override bool ParseWriteSingle(byte[] response)
        {
            throw new NotImplementedException();
        }

        protected override void SetParamPDU(CmdByte cmdByte)
        {
            SetPDU(RegisterFunction.Read, cmdByte.StartAddr, cmdByte.Count);
        }
    }
}