Implementation of the basic functionallity

This commit is contained in:
2024-02-06 19:47:06 +01:00
parent a6c7828fbe
commit f31f6f94ff
42 changed files with 6875 additions and 11 deletions

View File

@@ -0,0 +1,20 @@
namespace AMWD.Protocols.Modbus.Common
{
/// <summary>
/// Represents a discrete input.
/// </summary>
public class DiscreteInput : ModbusObject
{
/// <inheritdoc/>
public override ModbusObjectType Type => ModbusObjectType.DiscreteInput;
/// <summary>
/// Gets or sets a value indicating whether the discrete input is on or off.
/// </summary>
public bool Value => HighByte == 0xFF;
/// <inheritdoc/>
public override string ToString()
=> $"Discrete Input #{Address} | {(Value ? "ON" : "OFF")}";
}
}