Compare commits

...

2 Commits

Author SHA1 Message Date
kostas 79994ffe2f Merge remote-tracking branch 'origin/main' 2024-08-06 15:46:06 +02:00
kostas 047f733f8a Update: Battery 250UP Driver 2024-08-06 15:45:54 +02:00
3 changed files with 18 additions and 29 deletions

View File

@ -60,11 +60,11 @@ public partial class Battery250UpRecord
public readonly struct AuxBitInformation_
{
public Boolean DischargeEnabled => ((Self._IoStates >> 0) & 1) == 1;
public Boolean ChargeEnabled => ((Self._IoStates >> 1) & 1) == 1;
public Boolean WarmUpActive => ((Self._IoStates >> 2) & 1) == 1;
public Boolean TOCRequested => ((Self._IoStates >> 3) & 1) == 1;
public Boolean EOCReached => ((Self._IoStates >> 4) & 1) == 1;
public Boolean DischargeEnabled => ((Self._AuxBitInformation >> 0) & 1) == 1;
public Boolean ChargeEnabled => ((Self._AuxBitInformation >> 1) & 1) == 1;
public Boolean WarmUpActive => ((Self._AuxBitInformation >> 2) & 1) == 1;
public Boolean TOCRequested => ((Self._AuxBitInformation >> 3) & 1) == 1;
public Boolean EOCReached => ((Self._AuxBitInformation >> 4) & 1) == 1;
internal AuxBitInformation_(Battery250UpRecord self) => Self = self;
private Battery250UpRecord Self { get; }
@ -134,9 +134,6 @@ public partial class Battery250UpRecord
if (HasBit(7) ) yield return "VBm2 : Bus voltage too low";
if (HasBit(9) ) yield return "VBM2 : Bus voltage too high";
if (HasBit(11)) yield return "IDM2 : Discharge current too high";
if (HasBit(12)) yield return "ISOB : Electrical insulation failure";
if (HasBit(13)) yield return "MSWE : Main switch failure";
if (HasBit(14)) yield return "FUSE : Main fuse blown";
if (HasBit(15)) yield return "HTRE : Battery failed to warm up";
if (HasBit(16)) yield return "TCPE : Temperature sensor failure";
if (HasBit(17)) yield return "STRE : Voltage measurement circuit fails";
@ -149,11 +146,11 @@ public partial class Battery250UpRecord
if (HasBit(27)) yield return "iCM2 : Charge current too high";
if (HasBit(29)) yield return "iDM2 : Discharge current too high";
if (HasBit(31)) yield return "MID2 : String voltage unbalance too high";
if (HasBit(33)) yield return "CCBF : Charger Circuit not working";
if (HasBit(42)) yield return "HTFS : Heater Fuse Blown";
if (HasBit(43)) yield return "DATA : Parameters out of range";
if (HasBit(45)) yield return "LMPA : Unbalance string voltages";
if (HasBit(46)) yield return "HEBT : Loss of heartbeat";
if (HasBit(48)) yield return "CURM : Battery charge requested after EDCH";
if (HasBit(54)) yield return "ULAL : The safety microprocessor intervened";
}
[SuppressMessage("ReSharper", "StringLiteralTypo")]
@ -161,24 +158,12 @@ public partial class Battery250UpRecord
{
Boolean HasBit(Int16 bit) => (_WarningFlags & 1uL << bit) > 0;
if (HasBit(1) ) yield return "TaM1: BMS temperature high";
if (HasBit(4) ) yield return "TbM1: Battery temperature high";
if (HasBit(6) ) yield return "VBm1: Bus voltage low";
if (HasBit(8) ) yield return "VBM1: Bus voltage high";
if (HasBit(10)) yield return "IDM1: Discharge current high";
if (HasBit(22)) yield return "vsm1: String voltage too low";
if (HasBit(24)) yield return "vsM1: String voltage high";
if (HasBit(26)) yield return "iCM1: Charge current high";
if (HasBit(28)) yield return "iDM1: Discharge current high";
if (HasBit(28)) yield return "iDM1: String discharge current high";
if (HasBit(30)) yield return "MID1: String voltages unbalanced";
if (HasBit(32)) yield return "BLPW: Not enough charging power on bus";
if (HasBit(33)) yield return "CCBF : Internal charger hardware failure";
if (HasBit(35)) yield return "Ah_W: String SOC low";
if (HasBit(38)) yield return "MPMM: Midpoint wiring problem";
if (HasBit(40)) yield return "TCdi: Temperature difference between strings high";
if (HasBit(44)) yield return "LMPW : String voltages unbalance warning";
if (HasBit(47)) yield return "TOCW : Top of Charge requested";
if (HasBit(49)) yield return "BUSL : Bus lower than string";
if (HasBit(32)) yield return "BLPW: Charging power is not available. Bus voltage low";
if (HasBit(49)) yield return "TOCW : TOC is less than 100% from 14 days";
}

View File

@ -54,7 +54,11 @@ public partial class Battery250UpRecord
[InputRegister(1052)] private UInt16 _TimeToTocRequest;
//[InputRegister(1063)] private UInt16 _TotalBatteryCycle;
[InputRegister(1063)] private UInt16 _TotalBatteryCycle;
[InputRegister(1064, Scale = 1, Offset = -1000)] private UInt16 _DC_Discharge_Current_Limit;
[InputRegister(1065, Scale = 1, Offset = -1000)] private UInt16 _DC_Charge_Current_Limit;
[InputRegister(1066, Scale = 0.1)] private UInt16 _Voltage_Charge_Setpoint;
[InputRegister(1067, Scale = 0.1)] private UInt16 _DC_Min_Voltage_Limit;
[InputRegister(1068)] private UInt16 _AuxBitInformation;
private LedState ParseLed(LedColor led) => (LedState)((_LedStates >> (Int32)led) & 3);

View File

@ -54,6 +54,6 @@ INNOVENERGY_PROTOCOL_VERSION = '48TL200V3'
# S3 Credentials
S3BUCKET = "91-c0436b6a-d276-4cd8-9c44-1eae86cf5d0e"
S3KEY = "EXOe6dce12288f11a676c2025a1"
S3SECRET = "xpqM4Eh0Gg1HaYVkzlR9X6PwYa-QNb-mVk0XUkwW3cc"
S3BUCKET = "114-c0436b6a-d276-4cd8-9c44-1eae86cf5d0e"
S3KEY = "EXO5b9198dc11544f42b44e1180"
S3SECRET = "ga-mD3SYZMJUfjksmXPKAHQhVkxPZYv57jC1oD_mkC0"