You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
1.1 KiB

using System;
using System.Collections.Generic;
namespace EGFramework.Examples.ModbusDebugTool{
public class DataModbus{
/// <summary>
/// Key is the ModbusRTU Type + "-" + DeviceAddress + "-" + RegisterAddress + "-" + Port
/// </summary>
/// <typeparam name="string">Key is the ModbusRTU DeviceAddress + "-" + Type + "-" + RegisterAddress + "-" + Port</typeparam>
/// <typeparam name="DataModbusItem"></typeparam>
/// <returns></returns>
public Dictionary<string,DataModbusItem> Items { set; get; } = new Dictionary<string,DataModbusItem>();
}
public class DataModbusItem
{
public ModbusRegisterType Type { set; get; } = ModbusRegisterType.HoldingRegister;
public byte DeviceAddress { set; get; }
public ushort RegisterAddress { set; get; }
public string SerialPort { set; get; }
public string GetKey(){
return Type + "-" + DeviceAddress + "-" + RegisterAddress + "-" + SerialPort;
}
}
public class DataModbusSettings{
public int BaudRate{ set; get; } = 115200;
}
}