53 lines
1.4 KiB
C#
53 lines
1.4 KiB
C#
namespace RobotNet10.RobotApp.Client.Shared.Devices;
|
|
|
|
|
|
/// <summary>
|
|
/// DTO cho Modbus value (register)
|
|
/// </summary>
|
|
public struct ModbusValue
|
|
{
|
|
public ushort Address { get; set; }
|
|
public ushort Index { get; set; }
|
|
public ushort Value { get; set; }
|
|
public string Name { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// DTO cho Modbus bool value (coil/discrete input)
|
|
/// </summary>
|
|
public struct ModbusBoolValue
|
|
{
|
|
public ushort Address { get; set; }
|
|
public ushort Index { get; set; }
|
|
public bool Value { get; set; }
|
|
public string Name { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// DTO cho Modbus range data
|
|
/// </summary>
|
|
public struct ModbusRangeData
|
|
{
|
|
public ushort StartAddress { get; set; }
|
|
public ushort Quantity { get; set; }
|
|
public string Name { get; set; }
|
|
public string[] ChildrenNames { get; set; }
|
|
public ModbusValue[] Values { get; set; }
|
|
public ModbusBoolValue[] BoolValues { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// DTO cho ModbusTCP data
|
|
/// </summary>
|
|
public struct ModbusTcpData
|
|
{
|
|
public string IpAddress { get; set; }
|
|
public int Port { get; set; }
|
|
public byte SlaveId { get; set; }
|
|
public bool IsConnected { get; set; }
|
|
public ModbusRangeData[] HoldingRegisters { get; set; }
|
|
public ModbusRangeData[] InputRegisters { get; set; }
|
|
public ModbusRangeData[] Coils { get; set; }
|
|
public ModbusRangeData[] DiscreteInputs { get; set; }
|
|
}
|