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