2023-05-06 13:41:39 +00:00
|
|
|
using InnovEnergy.Lib.Protocols.Modbus.Channels;
|
|
|
|
using InnovEnergy.Lib.Protocols.Modbus.Clients;
|
2023-06-13 10:54:06 +00:00
|
|
|
using InnovEnergy.Lib.Units;
|
2023-05-06 13:41:39 +00:00
|
|
|
using InnovEnergy.Lib.Utils;
|
|
|
|
|
|
|
|
namespace InnovEnergy.Lib.Devices.EmuMeter;
|
|
|
|
|
|
|
|
public static class Program
|
|
|
|
{
|
|
|
|
public static Task Main(string[] args)
|
|
|
|
{
|
2023-06-13 10:54:06 +00:00
|
|
|
var ch = new TcpChannel("localhost", 5004);
|
2023-05-06 13:41:39 +00:00
|
|
|
var cl = new ModbusTcpClient(ch, 1);
|
|
|
|
var d = new EmuMeterDevice(cl);
|
|
|
|
|
|
|
|
while (true)
|
|
|
|
{
|
|
|
|
var x = d.Read();
|
2023-06-13 10:54:06 +00:00
|
|
|
x.ToCsv().WriteLine();
|
2023-05-06 13:41:39 +00:00
|
|
|
}
|
2023-06-13 10:54:06 +00:00
|
|
|
|
2023-05-06 13:41:39 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
}
|