using System;
namespace AMWD.Protocols.Modbus.Common
{
///
/// Represents a input register.
///
public class InputRegister : ModbusObject
{
///
public override ModbusObjectType Type => ModbusObjectType.InputRegister;
///
/// Gets or sets the value of the input register.
///
public ushort Value
{
get
{
byte[] blob = [HighByte, LowByte];
blob.SwapBigEndian();
return BitConverter.ToUInt16(blob, 0);
}
}
///
public override string ToString()
=> $"Input Register #{Address} | {Value} | HI: {HighByte:X2}, LO: {LowByte:X2}";
}
}