using System;
using System.Collections.Generic;
namespace EGFramework.Examples.ModbusDebugTool{
public class DataModbus{
///
/// Key is the ModbusRTU Type + "-" + DeviceAddress + "-" + RegisterAddress + "-" + Port
///
/// Key is the ModbusRTU DeviceAddress + "-" + Type + "-" + RegisterAddress + "-" + Port
///
///
public Dictionary Items { set; get; } = new Dictionary();
}
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;
}
}