From 649c8b37e85d7a69028db1f1c29cddc39e87f7e5 Mon Sep 17 00:00:00 2001 From: atef Date: Wed, 4 Oct 2023 15:18:45 +0200 Subject: [PATCH] Add new battery reading for current abd bus current to test the heating current --- .../Devices/Battery48TL/Battery48TlRecord.Api.cs | 13 +++++++++---- .../Devices/Battery48TL/Battery48TlRecord.Modbus.cs | 4 ++++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/csharp/Lib/Devices/Battery48TL/Battery48TlRecord.Api.cs b/csharp/Lib/Devices/Battery48TL/Battery48TlRecord.Api.cs index c5908b95d..ec8bdf9e7 100644 --- a/csharp/Lib/Devices/Battery48TL/Battery48TlRecord.Api.cs +++ b/csharp/Lib/Devices/Battery48TL/Battery48TlRecord.Api.cs @@ -28,12 +28,17 @@ public partial class Battery48TlRecord public Percent Soc => _Soc; + public Current BusCurrent => _BusCurrent; + public UInt16 BusCurrentHex => _BusCurrentHex; + + public UInt16 CellsCurrentHex => _CellsCurrentHex; + + public Current HeatingCurrent => _BusCurrent - _CellsCurrent; + public DcPower HeatingPower => HeatingCurrent * Dc.Voltage; + // Time since TOC is a counter from the last moment when the battery reached EOC // When The battery is full charged (reached EOC) the Time Since TOC is set to 0 public TimeSpan TimeSinceTOC => TimeSpan.FromMinutes(_TimeSinceToc); - public Current BusCurrent => _BusCurrent; - public Current HeatingCurrent => _BusCurrent - _CellsCurrent; - public DcPower HeatingPower => HeatingCurrent * Dc.Voltage; public Boolean CalibrationChargeRequested => TimeSinceTOC > TimeSpan.FromDays(7); @@ -215,4 +220,4 @@ public partial class Battery48TlRecord } } } - + diff --git a/csharp/Lib/Devices/Battery48TL/Battery48TlRecord.Modbus.cs b/csharp/Lib/Devices/Battery48TL/Battery48TlRecord.Modbus.cs index 312017c89..8d7882710 100644 --- a/csharp/Lib/Devices/Battery48TL/Battery48TlRecord.Modbus.cs +++ b/csharp/Lib/Devices/Battery48TL/Battery48TlRecord.Modbus.cs @@ -20,7 +20,11 @@ public partial class Battery48TlRecord [InputRegister(999, Scale = 0.01)] private Double _CellsVoltage; [InputRegister(1001, Scale = 0.01)] private Double _BusVoltage; [InputRegister(1000, Scale = 0.01, Offset = -10000)] private Double _CellsCurrent; + [InputRegister(1000)] private UInt16 _CellsCurrentHex; + + [InputRegister(1062, Scale = 0.01, Offset = -10000)] private Double _BusCurrent; + [InputRegister(1062)] private UInt16 _BusCurrentHex; [InputRegister(1053, Scale = 0.1)] private Double _Soc; [InputRegister(1052)] private UInt16 _TimeSinceToc;