diff --git a/csharp/App/SaliMax/src/Ess/Controller.cs b/csharp/App/SaliMax/src/Ess/Controller.cs index f8233a150..ed9baeb11 100644 --- a/csharp/App/SaliMax/src/Ess/Controller.cs +++ b/csharp/App/SaliMax/src/Ess/Controller.cs @@ -31,9 +31,11 @@ public static class Controller { var mode = s.SelectControlMode().WriteLine(); - if (mode is EssMode.Off) + if (mode is EssMode.Off) + { return EssControl.Default; - + } + if (mode is EssMode.NoGridMeter) return new EssControl { @@ -152,7 +154,7 @@ public static class Controller private static Double MaxBatteryChargePower(this StatusRecord s) { - // This introduce a limit when we don't have communication with batteries + // This introduces a limit when we don't have communication with batteries // Otherwise the limit will be 0 and the batteries will be not heated var batteries = s.GetBatteries(); @@ -205,64 +207,42 @@ public static class Controller (calibrationChargeForced == CalibrationChargeType.AdditionallyOnce && additionalCalibrationRequired) || (calibrationChargeForced == CalibrationChargeType.RepetitivelyEvery && repetitiveCalibrationRequired); - Console.WriteLine("Next Repetitive calibration charge date is "+statusRecord.Config.DayAndTimeForRepetitiveCalibration); - Console.WriteLine("Next Additional calibration charge date is "+statusRecord.Config.DayAndTimeForAdditionalCalibration); + Console.WriteLine("Next Repetitive calibration charge date is "+ statusRecord.Config.DayAndTimeForRepetitiveCalibration); + Console.WriteLine("Next Additional calibration charge date is "+ statusRecord.Config.DayAndTimeForAdditionalCalibration); if (statusRecord.Battery is not null) { if (calibrationChargeForced == CalibrationChargeType.AdditionallyOnce && statusRecord.Battery.Eoc ) { statusRecord.Config.ForceCalibrationChargeState = CalibrationChargeType.RepetitivelyEvery; - //_hasAdditionalCalibrationChargeChecked = false; } else if (calibrationChargeForced == CalibrationChargeType.RepetitivelyEvery && statusRecord.Battery.Eoc && _hasRepetitiveCalibrationChargeChecked) { statusRecord.Config.DayAndTimeForRepetitiveCalibration = statusRecord.Config.DayAndTimeForRepetitiveCalibration.AddDays(7); - _hasRepetitiveCalibrationChargeChecked = false; + _hasRepetitiveCalibrationChargeChecked = false; } } + return mustDoCalibrationCharge; } private static Boolean RepetitiveCalibrationDateHasBeenPassed(DateTime calibrationChargeDate) { - // if (!_hasRepetitiveCalibrationChargeChecked) - // { - // if (DateTime.Now >= calibrationChargeDate ) - // { - // _hasRepetitiveCalibrationChargeChecked = true; - // return true; - // } - // return false; - // } - // return true; - - if (DateTime.Now >= calibrationChargeDate ) { _hasRepetitiveCalibrationChargeChecked = true; return true; } return false; - - - - } private static Boolean AdditionalCalibrationDateHasBeenPassed(DateTime calibrationChargeDate) { - // if (!_hasAdditionalCalibrationChargeChecked) - // { - if (DateTime.Now >= calibrationChargeDate ) - { - //_hasAdditionalCalibrationChargeChecked = true; - return true; - } - return false; - // } - // return true; - + if (DateTime.Now >= calibrationChargeDate ) + { + return true; + } + return false; } private static Double ControlGridPower(this StatusRecord status, Double targetPower) diff --git a/csharp/App/SchneiderMeterDriver/Config.cs b/csharp/App/SchneiderMeterDriver/Config.cs index acd131635..2fff75b4e 100644 --- a/csharp/App/SchneiderMeterDriver/Config.cs +++ b/csharp/App/SchneiderMeterDriver/Config.cs @@ -8,8 +8,8 @@ public static class Config public const String Version = "1.0"; public const String BusName = "com.victronenergy.grid.Schneider"; public const Byte ModbusNodeId = 1; - public const String OwnAddress = "192.168.1.246"; - public const String PeerAddress = "192.168.1.82"; + public const String OwnAddress = "192.168.3.147"; + public const String PeerAddress = "192.168.3.63"; //public const String PeerAddress = "127.0.0.1"; public const UInt16 PeerPort = 502; diff --git a/csharp/App/SchneiderMeterDriver/deploy.sh b/csharp/App/SchneiderMeterDriver/deploy.sh index d1cb2cfbc..37356e5f8 100755 --- a/csharp/App/SchneiderMeterDriver/deploy.sh +++ b/csharp/App/SchneiderMeterDriver/deploy.sh @@ -49,7 +49,7 @@ chmod +x /opt/innovenergy/SchneiderMeterDriver/service/log/run # Create the symbolic link for the service ln -sf /opt/innovenergy/SchneiderMeterDriver/service /service/SchneiderMeterDriver -# Wait a bit for the symlink to be recongnized +# Wait a bit for the symlink to be recognized sleep 2 diff --git a/csharp/App/SaliMax/src/Ess/ControlRecord.cs b/csharp/App/Sofar/src/Ess/ControlRecord.cs similarity index 100% rename from csharp/App/SaliMax/src/Ess/ControlRecord.cs rename to csharp/App/Sofar/src/Ess/ControlRecord.cs diff --git a/csharp/Lib/Devices/Battery250UP/Battery250UPRecord.Modbus.cs b/csharp/Lib/Devices/Battery250UP/Battery250UPRecord.Modbus.cs index 774aad885..805da1c68 100644 --- a/csharp/Lib/Devices/Battery250UP/Battery250UPRecord.Modbus.cs +++ b/csharp/Lib/Devices/Battery250UP/Battery250UPRecord.Modbus.cs @@ -14,41 +14,7 @@ public partial class Battery250UpRecord { [InputRegister(1004)] private UInt16 _LedStates; [InputRegister(1005)] private UInt64 _WarningFlags; - - - - - - //mine - [InputRegister(1006)] private UInt64 _WarningFlags16to31; - [InputRegister(1007)] private UInt64 _WarningFlags32to47; - [InputRegister(1008)] private UInt64 _WarningFlags48to63; - - - - - - [InputRegister(1009)] private UInt64 _AlarmFlags; - - - - - - //mine - - [InputRegister(1010)] private UInt64 _AlarmFlags16to31; - [InputRegister(1011)] private UInt64 _AlarmFlags32to47; - [InputRegister(1012)] private UInt64 _AlarmFlags48to63; - - - - - - - - - [InputRegister(1013)] private UInt16 _IoStates; [InputRegister(999, Scale = 0.01)] private Double _CellsVoltage; diff --git a/csharp/Lib/Devices/Battery250UP/Doc/FZSONICK UP_Protocol_Manual - solar_application_rev00_June2024.pdf b/csharp/Lib/Devices/Battery250UP/Doc/FZSONICK UP_Protocol_Manual - solar_application_rev00_June2024.pdf new file mode 100644 index 000000000..c4896c72c Binary files /dev/null and b/csharp/Lib/Devices/Battery250UP/Doc/FZSONICK UP_Protocol_Manual - solar_application_rev00_June2024.pdf differ diff --git a/csharp/Lib/Devices/Battery250UP/Doc/I&O - UP Range HV - May 2024.pdf b/csharp/Lib/Devices/Battery250UP/Doc/I&O - UP Range HV - May 2024.pdf new file mode 100644 index 000000000..28e45d407 Binary files /dev/null and b/csharp/Lib/Devices/Battery250UP/Doc/I&O - UP Range HV - May 2024.pdf differ