Implemented Modbus Serial Client

This commit is contained in:
2024-04-02 19:24:36 +02:00
parent ca95298390
commit a458e76aea
18 changed files with 1975 additions and 17 deletions

View File

@@ -31,12 +31,12 @@ namespace AMWD.Protocols.Modbus.Common.Contracts
TimeSpan ConnectTimeout { get; set; }
/// <summary>
/// Gets or sets the receive time out value of the connection.
/// Gets or sets the <see cref="TimeSpan"/> before a time-out occurs when a read/receive operation does not finish.
/// </summary>
TimeSpan ReadTimeout { get; set; }
/// <summary>
/// Gets or sets the send time out value of the connection.
/// Gets or sets the <see cref="TimeSpan"/> before a time-out occurs when a write/send operation does not finish.
/// </summary>
TimeSpan WriteTimeout { get; set; }

View File

@@ -0,0 +1,26 @@
using System;
namespace AMWD.Protocols.Modbus.Common.Events
{
/// <summary>
/// Represents the coil written event arguments.
/// </summary>
[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
public class CoilWrittenEventArgs : EventArgs
{
/// <summary>
/// Gets or sets the unit id.
/// </summary>
public byte UnitId { get; set; }
/// <summary>
/// Gets or sets the coil address.
/// </summary>
public ushort Address { get; set; }
/// <summary>
/// Gets or sets the coil value.
/// </summary>
public bool Value { get; set; }
}
}

View File

@@ -0,0 +1,36 @@
using System;
namespace AMWD.Protocols.Modbus.Common.Events
{
/// <summary>
/// Represents the register written event arguments.
/// </summary>
[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
public class RegisterWrittenEventArgs : EventArgs
{
/// <summary>
/// Gets or sets the unit id.
/// </summary>
public byte UnitId { get; set; }
/// <summary>
/// Gets or sets the address of the register.
/// </summary>
public ushort Address { get; set; }
/// <summary>
/// Gets or sets the value of the register.
/// </summary>
public ushort Value { get; set; }
/// <summary>
/// Gets or sets the high byte of the register.
/// </summary>
public byte HighByte { get; set; }
/// <summary>
/// Gets or sets the low byte of the register.
/// </summary>
public byte LowByte { get; set; }
}
}