Correct Sinexcel grid power sign and fix the numbering of few wrong register

This commit is contained in:
atef 2026-04-10 15:24:33 +02:00
parent f8b9a4d595
commit 51b8dada6c
2 changed files with 18 additions and 16 deletions

View File

@ -195,6 +195,8 @@ public partial class SinexcelRecord
private readonly Int16 _factorFromKwtoW = 1000;
private readonly Int16 _correctingSign = -1;
// ───────────────────────────────────────────────
// Public API — Decoded Float Values
// ───────────────────────────────────────────────
@ -375,7 +377,7 @@ public partial class SinexcelRecord
public ActivePower TotalPhotovoltaicPower => ConvertBitPatternToFloat(_totalPhotovoltaicPower) * _factorFromKwtoW;
public ActivePower TotalBatteryPower => ConvertBitPatternToFloat(_totalBatteryPower) * _factorFromKwtoW;
public ActivePower TotalLoadPower => ConvertBitPatternToFloat(_totalLoadPower) * _factorFromKwtoW ;
public ActivePower TotalGridPower => ConvertBitPatternToFloat(_totalGridPower) * _factorFromKwtoW ;
public ActivePower TotalGridPower => ConvertBitPatternToFloat(_totalGridPower) * _factorFromKwtoW * _correctingSign ; // we correct sign
public ActivePower ImportantLoadTotalPower => ConvertBitPatternToFloat(_importantLoadTotalPower)* _factorFromKwtoW;
public ActivePower GeneralLoadTotalPower => ConvertBitPatternToFloat(_generalLoadTotalPower)* _factorFromKwtoW;
public Voltage PvVoltage3 => ConvertBitPatternToFloat(_pv3Voltage);
@ -663,7 +665,7 @@ public partial class SinexcelRecord
// ───────────────────────────────────────────────
// Parallel / System Settings
// ───────────────────────────────────────────────
public SinexcelMachineMode MachineMode
/* public SinexcelMachineMode MachineMode
{
get => (SinexcelMachineMode)ConvertBitPatternToFloat(_singleOrParallelMachine);
set => _singleOrParallelMachine = (UInt32)value;
@ -686,7 +688,7 @@ public partial class SinexcelRecord
get => (AccreditedCountry)(Int32)BitConverter.Int32BitsToSingle(unchecked((Int32)_accreditedCountries));
set => _accreditedCountries = BitConverter.ToUInt32(BitConverter.GetBytes((Single)value), 0);
}
*/
// ───────────────────────────────────────────────
// Control Commands
// ───────────────────────────────────────────────

View File

@ -440,24 +440,24 @@ public partial class SinexcelRecord
[HoldingRegister<UInt32>(12384, writable: true)] private UInt32 _outputVoltageAdjustmentFactor; // 0x3060
[HoldingRegister<UInt32>(12386, writable: true)] private UInt32 _setValueBatteryUndervoltage1; // 0x3062
[HoldingRegister<UInt32>(12388, writable: true)] private UInt32 _inverterPowerLimit; // 0x3064
[HoldingRegister<UInt32>(12400, writable: true)] private UInt32 _battery2Capacity; // 0x30B0
[HoldingRegister<UInt32>(12402, writable: true)] private UInt32 _maxChargingCurrentBattery2; // 0x30B2
[HoldingRegister<UInt32>(12404, writable: true)] private UInt32 _maxDischargingCurrentBattery2; // 0x30B4
[HoldingRegister<UInt32>(12406, writable: true)] private UInt32 _battery2RatedVoltage; // 0x30B6
[HoldingRegister<UInt32>(12408, writable: true)] private UInt32 _battery2MinSoc; // 0x30B8
[HoldingRegister<UInt32>(12410, writable: true)] private UInt32 _battery2OverVoltageSetting; // 0x30BA
[HoldingRegister<UInt32>(12412, writable: true)] private UInt32 _battery2UnderVoltageSetpoint; // 0x30BC
[HoldingRegister<UInt32>(12464, writable: true)] private UInt32 _battery2Capacity; // 0x30B0
[HoldingRegister<UInt32>(12466, writable: true)] private UInt32 _maxChargingCurrentBattery2; // 0x30B2
[HoldingRegister<UInt32>(12468, writable: true)] private UInt32 _maxDischargingCurrentBattery2; // 0x30B4
[HoldingRegister<UInt32>(12470, writable: true)] private UInt32 _battery2RatedVoltage; // 0x30B6
[HoldingRegister<UInt32>(12472, writable: true)] private UInt32 _battery2MinSoc; // 0x30B8
[HoldingRegister<UInt32>(12474, writable: true)] private UInt32 _battery2OverVoltageSetting; // 0x30BA
[HoldingRegister<UInt32>(12476, writable: true)] private UInt32 _battery2UnderVoltageSetpoint; // 0x30BC
//
[HoldingRegister<UInt32>(12414, writable: true)] private UInt32 _singleOrParallelMachine; // 0x30BE
[HoldingRegister<UInt32>(12416, writable: true)] private UInt32 _numberOfSystemModules; // 0x30C0
[HoldingRegister<UInt32>(12418, writable: true)] private UInt32 _parallelModuleMachineNumber; // 0x30C2
[HoldingRegister<UInt32>(12420, writable: true)] private UInt32 _accreditedCountries; // 0x30C4
/* [HoldingRegister<UInt32>(12478, writable: true)] private UInt32 _singleOrParallelMachine; // 0x30BE // to be verified, writing not allowed
[HoldingRegister<UInt32>(12480, writable: true)] private UInt32 _numberOfSystemModules; // 0x30C0 // to be verified, writing not allowed
[HoldingRegister<UInt32>(12482, writable: true)] private UInt32 _parallelModuleMachineNumber; // 0x30C2 // to be verified, writing not allowed
[HoldingRegister<UInt32>(12484, writable: true)] private UInt32 _accreditedCountries; */ // 0x30C4 // to be verified, writing not allowed
[HoldingRegister<UInt32>(12618, writable: true)] private UInt32 _battery1BackupSOC; // 0x314A
[HoldingRegister<UInt32>(12620, writable: true)] private UInt32 _battery2BackupSOC; // 0x314C
[HoldingRegister<UInt32>(12746, writable: true)] private UInt32 _enableGridExport; // 0x314A
[HoldingRegister<UInt32>(12748, writable: true)] private UInt32 _powerGridExportLimit; // 0x314C
[HoldingRegister<UInt32>(12746, writable: true)] private UInt32 _enableGridExport; // 0x31CA
[HoldingRegister<UInt32>(12748, writable: true)] private UInt32 _powerGridExportLimit; // 0x31CC
// ───────────────────────────────────────────────