From 09bd11740f2a84ac69522812ae8fbcae73cb00f7 Mon Sep 17 00:00:00 2001 From: atef Date: Wed, 12 Nov 2025 16:08:40 +0100 Subject: [PATCH] Update SinexcelRecord modbus with new registers reading and writing --- .../Sinexcel 12K TL/SinexcelRecord.Modbus.cs | 43 ++++++++++++++++++- 1 file changed, 41 insertions(+), 2 deletions(-) diff --git a/csharp/Sinexcel 12K TL/SinexcelRecord.Modbus.cs b/csharp/Sinexcel 12K TL/SinexcelRecord.Modbus.cs index 2fe68ae1d..09f952c25 100644 --- a/csharp/Sinexcel 12K TL/SinexcelRecord.Modbus.cs +++ b/csharp/Sinexcel 12K TL/SinexcelRecord.Modbus.cs @@ -287,8 +287,7 @@ public partial class SinexcelRecord [HoldingRegister(15428, writable: true)] private UInt32 _powerOff; // 0x3C44 [HoldingRegister(15430, writable: true)] private UInt32 _faultClearing; // 0x3C46 [HoldingRegister(15518, writable: true)] private UInt32 _meterReverseManualDetection; // 0x3C9E - [HoldingRegister(15520, writable: true)] private UInt32 _batteryVoltage; // 0x3CA0 - [HoldingRegister(15522, writable: true)] private UInt32 _batteryRating; // 0x3CA2 + [HoldingRegister(15520, writable: true)] private UInt32 _batteryVoltageRating; // 0x3CA0 [HoldingRegister(15524, writable: true)] private UInt32 _battery1Activation; // 0x3CA4 [HoldingRegister(15526, writable: true)] private UInt32 _battery2Activation; // 0x3CA6 @@ -309,5 +308,45 @@ public partial class SinexcelRecord [HoldingRegister(41234)] private UInt32 _electricMeterAPhaseActivePower; // 0xA112 [HoldingRegister(41236)] private UInt32 _electricMeterBPhaseActivePower; // 0xA114 [HoldingRegister(41238)] private UInt32 _electricMeterCPhaseActivePower; // 0xA116 + /* + // ─────────────────────────────────────────────── + // Battery Cabinet 1 — Energy / Pack measurements (read-only) + // ─────────────────────────────────────────────── + [HoldingRegister(45308)] private UInt32 _batteryCab1TotalChargingEnergy; // 0xB0FC kW·h + [HoldingRegister(45310)] private UInt32 _batteryCab1TotalDischargedEnergy; // 0xB0FE kW·h + [HoldingRegister(45312)] private UInt32 _batteryCab1PackTotalVoltage; // 0xB100 (resolution 0.01 V) + [HoldingRegister(45314)] private UInt32 _batteryCab1PackTotalCurrent; // 0xB102 (resolution 0.01 A) + [HoldingRegister(45316)] private UInt32 _batteryCab1Temperature; // 0xB104 (resolution 0.01 °C) + [HoldingRegister(45318)] private UInt32 _batteryCab1Soc; // 0xB106 % + [HoldingRegister(45320)] private UInt32 _batteryCab1Soh; // 0xB108 % + + // ─────────────────────────────────────────────── + // Battery Cabinet 2 — Energy / Pack Measurements (Read-Only) + // ─────────────────────────────────────────────── + [HoldingRegister(45564)] private UInt32 _batteryCab2TotalChargingEnergy; // 0xB1FC kW·h + [HoldingRegister(45566)] private UInt32 _batteryCab2TotalDischargedEnergy; // 0xB1FE kW·h + + [HoldingRegister(45568)] private UInt32 _batteryCab2PackTotalVoltage; // 0xB200 (0.01 V) + [HoldingRegister(45570)] private UInt32 _batteryCab2PackTotalCurrent; // 0xB202 (0.01 A) + [HoldingRegister(45572)] private UInt32 _batteryCab2Temperature; // 0xB204 (0.01 °C) + [HoldingRegister(45574)] private UInt32 _batteryCab2Soc; // 0xB206 % + [HoldingRegister(45576)] private UInt32 _batteryCab2Soh; // 0xB208 % + + // ─────────────────────────────────────────────── + // Time-based scheduling (period 1) configuration + // ─────────────────────────────────────────────── + [HoldingRegister(49332, writable: true)] private UInt32 _repetitiveWeeks; // 0xC0B4, bit flags Sun–Sat + [HoldingRegister(49334, writable: true)] private UInt32 _effectiveStartDate; // 0xC0B6, UNIX timestamp (UTC+offset) + [HoldingRegister(49336, writable: true)] private UInt32 _effectiveEndDate; // 0xC0B8, UNIX timestamp (UTC+offset) + [HoldingRegister(49338, writable: true)] private UInt32 _chargingPowerPeriod1; // 0xC0BA, float [0–50] kW, default 5 + + // ─────────────────────────────────────────────── + // Time-based charge/discharge schedule period 1 + // ─────────────────────────────────────────────── + [HoldingRegister(49172, writable: true)] private UInt32 _chargeStartTimePeriod1; // 0xC014 [0-2359] (start) + [HoldingRegister(49174, writable: true)] private UInt32 _chargeEndTimePeriod1; // 0xC016 [0-2359] (end) + [HoldingRegister(49176, writable: true)] private UInt32 _dischargeStartTimePeriod1; // 0xC018 [0-2359] (start) + [HoldingRegister(49178, writable: true)] private UInt32 _dischargeEndTimePeriod1; // 0xC01A [0-2359] (end) +*/ } \ No newline at end of file