Add alarm and error sinexcel

This commit is contained in:
atef 2026-02-13 09:40:37 +01:00
parent 3b32b8a6dc
commit bc130ea99c
2 changed files with 727 additions and 353 deletions

View File

@ -7,6 +7,192 @@ namespace InnovEnergy.Lib.Devices.Sinexcel_12K_TL;
public partial class SinexcelRecord public partial class SinexcelRecord
{ {
/*
// --------------------------------------------------------
// Helpers
// --------------------------------------------------------
private static ushort Bit(ushort v) => (ushort)(v & 0x01);
private static ushort Compose3(ushort b0, ushort b1, ushort b2)
=> (ushort)(Bit(b0) | (Bit(b1) << 1) | (Bit(b2) << 2));
private static ushort Compose4(ushort b0, ushort b1, ushort b2, ushort b3)
=> (ushort)(Bit(b0) | (Bit(b1) << 1) | (Bit(b2) << 2) | (Bit(b3) << 3));
// ---- Operating states
public SinexcelInverterOperatingState InverterOperatingState
=> (SinexcelInverterOperatingState)(_inverterOperatingState & 0x07);
public SinexcelPvOperatingState Pv1OperatingState
=> (SinexcelPvOperatingState)Bit(_pv1OperatingState);
public SinexcelPvOperatingState Pv2OperatingState
=> (SinexcelPvOperatingState)Bit(_pv2OperatingState);
public SinexcelPvOperatingState Pv3OperatingState
=> (SinexcelPvOperatingState)Bit(_pv3OperatingState);
public SinexcelPvOperatingState Pv4OperatingState
=> (SinexcelPvOperatingState)Bit(_pv4OperatingState);
public SinexcelBatteryOperatingState Battery1OperatingState
=> (SinexcelBatteryOperatingState)(_battery1OperatingState & 0x07);
public SinexcelBatteryOperatingState Battery2OperatingState
=> (SinexcelBatteryOperatingState)Compose3(_bat2StateBit0, _bat2StateBit1, _bat2StateBit2);
public SinexcelOredState OredState
=> (SinexcelOredState)Compose4(_oredStateBit0, _oredStateBit1, _oredStateBit2, _oredStateBit3);
public SinexcelDcdcState DcdcStateDc
=> (SinexcelDcdcState)Bit(_dcdcStateDc);
public SinexcelDcdcState DcdcStateAc
=> (SinexcelDcdcState)Bit(_dcdcStateAc);
public SinexcelPowerGridStatus PowerGridStatus
=> (SinexcelPowerGridStatus)Bit(_powerGridStatus);
// ---- Alarm / fault flags
public SinexcelAbnormalFlag AbnormalGridVoltage => (SinexcelAbnormalFlag)Bit(_abnormalGridVoltage);
public SinexcelAbnormalFlag AbnormalGridFrequency => (SinexcelAbnormalFlag)Bit(_abnormalGridFrequency);
public SinexcelAbnormalFlag InvertedSequenceOfGridVoltage => (SinexcelAbnormalFlag)Bit(_invertedSequenceOfGridVoltage);
public SinexcelAbnormalFlag GridVoltagePhaseLoss => (SinexcelAbnormalFlag)Bit(_gridVoltagePhaseLoss);
public SinexcelAbnormalFlag AbnormalOutputVoltage => (SinexcelAbnormalFlag)Bit(_abnormalOutputVoltage);
public SinexcelAbnormalFlag AbnormalOutputFrequency => (SinexcelAbnormalFlag)Bit(_abnormalOutputFrequency);
public SinexcelAbnormalFlag AbnormalNullLine => (SinexcelAbnormalFlag)Bit(_abnormalNullLine);
public SinexcelAbnormalFlag ExcessivelyHighAmbientTemperature => (SinexcelAbnormalFlag)Bit(_excessivelyHighAmbientTemperature);
public SinexcelAbnormalFlag ExcessiveRadiatorTemperature => (SinexcelAbnormalFlag)Bit(_excessiveRadiatorTemperature);
public SinexcelAbnormalFlag InsulationFault => (SinexcelAbnormalFlag)Bit(_insulationFault);
public SinexcelAbnormalFlag LeakageProtectionFault => (SinexcelAbnormalFlag)Bit(_leakageProtectionFault);
public SinexcelAbnormalFlag AuxiliaryPowerFault => (SinexcelAbnormalFlag)Bit(_auxiliaryPowerFault);
public SinexcelAbnormalFlag FanFault => (SinexcelAbnormalFlag)Bit(_fanFault);
public SinexcelAbnormalFlag ModelCapacityFault => (SinexcelAbnormalFlag)Bit(_modelCapacityFault);
public SinexcelAbnormalFlag AbnormalLightningArrester => (SinexcelAbnormalFlag)Bit(_abnormalLightningArrester);
public SinexcelAbnormalFlag IslandProtection => (SinexcelAbnormalFlag)Bit(_islandProtection);
public SinexcelAbnormalFlag Battery1NotConnected => (SinexcelAbnormalFlag)Bit(_battery1NotConnected);
public SinexcelAbnormalFlag Battery1Overvoltage => (SinexcelAbnormalFlag)Bit(_battery1Overvoltage);
public SinexcelAbnormalFlag Battery1Undervoltage => (SinexcelAbnormalFlag)Bit(_battery1Undervoltage);
public SinexcelAbnormalFlag Battery1DischargeEnd => (SinexcelAbnormalFlag)Bit(_battery1DischargeEnd);
public SinexcelAbnormalFlag Battery1Inverted => (SinexcelAbnormalFlag)Bit(_battery1Inverted);
public SinexcelAbnormalFlag Battery2NotConnected => (SinexcelAbnormalFlag)Bit(_battery2NotConnected);
public SinexcelAbnormalFlag Battery2Overvoltage => (SinexcelAbnormalFlag)Bit(_battery2Overvoltage);
public SinexcelAbnormalFlag Battery2Undervoltage => (SinexcelAbnormalFlag)Bit(_battery2Undervoltage);
public SinexcelAbnormalFlag Battery2DischargeEnd => (SinexcelAbnormalFlag)Bit(_battery2DischargeEnd);
public SinexcelAbnormalFlag Battery2Inverted => (SinexcelAbnormalFlag)Bit(_battery2Inverted);
public SinexcelAbnormalFlag Pv1NotAccessed => (SinexcelAbnormalFlag)Bit(_pv1NotAccessed);
public SinexcelAbnormalFlag Pv1Overvoltage => (SinexcelAbnormalFlag)Bit(_pv1Overvoltage);
public SinexcelAbnormalFlag AbnormalPv1CurrentSharing => (SinexcelAbnormalFlag)Bit(_abnormalPv1CurrentSharing);
public SinexcelAbnormalFlag Pv2NotAccessed => (SinexcelAbnormalFlag)Bit(_pv2NotAccessed);
public SinexcelAbnormalFlag Pv2Overvoltage => (SinexcelAbnormalFlag)Bit(_pv2Overvoltage);
public SinexcelAbnormalFlag AbnormalPv2CurrentSharing => (SinexcelAbnormalFlag)Bit(_abnormalPv2CurrentSharing);
public SinexcelAbnormalFlag DcBusOvervoltage => (SinexcelAbnormalFlag)Bit(_dcBusOvervoltage);
public SinexcelAbnormalFlag DcBusUndervoltage => (SinexcelAbnormalFlag)Bit(_dcBusUndervoltage);
public SinexcelAbnormalFlag DcBusVoltageUnbalance => (SinexcelAbnormalFlag)Bit(_dcBusVoltageUnbalance);
public SinexcelAbnormalFlag Pv1PowerTubeFault => (SinexcelAbnormalFlag)Bit(_pv1PowerTubeFault);
public SinexcelAbnormalFlag Pv2PowerTubeFault => (SinexcelAbnormalFlag)Bit(_pv2PowerTubeFault);
public SinexcelAbnormalFlag Battery1PowerTubeFault => (SinexcelAbnormalFlag)Bit(_battery1PowerTubeFault);
public SinexcelAbnormalFlag Battery2PowerTubeFault => (SinexcelAbnormalFlag)Bit(_battery2PowerTubeFault);
public SinexcelAbnormalFlag InverterPowerTubeFault => (SinexcelAbnormalFlag)Bit(_inverterPowerTubeFault);
public SinexcelAbnormalFlag SystemOutputOverload => (SinexcelAbnormalFlag)Bit(_systemOutputOverload);
public SinexcelAbnormalFlag InverterOverload => (SinexcelAbnormalFlag)Bit(_inverterOverload);
public SinexcelAbnormalFlag InverterOverloadTimeout => (SinexcelAbnormalFlag)Bit(_inverterOverloadTimeout);
public SinexcelAbnormalFlag Battery1OverloadTimeout => (SinexcelAbnormalFlag)Bit(_battery1OverloadTimeout);
public SinexcelAbnormalFlag Battery2OverloadTimeout => (SinexcelAbnormalFlag)Bit(_battery2OverloadTimeout);
public SinexcelAbnormalFlag InverterSoftStartFailure => (SinexcelAbnormalFlag)Bit(_inverterSoftStartFailure);
public SinexcelAbnormalFlag Battery1SoftStartFailure => (SinexcelAbnormalFlag)Bit(_battery1SoftStartFailure);
public SinexcelAbnormalFlag Battery2SoftStartFailure => (SinexcelAbnormalFlag)Bit(_battery2SoftStartFailure);
public SinexcelAbnormalFlag Dsp1ParameterSettingFault => (SinexcelAbnormalFlag)Bit(_dsp1ParameterSettingFault);
public SinexcelAbnormalFlag Dsp2ParameterSettingFault => (SinexcelAbnormalFlag)Bit(_dsp2ParameterSettingFault);
public SinexcelAbnormalFlag DspVersionCompatibilityFault => (SinexcelAbnormalFlag)Bit(_dspVersionCompatibilityFault);
public SinexcelAbnormalFlag CpldVersionCompatibilityFault => (SinexcelAbnormalFlag)Bit(_cpldVersionCompatibilityFault);
public SinexcelAbnormalFlag CpldCommunicationFault => (SinexcelAbnormalFlag)Bit(_cpldCommunicationFault);
public SinexcelAbnormalFlag DspCommunicationFault => (SinexcelAbnormalFlag)Bit(_dspCommunicationFault);
public SinexcelAbnormalFlag OutputVoltageDcOverlimit => (SinexcelAbnormalFlag)Bit(_outputVoltageDcOverlimit);
public SinexcelAbnormalFlag OutputCurrentDcOverlimit => (SinexcelAbnormalFlag)Bit(_outputCurrentDcOverlimit);
public SinexcelAbnormalFlag RelaySelfCheckFails => (SinexcelAbnormalFlag)Bit(_relaySelfCheckFails);
public SinexcelAbnormalFlag AbnormalInverter => (SinexcelAbnormalFlag)Bit(_abnormalInverter);
public SinexcelAbnormalFlag PoorGrounding => (SinexcelAbnormalFlag)Bit(_poorGrounding);
public SinexcelAbnormalFlag Pv1SoftStartFailure => (SinexcelAbnormalFlag)Bit(_pv1SoftStartFailure);
public SinexcelAbnormalFlag Pv2SoftStartFailure => (SinexcelAbnormalFlag)Bit(_pv2SoftStartFailure2);
public SinexcelAbnormalFlag BalancedCircuitOverloadTimeout => (SinexcelAbnormalFlag)Bit(_balancedCircuitOverloadTimeout);
public SinexcelAbnormalFlag Pv1OverloadTimeout => (SinexcelAbnormalFlag)Bit(_pv1OverloadTimeout);
public SinexcelAbnormalFlag Pv2OverloadTimeout => (SinexcelAbnormalFlag)Bit(_pv2OverloadTimeout);
public SinexcelAbnormalFlag PcbOvertemperature => (SinexcelAbnormalFlag)Bit(_pcbOvertemperature);
public SinexcelAbnormalFlag DcConverterOvertemperature => (SinexcelAbnormalFlag)Bit(_dcConverterOvertemperature);
public SinexcelAbnormalFlag BusSlowOvervoltage => (SinexcelAbnormalFlag)Bit(_busSlowOvervoltage);
public SinexcelAbnormalFlag AbnormalOffGridOutputVoltage => (SinexcelAbnormalFlag)Bit(_abnormalOffGridOutputVoltage);
public SinexcelAbnormalFlag HardwareBusOvervoltage => (SinexcelAbnormalFlag)Bit(_hardwareBusOvervoltage);
public SinexcelAbnormalFlag HardwareOvercurrent => (SinexcelAbnormalFlag)Bit(_hardwareOvercurrent);
public SinexcelAbnormalFlag DcConverterOvervoltage => (SinexcelAbnormalFlag)Bit(_dcConverterOvervoltage);
public SinexcelAbnormalFlag DcConverterHardwareOvervoltage => (SinexcelAbnormalFlag)Bit(_dcConverterHardwareOvervoltage);
public SinexcelAbnormalFlag DcConverterOvercurrent => (SinexcelAbnormalFlag)Bit(_dcConverterOvercurrent);
public SinexcelAbnormalFlag DcConverterHardwareOvercurrent => (SinexcelAbnormalFlag)Bit(_dcConverterHardwareOvercurrent);
public SinexcelAbnormalFlag DcConverterResonatorOvercurrent => (SinexcelAbnormalFlag)Bit(_dcConverterResonatorOvercurrent);
public SinexcelAbnormalFlag Pv1InsufficientPower => (SinexcelAbnormalFlag)Bit(_pv1InsufficientPower);
public SinexcelAbnormalFlag Pv2InsufficientPower => (SinexcelAbnormalFlag)Bit(_pv2InsufficientPower);
public SinexcelAbnormalFlag Battery1InsufficientPower => (SinexcelAbnormalFlag)Bit(_battery1InsufficientPower);
public SinexcelAbnormalFlag Battery2InsufficientPower => (SinexcelAbnormalFlag)Bit(_battery2InsufficientPower);
public SinexcelAbnormalFlag LithiumBattery1ChargeForbidden => (SinexcelAbnormalFlag)Bit(_lithiumBattery1ChargeForbidden);
public SinexcelAbnormalFlag LithiumBattery1DischargeForbidden => (SinexcelAbnormalFlag)Bit(_lithiumBattery1DischargeForbidden);
public SinexcelAbnormalFlag LithiumBattery2ChargeForbidden => (SinexcelAbnormalFlag)Bit(_lithiumBattery2ChargeForbidden);
public SinexcelAbnormalFlag LithiumBattery2DischargeForbidden => (SinexcelAbnormalFlag)Bit(_lithiumBattery2DischargeForbidden);
public SinexcelAbnormalFlag LithiumBattery1Full => (SinexcelAbnormalFlag)Bit(_lithiumBattery1Full);
public SinexcelAbnormalFlag LithiumBattery1DischargeEnd => (SinexcelAbnormalFlag)Bit(_lithiumBattery1DischargeEnd);
public SinexcelAbnormalFlag LithiumBattery2Full => (SinexcelAbnormalFlag)Bit(_lithiumBattery2Full);
public SinexcelAbnormalFlag LithiumBattery2DischargeEnd => (SinexcelAbnormalFlag)Bit(_lithiumBattery2DischargeEnd);
public SinexcelAbnormalFlag LoadPowerOverload => (SinexcelAbnormalFlag)Bit(_loadPowerOverload);
public SinexcelAbnormalFlag AbnormalLeakageSelfCheck => (SinexcelAbnormalFlag)Bit(_abnormalLeakageSelfCheck);
public SinexcelAbnormalFlag InverterOvertemperatureAlarm => (SinexcelAbnormalFlag)Bit(_inverterOvertemperatureAlarm);
public SinexcelAbnormalFlag InverterOvertemperature => (SinexcelAbnormalFlag)Bit(_inverterOvertemperature);
public SinexcelAbnormalFlag DcConverterOvertemperatureAlarm => (SinexcelAbnormalFlag)Bit(_dcConverterOvertemperatureAlarm);
public SinexcelAbnormalFlag ParallelCommunicationAlarm => (SinexcelAbnormalFlag)Bit(_parallelCommunicationAlarm);
public SinexcelAbnormalFlag SystemDerating => (SinexcelAbnormalFlag)Bit(_systemDerating);
public SinexcelAbnormalFlag InverterRelayOpen => (SinexcelAbnormalFlag)Bit(_inverterRelayOpen);
public SinexcelAbnormalFlag InverterRelayShortCircuit => (SinexcelAbnormalFlag)Bit(_inverterRelayShortCircuit);
public SinexcelAbnormalFlag PvAccessMethodErrorAlarm => (SinexcelAbnormalFlag)Bit(_pvAccessMethodErrorAlarm);
public SinexcelAbnormalFlag ParallelModuleMissing => (SinexcelAbnormalFlag)Bit(_parallelModuleMissing);
public SinexcelAbnormalFlag DuplicateMachineNumbersForParallelModules=> (SinexcelAbnormalFlag)Bit(_duplicateMachineNumbersForParallelModules);
public SinexcelAbnormalFlag ParameterConflictInParallelModule => (SinexcelAbnormalFlag)Bit(_parameterConflictInParallelModule);
public SinexcelAbnormalFlag ReservedAlarms4 => (SinexcelAbnormalFlag)Bit(_reservedAlarms4);
public SinexcelAbnormalFlag ReverseMeterConnection => (SinexcelAbnormalFlag)Bit(_reverseMeterConnection);
public SinexcelAbnormalFlag InverterSealPulse => (SinexcelAbnormalFlag)Bit(_inverterSealPulse);
public SinexcelAbnormalFlag Pv3NotConnected => (SinexcelAbnormalFlag)Bit(_pv3NotConnected);
public SinexcelAbnormalFlag Pv3Overvoltage => (SinexcelAbnormalFlag)Bit(_pv3Overvoltage);
public SinexcelAbnormalFlag Pv3AverageCurrentAnomaly => (SinexcelAbnormalFlag)Bit(_pv3AverageCurrentAnomaly);
public SinexcelAbnormalFlag Pv4NotConnected => (SinexcelAbnormalFlag)Bit(_pv4NotConnected);
public SinexcelAbnormalFlag Pv4Overvoltage => (SinexcelAbnormalFlag)Bit(_pv4Overvoltage);
public SinexcelAbnormalFlag Pv4AverageCurrentAnomaly => (SinexcelAbnormalFlag)Bit(_pv4AverageCurrentAnomaly);
public SinexcelAbnormalFlag Pv3PowerTubeFailure => (SinexcelAbnormalFlag)Bit(_pv3PowerTubeFailure);
public SinexcelAbnormalFlag Pv4PowerTubeFailure => (SinexcelAbnormalFlag)Bit(_pv4PowerTubeFailure);
public SinexcelAbnormalFlag Pv3SoftStartFailure => (SinexcelAbnormalFlag)Bit(_pv3SoftStartFailure);
public SinexcelAbnormalFlag Pv4SoftStartFailure => (SinexcelAbnormalFlag)Bit(_pv4SoftStartFailure);
public SinexcelAbnormalFlag Pv3OverloadTimeout => (SinexcelAbnormalFlag)Bit(_pv3OverloadTimeout);
public SinexcelAbnormalFlag Pv4OverloadTimeout => (SinexcelAbnormalFlag)Bit(_pv4OverloadTimeout);
public SinexcelAbnormalFlag Pv3ReverseConnection => (SinexcelAbnormalFlag)Bit(_pv3ReverseConnection);
public SinexcelAbnormalFlag Pv4ReverseConnection => (SinexcelAbnormalFlag)Bit(_pv4ReverseConnection);
public SinexcelAbnormalFlag AbnormalDieselGeneratorVoltage => (SinexcelAbnormalFlag)Bit(_abnormalDieselGeneratorVoltage);
public SinexcelAbnormalFlag AbnormalDieselGeneratorFrequency => (SinexcelAbnormalFlag)Bit(_abnormalDieselGeneratorFrequency);
public SinexcelAbnormalFlag DieselGeneratorVoltageReverseSequence => (SinexcelAbnormalFlag)Bit(_dieselGeneratorVoltageReverseSequence);
public SinexcelAbnormalFlag DieselGeneratorVoltageOutOfPhase => (SinexcelAbnormalFlag)Bit(_dieselGeneratorVoltageOutOfPhase);
public SinexcelAbnormalFlag LeadBatteryTemperatureAbnormality => (SinexcelAbnormalFlag)Bit(_leadBatteryTemperatureAbnormality);
public SinexcelAbnormalFlag BatteryAccessMethodError => (SinexcelAbnormalFlag)Bit(_batteryAccessMethodError);
public SinexcelAbnormalFlag ReservedAlarms5 => (SinexcelAbnormalFlag)Bit(_reservedAlarms5);
public SinexcelAbnormalFlag Battery1BackupProhibited => (SinexcelAbnormalFlag)Bit(_battery1BackupProhibited);
public SinexcelAbnormalFlag Battery2BackupProhibited => (SinexcelAbnormalFlag)Bit(_battery2BackupProhibited);
public SinexcelAbnormalFlag AbnormalGridCurrent => (SinexcelAbnormalFlag)Bit(_abnormalGridCurrent);
public SinexcelAbnormalFlag GeneratorOverload => (SinexcelAbnormalFlag)Bit(_generatorOverload);
public SinexcelAbnormalFlag BusSoftStartFailure => (SinexcelAbnormalFlag)Bit(_busSoftStartFailure);
public SinexcelAbnormalFlag OpenCircuitOfPowerGridRelay => (SinexcelAbnormalFlag)Bit(_openCircuitOfPowerGridRelay);
public SinexcelAbnormalFlag ShortCircuitOfPowerGridRelay => (SinexcelAbnormalFlag)Bit(_shortCircuitOfPowerGridRelay);
public SinexcelAbnormalFlag GeneratorRelayOpenCircuit => (SinexcelAbnormalFlag)Bit(_generatorRelayOpenCircuit);
public SinexcelAbnormalFlag GeneratorRelayShortCircuit => (SinexcelAbnormalFlag)Bit(_generatorRelayShortCircuit);
public SinexcelAbnormalFlag InsufficientPhotovoltaicPower => (SinexcelAbnormalFlag)Bit(_insufficientPhotovoltaicPower);
public SinexcelAbnormalFlag Photovoltaic1Overcurrent => (SinexcelAbnormalFlag)Bit(_photovoltaic1Overcurrent);
*/
private Int16 _factorFromKwtoW = 1000; private Int16 _factorFromKwtoW = 1000;
// ─────────────────────────────────────────────── // ───────────────────────────────────────────────
// Public API — Decoded Float Values // Public API — Decoded Float Values
@ -153,7 +339,7 @@ public partial class SinexcelRecord
public Voltage Battery1Voltage => ConvertBitPatternToFloat(_batteryVoltage1); public Voltage Battery1Voltage => ConvertBitPatternToFloat(_batteryVoltage1);
public Current Battery1Current => ConvertBitPatternToFloat(_batteryCurrent1); public Current Battery1Current => ConvertBitPatternToFloat(_batteryCurrent1);
public ActivePower Battery1Power => ConvertBitPatternToFloat(_batteryPower1) * _factorFromKwtoW; public ActivePower Battery1Power => ConvertBitPatternToFloat(_batteryPower1) * _factorFromKwtoW;
public Percent Battery1Soc => ConvertBitPatternToFloat(_batterySoc1); public Percent Battery1Soc => ConvertBitPatternToFloat(_batterySoc1);
public float BatteryFullLoadDuration1 => ConvertBitPatternToFloat(_batteryFullLoadDuration1); // this is in hour public float BatteryFullLoadDuration1 => ConvertBitPatternToFloat(_batteryFullLoadDuration1); // this is in hour
@ -190,14 +376,15 @@ public partial class SinexcelRecord
public ActivePower TotalGridPower => ConvertBitPatternToFloat(_totalGridPower) * _factorFromKwtoW ; public ActivePower TotalGridPower => ConvertBitPatternToFloat(_totalGridPower) * _factorFromKwtoW ;
public ActivePower ImportantLoadTotalPower => ConvertBitPatternToFloat(_importantLoadTotalPower)* _factorFromKwtoW; public ActivePower ImportantLoadTotalPower => ConvertBitPatternToFloat(_importantLoadTotalPower)* _factorFromKwtoW;
public ActivePower GeneralLoadTotalPower => ConvertBitPatternToFloat(_generalLoadTotalPower)* _factorFromKwtoW; public ActivePower GeneralLoadTotalPower => ConvertBitPatternToFloat(_generalLoadTotalPower)* _factorFromKwtoW;
public Voltage Pv3Voltage => ConvertBitPatternToFloat(_pv3Voltage); public Voltage PvVoltage3 => ConvertBitPatternToFloat(_pv3Voltage);
public Current Pv3Current => ConvertBitPatternToFloat(_pv3Current); public Current PvCurrent3 => ConvertBitPatternToFloat(_pv3Current);
public ActivePower Pv3Power => ConvertBitPatternToFloat(_pv3Power) * _factorFromKwtoW; public ActivePower PvPower3 => ConvertBitPatternToFloat(_pv3Power) * _factorFromKwtoW;
public Voltage Pv4Voltage => ConvertBitPatternToFloat(_pv4Voltage); public Voltage PvVoltage4 => ConvertBitPatternToFloat(_pv4Voltage);
public Current Pv4Current => ConvertBitPatternToFloat(_pv4Current); public Current PvCurrent4 => ConvertBitPatternToFloat(_pv4Current);
public ActivePower Pv4Power => ConvertBitPatternToFloat(_pv4Power) * _factorFromKwtoW; public ActivePower PvPower4 => ConvertBitPatternToFloat(_pv4Power) * _factorFromKwtoW;
public ActivePower GeneratorTotalPower => ConvertBitPatternToFloat(_generatorTotalPower); public ActivePower GeneratorTotalPower => ConvertBitPatternToFloat(_generatorTotalPower);
public ActivePower PvTotalPower => PvPower1 + PvPower2 + PvPower3 + PvPower4;
// ─────────────────────────────────────────────── // ───────────────────────────────────────────────
// Manufacturer Information & Software Versions // Manufacturer Information & Software Versions
// ─────────────────────────────────────────────── // ───────────────────────────────────────────────
@ -215,269 +402,292 @@ public partial class SinexcelRecord
public ApparentPower RatedPowerKva => _ratedPower / 100f; // 0x2008 (value / 100) public ApparentPower RatedPowerKva => _ratedPower / 100f; // 0x2008 (value / 100)
public SinexcelModel Model => (SinexcelModel)_model; // 0x200D public SinexcelModel Model => (SinexcelModel)_model; // 0x200D
//public ThreePhaseWireSystem ThreePhaseWireSystem public ThreePhaseWireSystem ThreePhaseWireSystem
//{ {
// get => (ThreePhaseWireSystem)_threePhaseWireSystem; get => (ThreePhaseWireSystem)_threePhaseWireSystem;
// //set => _threePhaseWireSystem = (UInt32)value; set => _threePhaseWireSystem = (UInt32)value;
//} }
// //
//public InputFrequency InputFrequencyClass public InputFrequency InputFrequencyClass
//{ {
// get => (InputFrequency)_inputFrequencyClass; get => (InputFrequency)_inputFrequencyClass;
// //set => _inputFrequencyClass = (UInt32)value; set => _inputFrequencyClass = (UInt32)value;
//} }
// //
public WorkingMode WorkingMode public WorkingMode WorkingMode
{ {
get => (WorkingMode)(int)BitConverter.Int32BitsToSingle(unchecked((int)_workingMode)); get => (WorkingMode)(Int32)BitConverter.Int32BitsToSingle(unchecked((Int32)_workingMode));
set => _workingMode = BitConverter.ToUInt32(BitConverter.GetBytes((float)value), 0); set => _workingMode = BitConverter.ToUInt32(BitConverter.GetBytes((Single)value), 0);
} }
public GridSwitchMethod GridSwitchMethod
{
get => (GridSwitchMethod)(Int32)BitConverter.Int32BitsToSingle(unchecked((Int32)_methodSwitchMode));
set => _methodSwitchMode = BitConverter.ToUInt32(BitConverter.GetBytes((Single)value), 0);
}
// ───────────────────────────────────────────────
// Inverter Control Configuration
// ───────────────────────────────────────────────
public SinexcelUnbalanceCompensation EnableOnGridUnbalanceCompensation
{
get => (SinexcelUnbalanceCompensation)_enableOnGridUnbalanceCompensation;
set => _enableOnGridUnbalanceCompensation = (UInt32)value;
}
/*
public SinexcelTemperatureDrop TemperatureDrop
{
get => (SinexcelTemperatureDrop)ConvertBitPatternToFloat(_temperatureDrop);
//set => _temperatureDrop = (UInt32)value;
}
// //
//public GridSwitchMethod GridSwitchMethod public SinexcelHvrt Hvrt
//{ {
// get => (GridSwitchMethod)_methodSwitchMode; get => (SinexcelHvrt)_hvrt;
// //set => _methodSwitchMode = (UInt32)value; // set => _hvrt = (UInt32)value;
//} }
// //
//// ─────────────────────────────────────────────── public SinexcelLvrt Lvrt
//// Inverter Control Configuration {
//// ─────────────────────────────────────────────── get => (SinexcelLvrt)_lvrt;
//public SinexcelUnbalanceCompensation EnableOnGridUnbalanceCompensation // set => _lvrt = (UInt32)value;
//{ }
// get => (SinexcelUnbalanceCompensation)_enableOnGridUnbalanceCompensation;
// //set => _enableOnGridUnbalanceCompensation = (UInt32)value;
//}
//
//public SinexcelTemperatureDrop TemperatureDrop
//{
// get => (SinexcelTemperatureDrop)ConvertBitPatternToFloat(_temperatureDrop);
// //set => _temperatureDrop = (UInt32)value;
//}
//
//public SinexcelHvrt Hvrt
//{
// get => (SinexcelHvrt)_hvrt;
// //set => _hvrt = (UInt32)value;
//}
//
//public SinexcelLvrt Lvrt
//{
// get => (SinexcelLvrt)_lvrt;
// //set => _lvrt = (UInt32)value;
//}
// //
// F//an Gear — numeric [0.5 ~ 1.0], default 1.0 // F//an Gear — numeric [0.5 ~ 1.0], default 1.0
//public float FanGear public float FanGear
//{ {
// get => BitConverter.Int32BitsToSingle(unchecked((Int32)_fanGear)); get => BitConverter.Int32BitsToSingle(unchecked((Int32)_fanGear));
// //set => _fanGear = BitConverter.ToUInt32(BitConverter.GetBytes(value), 0); // set => _fanGear = BitConverter.ToUInt32(BitConverter.GetBytes(value), 0);
//} }
// */
//// ─────────────────────────────────────────────── //// ───────────────────────────────────────────────
//// Battery Configuration //// Battery Configuration
//// ─────────────────────────────────────────────── //// ───────────────────────────────────────────────
//public SinexcelBatteryAccessMethod BatteryAccessMethod public SinexcelBatteryAccessMethod BatteryAccessMethod
//{ {
// get => (SinexcelBatteryAccessMethod)_batteryAccessMethod; get => (SinexcelBatteryAccessMethod)_batteryAccessMethod;
// //set => _batteryAccessMethod = (UInt32)value; set => _batteryAccessMethod = (UInt32)value;
//} }
//
//public SinexcelMeterAccessEnable MeterAccessEnable public SinexcelMeterAccessEnable MeterAccessEnable
//{ {
// get => (SinexcelMeterAccessEnable)ConvertBitPatternToFloat(_meterAccessEnable); get => (SinexcelMeterAccessEnable)ConvertBitPatternToFloat(_meterAccessEnable);
// //set => _meterAccessEnable = (UInt32)value; set => _meterAccessEnable = (UInt32)value;
//} }
//
//public SinexcelBatteryEnable EnableBattery1 public SinexcelBatteryEnable EnableBattery1
//{ {
// get => (SinexcelBatteryEnable)ConvertBitPatternToFloat(_enableBattery1); get => (SinexcelBatteryEnable)ConvertBitPatternToFloat(_enableBattery1);
// //set => _enableBattery1 = (UInt32)value; set => _enableBattery1 = (UInt32)value;
//} }
//
//public SinexcelBatteryEnable EnableBattery2 public SinexcelBatteryEnable EnableBattery2
//{ {
// get => (SinexcelBatteryEnable)ConvertBitPatternToFloat(_enableBattery2); get => (SinexcelBatteryEnable)ConvertBitPatternToFloat(_enableBattery2);
// //set => _enableBattery2 = (UInt32)value; set => _enableBattery2 = (UInt32)value;
//} }
//
//public SinexcelPvEnable EnablePv1 public SinexcelPvEnable EnablePv1
//{ {
// get => (SinexcelPvEnable)ConvertBitPatternToFloat(_enablePv1); get => (SinexcelPvEnable)ConvertBitPatternToFloat(_enablePv1);
// //set => _enablePv1 = (UInt32)value; set => _enablePv1 = (UInt32)value;
//} }
//
//public SinexcelPvEnable EnablePv2 public SinexcelPvEnable EnablePv2
//{ {
// get => (SinexcelPvEnable)ConvertBitPatternToFloat(_enablePv2); get => (SinexcelPvEnable)ConvertBitPatternToFloat(_enablePv2);
// //set => _enablePv2 = (UInt32)value; set => _enablePv2 = (UInt32)value;
//} }
//
//public SinexcelBatteryType BatteryType public SinexcelBatteryType BatteryType
//{ {
// get => (SinexcelBatteryType)_batteryType; get => (SinexcelBatteryType)_batteryType;
// //set => _batteryType = (UInt32)value; set => _batteryType = (UInt32)value;
//} }
//
//public float BatteryCapacity1 public float BatteryCapacity1
//{ {
// get => BitConverter.Int32BitsToSingle(unchecked((Int32)_batteryCapacity1)); get => BitConverter.Int32BitsToSingle(unchecked((Int32)_batteryCapacity1));
// //set => _batteryCapacity1 = BitConverter.ToUInt32(BitConverter.GetBytes(value), 0); set => _batteryCapacity1 = BitConverter.ToUInt32(BitConverter.GetBytes(value), 0);
//} }
//
//public float Battery1MaxChargingCurrent public float Battery1MaxChargingCurrent
//{ {
// get => BitConverter.Int32BitsToSingle(unchecked((Int32)_maxChargingCurrentBattery1)); get => BitConverter.Int32BitsToSingle(unchecked((Int32)_maxChargingCurrentBattery1));
// //set => _maxChargingCurrentBattery1 = BitConverter.ToUInt32(BitConverter.GetBytes(value), 0); set => _maxChargingCurrentBattery1 = BitConverter.ToUInt32(BitConverter.GetBytes(value), 0);
//} }
//
//public float Battery1MaxDischargingCurrent public float Battery1MaxDischargingCurrent
//{ {
// get => BitConverter.Int32BitsToSingle(unchecked((Int32)_maxDischargingCurrentBattery1)); get => BitConverter.Int32BitsToSingle(unchecked((Int32)_maxDischargingCurrentBattery1));
// //set => _maxDischargingCurrentBattery1 = BitConverter.ToUInt32(BitConverter.GetBytes(value), 0); set => _maxDischargingCurrentBattery1 = BitConverter.ToUInt32(BitConverter.GetBytes(value), 0);
//} }
//
//public float RatedBatteryVoltage1 public float RatedBatteryVoltage1
//{ {
// get => BitConverter.Int32BitsToSingle(unchecked((Int32)_ratedBatteryVoltage1)); get => BitConverter.Int32BitsToSingle(unchecked((Int32)_ratedBatteryVoltage1));
// //set => _ratedBatteryVoltage1 = BitConverter.ToUInt32(BitConverter.GetBytes(value), 0); set => _ratedBatteryVoltage1 = BitConverter.ToUInt32(BitConverter.GetBytes(value), 0);
//} }
//
//public float Battery1MinSoc public float Battery1MinSoc
//{ {
// get => BitConverter.Int32BitsToSingle(unchecked((Int32)_minSocBattery1)); get => BitConverter.Int32BitsToSingle(unchecked((Int32)_minSocBattery1));
// //set => _minSocBattery1 = BitConverter.ToUInt32(BitConverter.GetBytes(value), 0); set => _minSocBattery1 = BitConverter.ToUInt32(BitConverter.GetBytes(value), 0);
//} }
//
//public float SetValueBattery1 public float SetValueBattery1
//{ {
// get => BitConverter.Int32BitsToSingle(unchecked((Int32)_setValueBattery1)); get => BitConverter.Int32BitsToSingle(unchecked((Int32)_setValueBattery1));
// //set => _setValueBattery1 = BitConverter.ToUInt32(BitConverter.GetBytes(value), 0); set => _setValueBattery1 = BitConverter.ToUInt32(BitConverter.GetBytes(value), 0);
//} }
//
//public SinexcelActiveChargeDischarge ActiveChargeDischarge /* public SinexcelActiveChargeDischarge ActiveChargeDischarge
//{ {
// get => (SinexcelActiveChargeDischarge)ConvertBitPatternToFloat(_activeChargeDischarge); get => (SinexcelActiveChargeDischarge)(Int32)BitConverter.Int32BitsToSingle(unchecked((Int32)_activeChargeDischarge));
// //set => _activeChargeDischarge = (UInt32)value; set => _activeChargeDischarge = BitConverter.ToUInt32(BitConverter.GetBytes((Single)value), 0);
//} }*/
//
//public float ActiveChargeDischargePower public float ActiveChargeDischargePower
//{ {
// get => ConvertBitPatternToFloat(_activeChargeDischargePower) * _factorFromKwtoW; get => ConvertBitPatternToFloat(_activeChargeDischargePower) * _factorFromKwtoW;
// //set => _activeChargeDischargePower = BitConverter.ToUInt32(BitConverter.GetBytes(value), 0); // we should check this may need to convert from W to KW set => _activeChargeDischargePower = BitConverter.ToUInt32(BitConverter.GetBytes(value), 0); // we should check this may need to convert from W to KW
//} }
// // ───────────────────────────────────────────────
//// ─────────────────────────────────────────────── // Protection & PV Mode
//// Protection & PV Mode // ───────────────────────────────────────────────
//// ─────────────────────────────────────────────── public SinexcelIslandProtection EnableIslandProtection
//public SinexcelIslandProtection EnableIslandProtection {
//{ get => (SinexcelIslandProtection)_enableIslandProtection;
// get => (SinexcelIslandProtection)_enableIslandProtection; set => _enableIslandProtection = (UInt32)value;
// //set => _enableIslandProtection = (UInt32)value; }
//}
// public SinexcelPvAccessMode PvAccessMode
//public SinexcelPvAccessMode PvAccessMode {
//{ get => (SinexcelPvAccessMode)_pvAccessMode;
// get => (SinexcelPvAccessMode)_pvAccessMode; set => _pvAccessMode = (UInt32)value;
// //set => _pvAccessMode = (UInt32)value; }
//}
// // ───────────────────────────────────────────────
//// ─────────────────────────────────────────────── // System-Level Parameters
//// System-Level Parameters // ───────────────────────────────────────────────
//// ─────────────────────────────────────────────── public float OutputVoltageAdjustmentFactor
//public float OutputVoltageAdjustmentFactor {
//{ get => BitConverter.Int32BitsToSingle(unchecked((int)_outputVoltageAdjustmentFactor));
// get => BitConverter.Int32BitsToSingle(unchecked((int)_outputVoltageAdjustmentFactor)); set => _outputVoltageAdjustmentFactor = BitConverter.ToUInt32(BitConverter.GetBytes(value), 0);
// //set => _outputVoltageAdjustmentFactor = BitConverter.ToUInt32(BitConverter.GetBytes(value), 0); }
//}
// public float SetValueBatteryUndervoltage1
//public float SetValueBatteryUndervoltage1 {
//{ get => BitConverter.Int32BitsToSingle(unchecked((int)_setValueBatteryUndervoltage1));
// get => BitConverter.Int32BitsToSingle(unchecked((int)_setValueBatteryUndervoltage1)); set => _setValueBatteryUndervoltage1 = BitConverter.ToUInt32(BitConverter.GetBytes(value), 0);
// //set => _setValueBatteryUndervoltage1 = BitConverter.ToUInt32(BitConverter.GetBytes(value), 0); }
//}
// public float InverterPowerLimit
//public float InverterPowerLimit {
//{ get => BitConverter.Int32BitsToSingle(unchecked((int)_inverterPowerLimit));
// get => BitConverter.Int32BitsToSingle(unchecked((int)_inverterPowerLimit)); set => _inverterPowerLimit = BitConverter.ToUInt32(BitConverter.GetBytes(value), 0);
// //set => _inverterPowerLimit = BitConverter.ToUInt32(BitConverter.GetBytes(value), 0); }
//}
// // ───────────────────────────────────────────────
//// ─────────────────────────────────────────────── // Battery 2 Parameters
//// Battery 2 Parameters // ───────────────────────────────────────────────
//// ─────────────────────────────────────────────── public float Battery2Capacity
//public float Battery2Capacity {
//{ get => BitConverter.Int32BitsToSingle(unchecked((int)_battery2Capacity));
// get => BitConverter.Int32BitsToSingle(unchecked((int)_battery2Capacity)); set => _battery2Capacity = BitConverter.ToUInt32(BitConverter.GetBytes(value), 0);
// //set => _battery2Capacity = BitConverter.ToUInt32(BitConverter.GetBytes(value), 0); }
//} public float Battery2MaxChargingCurrent
// {
//public float Battery2MaxChargingCurrent get => BitConverter.Int32BitsToSingle(unchecked((int)_maxChargingCurrentBattery2));
//{ set => _maxChargingCurrentBattery2 = BitConverter.ToUInt32(BitConverter.GetBytes(value), 0);
// get => BitConverter.Int32BitsToSingle(unchecked((int)_maxChargingCurrentBattery2)); }
// //set => _maxChargingCurrentBattery2 = BitConverter.ToUInt32(BitConverter.GetBytes(value), 0);
//} public float Battery2MaxDischargingCurrent
// {
//public float Battery2MaxDischargingCurrent get => BitConverter.Int32BitsToSingle(unchecked((int)_maxDischargingCurrentBattery2));
//{ set => _maxDischargingCurrentBattery2 = BitConverter.ToUInt32(BitConverter.GetBytes(value), 0);
// get => BitConverter.Int32BitsToSingle(unchecked((int)_maxDischargingCurrentBattery2)); }
// //set => _maxDischargingCurrentBattery2 = BitConverter.ToUInt32(BitConverter.GetBytes(value), 0);
//} public float Battery2RatedVoltage
// {
//public float Battery2RatedVoltage get => BitConverter.Int32BitsToSingle(unchecked((int)_battery2RatedVoltage));
//{ set => _battery2RatedVoltage = BitConverter.ToUInt32(BitConverter.GetBytes(value), 0);
// get => BitConverter.Int32BitsToSingle(unchecked((int)_battery2RatedVoltage)); }
// //set => _battery2RatedVoltage = BitConverter.ToUInt32(BitConverter.GetBytes(value), 0);
//} public float Battery2MinSoc
// {
//public float Battery2MinSoc get => BitConverter.Int32BitsToSingle(unchecked((int)_battery2MinSoc));
//{ set => _battery2MinSoc = BitConverter.ToUInt32(BitConverter.GetBytes(value), 0);
// get => BitConverter.Int32BitsToSingle(unchecked((int)_battery2MinSoc)); }
// //set => _battery2MinSoc = BitConverter.ToUInt32(BitConverter.GetBytes(value), 0);
//} public float Battery2OverVoltageSetting
// {
//public float Battery2OverVoltageSetting get => BitConverter.Int32BitsToSingle(unchecked((int)_battery2OverVoltageSetting));
//{ set => _battery2OverVoltageSetting = BitConverter.ToUInt32(BitConverter.GetBytes(value), 0);
// get => BitConverter.Int32BitsToSingle(unchecked((int)_battery2OverVoltageSetting)); }
// //set => _battery2OverVoltageSetting = BitConverter.ToUInt32(BitConverter.GetBytes(value), 0);
//} public float Battery2UnderVoltageSetpoint
// {
//public float Battery2UnderVoltageSetpoint get => BitConverter.Int32BitsToSingle(unchecked((int)_battery2UnderVoltageSetpoint));
//{ set => _battery2UnderVoltageSetpoint = BitConverter.ToUInt32(BitConverter.GetBytes(value), 0);
// get => BitConverter.Int32BitsToSingle(unchecked((int)_battery2UnderVoltageSetpoint)); }
// //set => _battery2UnderVoltageSetpoint = BitConverter.ToUInt32(BitConverter.GetBytes(value), 0);
//} public float Battery1BackupSoc
// {
//// ─────────────────────────────────────────────── get => BitConverter.Int32BitsToSingle(unchecked((int)_battery1BackupSOC));
//// Parallel / System Settings set => _battery1BackupSOC = BitConverter.ToUInt32(BitConverter.GetBytes(value), 0);
//// ─────────────────────────────────────────────── }
//public SinexcelMachineMode MachineMode
//{ public float Battery2BackupSoc
// get => (SinexcelMachineMode)ConvertBitPatternToFloat(_singleOrParallelMachine); {
// //set => _singleOrParallelMachine = (UInt32)value; get => BitConverter.Int32BitsToSingle(unchecked((int)_battery2BackupSOC));
//} set => _battery2BackupSOC = BitConverter.ToUInt32(BitConverter.GetBytes(value), 0);
// }
//public UInt32 NumberOfSystemModules // to be tested
//{ public float EnableGridExport
// get => (UInt32)ConvertBitPatternToFloat(_numberOfSystemModules);
// //set => _numberOfSystemModules = value; {
//} get => BitConverter.Int32BitsToSingle(unchecked((int)_enableGridExport));
// set => _enableGridExport = BitConverter.ToUInt32(BitConverter.GetBytes(value), 0);
//public UInt32 ParallelModuleMachineNumber }
//{
// get => (UInt32)ConvertBitPatternToFloat(_parallelModuleMachineNumber); public float PowerGridExportLimit
// //set => _parallelModuleMachineNumber = value; {
//} get => BitConverter.Int32BitsToSingle(unchecked((int)_powerGridExportLimit));
// set => _powerGridExportLimit = BitConverter.ToUInt32(BitConverter.GetBytes(value), 0);
//public AccreditedCountry AccreditedCountry }
//{
// get => (AccreditedCountry)ConvertBitPatternToFloat(_accreditedCountries); // ───────────────────────────────────────────────
// //set => _accreditedCountries = (UInt32)value; // Parallel / System Settings
//} // ───────────────────────────────────────────────
// public SinexcelMachineMode MachineMode
//// ─────────────────────────────────────────────── {
//// Control Commands get => (SinexcelMachineMode)ConvertBitPatternToFloat(_singleOrParallelMachine);
//// ─────────────────────────────────────────────── set => _singleOrParallelMachine = (UInt32)value;
}
public UInt32 NumberOfSystemModules
{
get => (UInt32)ConvertBitPatternToFloat(_numberOfSystemModules);
set => _numberOfSystemModules = value;
}
public UInt32 ParallelModuleMachineNumber
{
get => (UInt32)ConvertBitPatternToFloat(_parallelModuleMachineNumber);
set => _parallelModuleMachineNumber = value;
}
public AccreditedCountry AccreditedCountry
{
get => (AccreditedCountry)(Int32)BitConverter.Int32BitsToSingle(unchecked((Int32)_accreditedCountries));
set => _accreditedCountries = BitConverter.ToUInt32(BitConverter.GetBytes((Single)value), 0);
}
// ───────────────────────────────────────────────
// Control Commands
// ───────────────────────────────────────────────
public float PowerOn public float PowerOn
{ {
get => BitConverter.Int32BitsToSingle(unchecked((Int32)_powerOn)); get => BitConverter.Int32BitsToSingle(unchecked((Int32)_powerOn));
@ -489,39 +699,40 @@ public partial class SinexcelRecord
get => BitConverter.Int32BitsToSingle(unchecked((Int32)_powerOff)); get => BitConverter.Int32BitsToSingle(unchecked((Int32)_powerOff));
set => _powerOff = BitConverter.ToUInt32(BitConverter.GetBytes(value), 0); set => _powerOff = BitConverter.ToUInt32(BitConverter.GetBytes(value), 0);
} }
public float FaultClearing
{
get => BitConverter.Int32BitsToSingle(unchecked((Int32)_faultClearing));
set => _faultClearing = BitConverter.ToUInt32(BitConverter.GetBytes(value), 0);
}
// //
//public float FaultClearingf // ───────────────────────────────────────────────
//{ // Meter & Battery Control
// get => BitConverter.Int32BitsToSingle(unchecked((Int32)_faultClearing)); // ───────────────────────────────────────────────
// // //set => _faultClearing = BitConverter.ToUInt32(BitConverter.GetBytes(value), 0); public float MeterReverseManualDetection
//} {
get => BitConverter.Int32BitsToSingle(unchecked((Int32)_meterReverseManualDetection));
set => _meterReverseManualDetection = BitConverter.ToUInt32(BitConverter.GetBytes(value), 0);
}
// This causing the inverter to switch off, please consider testing it first before uncommenting
/*public SinexcelBatteryRating SinexcelBatteryRating
{
get => (SinexcelBatteryRating)(Int32)BitConverter.Int32BitsToSingle(unchecked((Int32)_batteryVoltageRating));
set => _batteryVoltageRating = BitConverter.ToUInt32(BitConverter.GetBytes((Single)value), 0);
}*/
public float Battery1Activation
{
get => BitConverter.Int32BitsToSingle(unchecked((Int32)_battery1Activation));
set => _battery1Activation = BitConverter.ToUInt32(BitConverter.GetBytes(value), 0);
}
// //
//// ─────────────────────────────────────────────── public float Battery2Activation
//// Meter & Battery Control {
//// ─────────────────────────────────────────────── get => BitConverter.Int32BitsToSingle(unchecked((Int32)_battery2Activation));
//public float MeterReverseManualDetection set => _battery2Activation = BitConverter.ToUInt32(BitConverter.GetBytes(value), 0);
//{ }
// get => BitConverter.Int32BitsToSingle(unchecked((Int32)_meterReverseManualDetection));
// //set => _meterReverseManualDetection = BitConverter.ToUInt32(BitConverter.GetBytes(value), 0);
//}
//
//public SinexcelBatteryRating BatteryVoltageRating
//{
// get => (SinexcelBatteryRating)ConvertBitPatternToFloat(_batteryVoltageRating);
// //set => _batteryVoltageRating = (UInt32)value;
//}
//
//public float Battery1Activation
//{
// get => BitConverter.Int32BitsToSingle(unchecked((Int32)_battery1Activation));
// //set => _battery1Activation = BitConverter.ToUInt32(BitConverter.GetBytes(value), 0);
//}
//
//public float Battery2Activation
//{
// get => BitConverter.Int32BitsToSingle(unchecked((Int32)_battery2Activation));
// //set => _battery2Activation = BitConverter.ToUInt32(BitConverter.GetBytes(value), 0);
//}
// ─────────────────────────────────────────────── // ───────────────────────────────────────────────
// Electric Meter Operating State // Electric Meter Operating State
@ -609,23 +820,9 @@ public partial class SinexcelRecord
// Pack Voltage / Current / Temperature // Pack Voltage / Current / Temperature
public Voltage Battery2PackTotalVoltage => BitConverter.Int32BitsToSingle(unchecked((Int32)_batteryCab2PackTotalVoltage)); // 0xB200 (0.01 V resolution) public Voltage Battery2PackTotalVoltage => BitConverter.Int32BitsToSingle(unchecked((Int32)_batteryCab2PackTotalVoltage)); // 0xB200 (0.01 V resolution)
public Current Battery2PackTotalCurrent => BitConverter.Int32BitsToSingle(unchecked((Int32)_batteryCab2PackTotalCurrent)); // 0xB202 (0.01 A resolution) public Current Battery2PackTotalCurrent => BitConverter.Int32BitsToSingle(unchecked((Int32)_batteryCab2PackTotalCurrent)); // 0xB202 (0.01 A resolution)
public Temperature Battery2Socsecondvalue => BitConverter.Int32BitsToSingle(unchecked((Int32)_batteryCab2Soc)); // 0xB206 % public Percent Battery2Socsecondvalue => BitConverter.Int32BitsToSingle(unchecked((Int32)_batteryCab2Soc)); // 0xB206 %
public Percent Battery2Soh => BitConverter.Int32BitsToSingle(unchecked((Int32)_batteryCab2Soh)); // 0xB208 % public Percent Battery2Soh => BitConverter.Int32BitsToSingle(unchecked((Int32)_batteryCab2Soh)); // 0xB208 %
// Repetitive-week mask (bit-mapped 06 = SunSat)
//public float TimedChargeAndDischargeOff
//{
// get => BitConverter.Int32BitsToSingle(unchecked((Int32)_Timed_Charge_and_Discharge_Off)) ; // only 7 bits used
// //set => _Timed_Charge_and_Discharge_Off = BitConverter.ToUInt32(BitConverter.GetBytes(value), 0);
//}
// Repetitive-week mask (bit-mapped 06 = SunSat)
/* public float OtherTimePeriodMode
{
get => _Other_time_period_mode ; // only 7 bits used
//set => _Other_time_period_mode = (UInt32)value;
}*/
// Repetitive-week mask (bit-mapped 06 = SunSat) // Repetitive-week mask (bit-mapped 06 = SunSat)
public SinexcelWeekDays RepetitiveWeeks public SinexcelWeekDays RepetitiveWeeks
@ -633,20 +830,20 @@ public partial class SinexcelRecord
get => (SinexcelWeekDays)(_repetitiveWeeks & 0x7F); // only 7 bits used get => (SinexcelWeekDays)(_repetitiveWeeks & 0x7F); // only 7 bits used
set => _repetitiveWeeks = (UInt32)value; set => _repetitiveWeeks = (UInt32)value;
} }
//
// Effective start / end as UNIX timestamps // Effective start / end as UNIX timestamps
public DateTime EffectiveStartDate public DateTime EffectiveStartDate
{ {
get => DateTimeOffset.FromUnixTimeSeconds(_effectiveStartDate).DateTime; get => DateTimeOffset.FromUnixTimeSeconds(_effectiveStartDate).DateTime;
set => _effectiveStartDate = (UInt32)new DateTimeOffset(value).ToUnixTimeSeconds(); set => _effectiveStartDate = (UInt32)new DateTimeOffset(value).ToUnixTimeSeconds();
} }
//
public DateTime EffectiveEndDate public DateTime EffectiveEndDate
{ {
get => DateTimeOffset.FromUnixTimeSeconds(_effectiveEndDate).DateTime; get => DateTimeOffset.FromUnixTimeSeconds(_effectiveEndDate).DateTime;
set => _effectiveEndDate = (UInt32)new DateTimeOffset(value).ToUnixTimeSeconds(); set => _effectiveEndDate = (UInt32)new DateTimeOffset(value).ToUnixTimeSeconds();
} }
// // Charging power during time period 1 (kW) // Charging power during time period 1 (kW)
public float ChargingPowerPeriod1 public float ChargingPowerPeriod1
{ {
get => BitConverter.Int32BitsToSingle(unchecked((Int32)_chargingPowerPeriod1)); get => BitConverter.Int32BitsToSingle(unchecked((Int32)_chargingPowerPeriod1));

View File

@ -11,7 +11,178 @@ namespace InnovEnergy.Lib.Devices.Sinexcel_12K_TL;
[BigEndian] [BigEndian]
public partial class SinexcelRecord public partial class SinexcelRecord
{ {
/****************************** Input registers ****************************/ /*
// ========================================================
// Register declarations
// ========================================================
// to test by block first
// ---- Operating states (0x10000x1014)
[HoldingRegister<UInt16>(4096, writable: false)] private UInt16 _notUsedRemain; // 0x1000
[HoldingRegister<UInt16>(4098, writable: false)] private UInt16 _inverterOperatingState; // 0x1002 (3 bits)
[HoldingRegister<UInt16>(4100, writable: false)] private UInt16 _pv1OperatingState; // 0x1004 (1 bit)
[HoldingRegister<UInt16>(4101, writable: false)] private UInt16 _pv2OperatingState; // 0x1005 (1 bit)
[HoldingRegister<UInt16>(4103, writable: false)] private UInt16 _battery1OperatingState; // 0x1007 (3 bits)
// Battery 2 operating state bits (0x10090x100B)
[HoldingRegister<UInt16>(4105, writable: false)] private UInt16 _bat2StateBit0; // 0x1009
[HoldingRegister<UInt16>(4106, writable: false)] private UInt16 _bat2StateBit1; // 0x100A
[HoldingRegister<UInt16>(4107, writable: false)] private UInt16 _bat2StateBit2; // 0x100B
// ORED state bits (0x100C0x100F)
[HoldingRegister<UInt16>(4108, writable: false)] private UInt16 _oredStateBit0; // 0x100C
[HoldingRegister<UInt16>(4109, writable: false)] private UInt16 _oredStateBit1; // 0x100D
[HoldingRegister<UInt16>(4110, writable: false)] private UInt16 _oredStateBit2; // 0x100E
[HoldingRegister<UInt16>(4111, writable: false)] private UInt16 _oredStateBit3; // 0x100F
// DCDC state (separate bits for DC/AC variants)
[HoldingRegister<UInt16>(4112, writable: false)] private UInt16 _dcdcStateDc; // 0x1010
[HoldingRegister<UInt16>(4113, writable: false)] private UInt16 _dcdcStateAc; // 0x1011
// PV3 / PV4 operational state
[HoldingRegister<UInt16>(4114, writable: false)] private UInt16 _pv3OperatingState; // 0x1012
[HoldingRegister<UInt16>(4115, writable: false)] private UInt16 _pv4OperatingState; // 0x1013
// Power grid status
[HoldingRegister<UInt16>(4116, writable: false)] private UInt16 _powerGridStatus; // 0x1014
// ---- Alarm / fault flags (0x10480x10CE) (0: Normal, 1: Abnormal)
[HoldingRegister<UInt16>(4168, writable: false)] private UInt16 _abnormalGridVoltage; // 0x1048 Abnormal grid voltage
[HoldingRegister<UInt16>(4169, writable: false)] private UInt16 _abnormalGridFrequency; // 0x1049 Abnormal grid frequency
[HoldingRegister<UInt16>(4170, writable: false)] private UInt16 _invertedSequenceOfGridVoltage; // 0x104A Inverted sequence of grid voltage
[HoldingRegister<UInt16>(4171, writable: false)] private UInt16 _gridVoltagePhaseLoss; // 0x104B Grid voltage phase loss
[HoldingRegister<UInt16>(4172, writable: false)] private UInt16 _abnormalOutputVoltage; // 0x104C Abnormal output voltage
[HoldingRegister<UInt16>(4173, writable: false)] private UInt16 _abnormalOutputFrequency; // 0x104D Abnormal output frequency
[HoldingRegister<UInt16>(4174, writable: false)] private UInt16 _abnormalNullLine; // 0x104E Abnormal null line
[HoldingRegister<UInt16>(4175, writable: false)] private UInt16 _excessivelyHighAmbientTemperature; // 0x104F Excessively high ambient temperature
[HoldingRegister<UInt16>(4176, writable: false)] private UInt16 _excessiveRadiatorTemperature; // 0x1050 Excessive radiator temperature
[HoldingRegister<UInt16>(4177, writable: false)] private UInt16 _insulationFault; // 0x1051 Insulation fault
[HoldingRegister<UInt16>(4178, writable: false)] private UInt16 _leakageProtectionFault; // 0x1052 Leakage protection fault
[HoldingRegister<UInt16>(4179, writable: false)] private UInt16 _auxiliaryPowerFault; // 0x1053 Auxiliary power fault
[HoldingRegister<UInt16>(4180, writable: false)] private UInt16 _fanFault; // 0x1054 Fan fault
[HoldingRegister<UInt16>(4181, writable: false)] private UInt16 _modelCapacityFault; // 0x1055 Model capacity fault
[HoldingRegister<UInt16>(4182, writable: false)] private UInt16 _abnormalLightningArrester; // 0x1056 Abnormal lightning arrester
[HoldingRegister<UInt16>(4183, writable: false)] private UInt16 _islandProtection; // 0x1057 Island protection
[HoldingRegister<UInt16>(4184, writable: false)] private UInt16 _battery1NotConnected; // 0x1058 Battery 1 not connected
[HoldingRegister<UInt16>(4185, writable: false)] private UInt16 _battery1Overvoltage; // 0x1059 Battery 1 overvoltage
[HoldingRegister<UInt16>(4186, writable: false)] private UInt16 _battery1Undervoltage; // 0x105A Battery 1 undervoltage
[HoldingRegister<UInt16>(4187, writable: false)] private UInt16 _battery1DischargeEnd; // 0x105B Battery 1 discharge end
[HoldingRegister<UInt16>(4188, writable: false)] private UInt16 _battery1Inverted; // 0x105C Battery 1 inverted
[HoldingRegister<UInt16>(4189, writable: false)] private UInt16 _battery2NotConnected; // 0x105D Battery 2 not connected
[HoldingRegister<UInt16>(4190, writable: false)] private UInt16 _battery2Overvoltage; // 0x105E Battery 2 overvoltage
[HoldingRegister<UInt16>(4191, writable: false)] private UInt16 _battery2Undervoltage; // 0x105F Battery 2 undervoltage
[HoldingRegister<UInt16>(4192, writable: false)] private UInt16 _battery2DischargeEnd; // 0x1060 Battery 2 discharge end
[HoldingRegister<UInt16>(4193, writable: false)] private UInt16 _battery2Inverted; // 0x1061 Battery 2 inverted
[HoldingRegister<UInt16>(4194, writable: false)] private UInt16 _pv1NotAccessed; // 0x1062 PV1 not accessed
[HoldingRegister<UInt16>(4195, writable: false)] private UInt16 _pv1Overvoltage; // 0x1063 PV1 overvoltage
[HoldingRegister<UInt16>(4196, writable: false)] private UInt16 _abnormalPv1CurrentSharing; // 0x1064 Abnormal PV1 current sharing
[HoldingRegister<UInt16>(4197, writable: false)] private UInt16 _pv2NotAccessed; // 0x1065 PV2 not accessed
[HoldingRegister<UInt16>(4198, writable: false)] private UInt16 _pv2Overvoltage; // 0x1066 PV2 overvoltage
[HoldingRegister<UInt16>(4199, writable: false)] private UInt16 _abnormalPv2CurrentSharing; // 0x1067 Abnormal PV2 current sharing
[HoldingRegister<UInt16>(4200, writable: false)] private UInt16 _dcBusOvervoltage; // 0x1068 DC bus overvoltage
[HoldingRegister<UInt16>(4201, writable: false)] private UInt16 _dcBusUndervoltage; // 0x1069 DC bus undervoltage
[HoldingRegister<UInt16>(4202, writable: false)] private UInt16 _dcBusVoltageUnbalance; // 0x106A DC bus voltage unbalance
[HoldingRegister<UInt16>(4203, writable: false)] private UInt16 _pv1PowerTubeFault; // 0x106B PV1 power tube fault
[HoldingRegister<UInt16>(4204, writable: false)] private UInt16 _pv2PowerTubeFault; // 0x106C PV2 power tube fault
[HoldingRegister<UInt16>(4205, writable: false)] private UInt16 _battery1PowerTubeFault; // 0x106D Battery 1 power tube fault
[HoldingRegister<UInt16>(4206, writable: false)] private UInt16 _battery2PowerTubeFault; // 0x106E Battery 2 power tube fault
[HoldingRegister<UInt16>(4207, writable: false)] private UInt16 _inverterPowerTubeFault; // 0x106F Inverter power tube fault
[HoldingRegister<UInt16>(4208, writable: false)] private UInt16 _systemOutputOverload; // 0x1070 System output overload
[HoldingRegister<UInt16>(4209, writable: false)] private UInt16 _inverterOverload; // 0x1071 Inverter overload
[HoldingRegister<UInt16>(4210, writable: false)] private UInt16 _inverterOverloadTimeout; // 0x1072 Inverter overload timeout
[HoldingRegister<UInt16>(4211, writable: false)] private UInt16 _battery1OverloadTimeout; // 0x1073 Battery 1 overload timeout
[HoldingRegister<UInt16>(4212, writable: false)] private UInt16 _battery2OverloadTimeout; // 0x1074 Battery 2 overload timeout
[HoldingRegister<UInt16>(4213, writable: false)] private UInt16 _inverterSoftStartFailure; // 0x1075 Inverter soft start failure
[HoldingRegister<UInt16>(4214, writable: false)] private UInt16 _battery1SoftStartFailure; // 0x1076 Battery 1 soft start failure
[HoldingRegister<UInt16>(4215, writable: false)] private UInt16 _battery2SoftStartFailure; // 0x1077 Battery 2 soft start failure
[HoldingRegister<UInt16>(4216, writable: false)] private UInt16 _dsp1ParameterSettingFault; // 0x1078 DSP1 parameter setting fault
[HoldingRegister<UInt16>(4217, writable: false)] private UInt16 _dsp2ParameterSettingFault; // 0x1079 DSP2 parameter setting fault
[HoldingRegister<UInt16>(4218, writable: false)] private UInt16 _dspVersionCompatibilityFault; // 0x107A DSP version compatibility fault
[HoldingRegister<UInt16>(4219, writable: false)] private UInt16 _cpldVersionCompatibilityFault; // 0x107B CPLD version compatibility fault
[HoldingRegister<UInt16>(4220, writable: false)] private UInt16 _cpldCommunicationFault; // 0x107C CPLD communication fault
[HoldingRegister<UInt16>(4221, writable: false)] private UInt16 _dspCommunicationFault; // 0x107D DSP communication fault
[HoldingRegister<UInt16>(4222, writable: false)] private UInt16 _outputVoltageDcOverlimit; // 0x107E Output voltage DC overlimit
[HoldingRegister<UInt16>(4223, writable: false)] private UInt16 _outputCurrentDcOverlimit; // 0x107F Output current DC overlimit
[HoldingRegister<UInt16>(4224, writable: false)] private UInt16 _relaySelfCheckFails; // 0x1080 Relay self-check fails
[HoldingRegister<UInt16>(4225, writable: false)] private UInt16 _abnormalInverter; // 0x1081 Abnormal inverter
[HoldingRegister<UInt16>(4226, writable: false)] private UInt16 _poorGrounding; // 0x1082 Poor grounding
[HoldingRegister<UInt16>(4227, writable: false)] private UInt16 _pv1SoftStartFailure; // 0x1083 PV1 soft start failure
[HoldingRegister<UInt16>(4228, writable: false)] private UInt16 _pv2SoftStartFailure2; // 0x1084 PV2 soft start failure
[HoldingRegister<UInt16>(4229, writable: false)] private UInt16 _balancedCircuitOverloadTimeout; // 0x1085 Balanced circuit overload timeout
[HoldingRegister<UInt16>(4230, writable: false)] private UInt16 _pv1OverloadTimeout; // 0x1086 PV1 overload timeout
[HoldingRegister<UInt16>(4231, writable: false)] private UInt16 _pv2OverloadTimeout; // 0x1087 PV2 overload timeout
[HoldingRegister<UInt16>(4232, writable: false)] private UInt16 _pcbOvertemperature; // 0x1088 PCB overtemperature
[HoldingRegister<UInt16>(4233, writable: false)] private UInt16 _dcConverterOvertemperature; // 0x1089 DC converter overtemperature
[HoldingRegister<UInt16>(4234, writable: false)] private UInt16 _busSlowOvervoltage; // 0x108A Bus slow overvoltage
[HoldingRegister<UInt16>(4235, writable: false)] private UInt16 _abnormalOffGridOutputVoltage; // 0x108B Abnormal off-grid output voltage
[HoldingRegister<UInt16>(4236, writable: false)] private UInt16 _hardwareBusOvervoltage; // 0x108C Hardware bus overvoltage
[HoldingRegister<UInt16>(4237, writable: false)] private UInt16 _hardwareOvercurrent; // 0x108D Hardware overcurrent
[HoldingRegister<UInt16>(4238, writable: false)] private UInt16 _dcConverterOvervoltage; // 0x108E DC converter overvoltage
[HoldingRegister<UInt16>(4239, writable: false)] private UInt16 _dcConverterHardwareOvervoltage; // 0x108F DC converter hardware overvoltage
[HoldingRegister<UInt16>(4240, writable: false)] private UInt16 _dcConverterOvercurrent; // 0x1090 DC converter overcurrent
[HoldingRegister<UInt16>(4241, writable: false)] private UInt16 _dcConverterHardwareOvercurrent; // 0x1091 DC converter hardware overcurrent
[HoldingRegister<UInt16>(4242, writable: false)] private UInt16 _dcConverterResonatorOvercurrent; // 0x1092 DC converter resonator overcurrent
[HoldingRegister<UInt16>(4243, writable: false)] private UInt16 _pv1InsufficientPower; // 0x1093 PV1 insufficient power
[HoldingRegister<UInt16>(4244, writable: false)] private UInt16 _pv2InsufficientPower; // 0x1094 PV2 insufficient power
[HoldingRegister<UInt16>(4245, writable: false)] private UInt16 _battery1InsufficientPower; // 0x1095 Battery 1 insufficient power
[HoldingRegister<UInt16>(4246, writable: false)] private UInt16 _battery2InsufficientPower; // 0x1096 Battery 2 insufficient power
[HoldingRegister<UInt16>(4247, writable: false)] private UInt16 _lithiumBattery1ChargeForbidden; // 0x1097 Lithium battery 1 charge forbidden
[HoldingRegister<UInt16>(4248, writable: false)] private UInt16 _lithiumBattery1DischargeForbidden; // 0x1098 Lithium battery 1 discharge forbidden
[HoldingRegister<UInt16>(4249, writable: false)] private UInt16 _lithiumBattery2ChargeForbidden; // 0x1099 Lithium battery 2 charge forbidden
[HoldingRegister<UInt16>(4250, writable: false)] private UInt16 _lithiumBattery2DischargeForbidden; // 0x109A Lithium battery 2 discharge forbidden
[HoldingRegister<UInt16>(4251, writable: false)] private UInt16 _lithiumBattery1Full; // 0x109B Lithium battery 1 full
[HoldingRegister<UInt16>(4252, writable: false)] private UInt16 _lithiumBattery1DischargeEnd; // 0x109C Lithium battery 1 discharge end
[HoldingRegister<UInt16>(4253, writable: false)] private UInt16 _lithiumBattery2Full; // 0x109D LithiumBattery2 full
[HoldingRegister<UInt16>(4254, writable: false)] private UInt16 _lithiumBattery2DischargeEnd; // 0x109E Lithium battery 2 discharge end
[HoldingRegister<UInt16>(4255, writable: false)] private UInt16 _loadPowerOverload; // 0x109F Load power overload
[HoldingRegister<UInt16>(4256, writable: false)] private UInt16 _abnormalLeakageSelfCheck; // 0x10A0 Abnormal leakage self-check
[HoldingRegister<UInt16>(4257, writable: false)] private UInt16 _inverterOvertemperatureAlarm; // 0x10A1 Inverter overtemperature alarm
[HoldingRegister<UInt16>(4258, writable: false)] private UInt16 _inverterOvertemperature; // 0x10A2 Inverter overtemperature
[HoldingRegister<UInt16>(4259, writable: false)] private UInt16 _dcConverterOvertemperatureAlarm; // 0x10A3 DC converter overtemperature alarm
[HoldingRegister<UInt16>(4260, writable: false)] private UInt16 _parallelCommunicationAlarm; // 0x10A4 Parallel communication alarm
[HoldingRegister<UInt16>(4261, writable: false)] private UInt16 _systemDerating; // 0x10A5 System derating
[HoldingRegister<UInt16>(4262, writable: false)] private UInt16 _inverterRelayOpen; // 0x10A6 Inverter relay open
[HoldingRegister<UInt16>(4263, writable: false)] private UInt16 _inverterRelayShortCircuit; // 0x10A7 Inverter relay short circuit
[HoldingRegister<UInt16>(4264, writable: false)] private UInt16 _pvAccessMethodErrorAlarm; // 0x10A8 PV access method error alarm
[HoldingRegister<UInt16>(4265, writable: false)] private UInt16 _parallelModuleMissing; // 0x10A9 Parallel module missing
[HoldingRegister<UInt16>(4266, writable: false)] private UInt16 _duplicateMachineNumbersForParallelModules; // 0x10AA Duplicate machine numbers for parallel modules
[HoldingRegister<UInt16>(4267, writable: false)] private UInt16 _parameterConflictInParallelModule; // 0x10AB Parameter conflict in parallel module
[HoldingRegister<UInt16>(4268, writable: false)] private UInt16 _reservedAlarms4; // 0x10AC Reserved alarms4
[HoldingRegister<UInt16>(4269, writable: false)] private UInt16 _reverseMeterConnection; // 0x10AD Reverse meter connection
[HoldingRegister<UInt16>(4270, writable: false)] private UInt16 _inverterSealPulse; // 0x10AE Inverter Seal Pulse
[HoldingRegister<UInt16>(4271, writable: false)] private UInt16 _pv3NotConnected; // 0x10AF PV3 not connected
[HoldingRegister<UInt16>(4272, writable: false)] private UInt16 _pv3Overvoltage; // 0x10B0 PV3 overvoltage
[HoldingRegister<UInt16>(4273, writable: false)] private UInt16 _pv3AverageCurrentAnomaly; // 0x10B1 PV3 average current anomaly
[HoldingRegister<UInt16>(4274, writable: false)] private UInt16 _pv4NotConnected; // 0x10B2 PV4 not connected
[HoldingRegister<UInt16>(4275, writable: false)] private UInt16 _pv4Overvoltage; // 0x10B3 PV4 overvoltage
[HoldingRegister<UInt16>(4276, writable: false)] private UInt16 _pv4AverageCurrentAnomaly; // 0x10B4 PV4 average current anomaly
[HoldingRegister<UInt16>(4277, writable: false)] private UInt16 _pv3PowerTubeFailure; // 0x10B5 PV3 power tube failure
[HoldingRegister<UInt16>(4278, writable: false)] private UInt16 _pv4PowerTubeFailure; // 0x10B6 PV4 power tube failure
[HoldingRegister<UInt16>(4279, writable: false)] private UInt16 _pv3SoftStartFailure; // 0x10B7 PV3 soft start failure
[HoldingRegister<UInt16>(4280, writable: false)] private UInt16 _pv4SoftStartFailure; // 0x10B8 PV4 soft start failure
[HoldingRegister<UInt16>(4281, writable: false)] private UInt16 _pv3OverloadTimeout; // 0x10B9 PV3 overload timeout
[HoldingRegister<UInt16>(4282, writable: false)] private UInt16 _pv4OverloadTimeout; // 0x10BA PV4 overload timeout
[HoldingRegister<UInt16>(4283, writable: false)] private UInt16 _pv3ReverseConnection; // 0x10BB PV3 reverse connection
[HoldingRegister<UInt16>(4284, writable: false)] private UInt16 _pv4ReverseConnection; // 0x10BC PV4 reverse connection
[HoldingRegister<UInt16>(4285, writable: false)] private UInt16 _abnormalDieselGeneratorVoltage; // 0x10BD Abnormal diesel generator voltage
[HoldingRegister<UInt16>(4286, writable: false)] private UInt16 _abnormalDieselGeneratorFrequency; // 0x10BE Abnormal diesel generator frequency
[HoldingRegister<UInt16>(4287, writable: false)] private UInt16 _dieselGeneratorVoltageReverseSequence; // 0x10BF Diesel generator voltage reverse sequence
[HoldingRegister<UInt16>(4288, writable: false)] private UInt16 _dieselGeneratorVoltageOutOfPhase; // 0x10C0 Diesel generator voltage out of phase
[HoldingRegister<UInt16>(4289, writable: false)] private UInt16 _leadBatteryTemperatureAbnormality; // 0x10C1 Lead battery temperature abnormality
[HoldingRegister<UInt16>(4290, writable: false)] private UInt16 _batteryAccessMethodError; // 0x10C2 Battery access method error
[HoldingRegister<UInt16>(4291, writable: false)] private UInt16 _reservedAlarms5; // 0x10C3 Reserved alarms5
[HoldingRegister<UInt16>(4292, writable: false)] private UInt16 _battery1BackupProhibited; // 0x10C4 Battery 1 backup prohibited
[HoldingRegister<UInt16>(4293, writable: false)] private UInt16 _battery2BackupProhibited; // 0x10C5 Battery 2 backup prohibited
[HoldingRegister<UInt16>(4294, writable: false)] private UInt16 _abnormalGridCurrent; // 0x10C6 Abnormal grid current
[HoldingRegister<UInt16>(4295, writable: false)] private UInt16 _generatorOverload; // 0x10C7 Generator overload
[HoldingRegister<UInt16>(4296, writable: false)] private UInt16 _busSoftStartFailure; // 0x10C8 Bus soft start failure
[HoldingRegister<UInt16>(4297, writable: false)] private UInt16 _openCircuitOfPowerGridRelay; // 0x10C9 Open circuit of power grid relay
[HoldingRegister<UInt16>(4298, writable: false)] private UInt16 _shortCircuitOfPowerGridRelay; // 0x10CA Short circuit of power grid relay
[HoldingRegister<UInt16>(4299, writable: false)] private UInt16 _generatorRelayOpenCircuit; // 0x10CB Generator relay open circuit
[HoldingRegister<UInt16>(4300, writable: false)] private UInt16 _generatorRelayShortCircuit; // 0x10CC Generator relay short circuit
[HoldingRegister<UInt16>(4301, writable: false)] private UInt16 _insufficientPhotovoltaicPower; // 0x10CD Insufficient photovoltaic power
[HoldingRegister<UInt16>(4302, writable: false)] private UInt16 _photovoltaic1Overcurrent; // 0x10CE Photovoltaic 1 overcurrent*/
/****************************** Holding registers ****************************/
// Voltages // Voltages
[HoldingRegister<UInt32>(4096)] public UInt32 _gridAPhaseVoltage; // 0x1000 [HoldingRegister<UInt32>(4096)] public UInt32 _gridAPhaseVoltage; // 0x1000
[HoldingRegister<UInt32>(4098)] private UInt32 _grid_B_Phase_Voltage; // 0x1002 [HoldingRegister<UInt32>(4098)] private UInt32 _grid_B_Phase_Voltage; // 0x1002
@ -206,6 +377,7 @@ public partial class SinexcelRecord
[HoldingRegister<UInt32>(4740)] private UInt32 _pv4Current; // 0x1284 [HoldingRegister<UInt32>(4740)] private UInt32 _pv4Current; // 0x1284
[HoldingRegister<UInt32>(4742)] private UInt32 _pv4Power; // 0x1286 [HoldingRegister<UInt32>(4742)] private UInt32 _pv4Power; // 0x1286
[HoldingRegister<UInt32>(4744)] private UInt32 _generatorTotalPower; // 0x128C [HoldingRegister<UInt32>(4744)] private UInt32 _generatorTotalPower; // 0x128C
// ─────────────────────────────────────────────── // ───────────────────────────────────────────────
// Manufacturer Information & Software Versions // Manufacturer Information & Software Versions
// ─────────────────────────────────────────────── // ───────────────────────────────────────────────
@ -226,15 +398,15 @@ public partial class SinexcelRecord
// ─────────────────────────────────────────────── // ───────────────────────────────────────────────
// System configuration / operation registers // System configuration / operation registers
// ─────────────────────────────────────────────── // ───────────────────────────────────────────────
//[HoldingRegister<UInt32>(12294, writable: true)] private UInt32 _threePhaseWireSystem; // 0x3006 [HoldingRegister<UInt32>(12294, writable: true)] private UInt32 _threePhaseWireSystem; // 0x3006
//[HoldingRegister<UInt32>(12296, writable: true)] private UInt32 _remainnotused; // 0x3008 //[HoldingRegister<UInt32>(12296, writable: true)] private UInt32 _remainnotused; // 0x3008
//[HoldingRegister<UInt32>(12298, writable: true)] private UInt32 _inputFrequencyClass; // 0x300A [HoldingRegister<UInt32>(12298, writable: true)] private UInt32 _inputFrequencyClass; // 0x300A
[HoldingRegister<UInt32>(12300, writable: true)] private UInt32 _workingMode; // 0x300C [HoldingRegister<UInt32>(12300, writable: true)] private UInt32 _workingMode; // 0x300C
//[HoldingRegister<UInt32>(12302, writable: true)] private UInt32 _methodSwitchMode; // 0x300E [HoldingRegister<UInt32>(12302, writable: true)] private UInt32 _methodSwitchMode; // 0x300E
// ─────────────────────────────────────────────── // ───────────────────────────────────────────────
// Inverter Control and Protection Configuration // Inverter Control and Protection Configuration
// ─────────────────────────────────────────────── // ───────────────────────────────────────────────
//[HoldingRegister<UInt32>(12304, writable: true)] private UInt32 _enableOnGridUnbalanceCompensation; // 0x3010 [HoldingRegister<UInt32>(12304, writable: true)] private UInt32 _enableOnGridUnbalanceCompensation; // 0x3010
//[HoldingRegister<UInt32>(12306, writable: true)] private UInt32 _temperatureDrop; // 0x3012 //[HoldingRegister<UInt32>(12306, writable: true)] private UInt32 _temperatureDrop; // 0x3012
//[HoldingRegister<UInt32>(12308, writable: true)] private UInt32 _hvrt; // 0x3014 //[HoldingRegister<UInt32>(12308, writable: true)] private UInt32 _hvrt; // 0x3014
//[HoldingRegister<UInt32>(12310, writable: true)] private UInt32 _lvrt; // 0x3016 //[HoldingRegister<UInt32>(12310, writable: true)] private UInt32 _lvrt; // 0x3016
@ -243,53 +415,60 @@ public partial class SinexcelRecord
// ─────────────────────────────────────────────── // ───────────────────────────────────────────────
// Battery & PV Configuration // Battery & PV Configuration
// ─────────────────────────────────────────────── // ───────────────────────────────────────────────
//[HoldingRegister<UInt32>(12336, writable: true)] private UInt32 _batteryAccessMethod; // 0x3030 [HoldingRegister<UInt32>(12336, writable: true)] private UInt32 _batteryAccessMethod; // 0x3030
//[HoldingRegister<UInt32>(12338, writable: true)] private UInt32 _meterAccessEnable; // 0x3032 [HoldingRegister<UInt32>(12338, writable: true)] private UInt32 _meterAccessEnable; // 0x3032
//[HoldingRegister<UInt32>(12340, writable: true)] private UInt32 _enableBattery1; // 0x3034 [HoldingRegister<UInt32>(12340, writable: true)] private UInt32 _enableBattery1; // 0x3034
//[HoldingRegister<UInt32>(12342, writable: true)] private UInt32 _enableBattery2; // 0x3036 [HoldingRegister<UInt32>(12342, writable: true)] private UInt32 _enableBattery2; // 0x3036
//[HoldingRegister<UInt32>(12344, writable: true)] private UInt32 _enablePv1; // 0x3038 [HoldingRegister<UInt32>(12344, writable: true)] private UInt32 _enablePv1; // 0x3038
//[HoldingRegister<UInt32>(12346, writable: true)] private UInt32 _enablePv2; // 0x303A [HoldingRegister<UInt32>(12346, writable: true)] private UInt32 _enablePv2; // 0x303A
//[HoldingRegister<UInt32>(12348, writable: true)] private UInt32 _batteryType; // 0x303C [HoldingRegister<UInt32>(12348, writable: true)] private UInt32 _batteryType; // 0x303C
//[HoldingRegister<UInt32>(12350, writable: true)] private UInt32 _batteryCapacity1; // 0x303E [HoldingRegister<UInt32>(12350, writable: true)] private UInt32 _batteryCapacity1; // 0x303E
//[HoldingRegister<UInt32>(12352, writable: true)] private UInt32 _maxChargingCurrentBattery1; // 0x3040 [HoldingRegister<UInt32>(12352, writable: true)] private UInt32 _maxChargingCurrentBattery1; // 0x3040
//[HoldingRegister<UInt32>(12354, writable: true)] private UInt32 _maxDischargingCurrentBattery1; // 0x3042 [HoldingRegister<UInt32>(12354, writable: true)] private UInt32 _maxDischargingCurrentBattery1; // 0x3042
//[HoldingRegister<UInt32>(12362, writable: true)] private UInt32 _ratedBatteryVoltage1; // 0x304A [HoldingRegister<UInt32>(12356, writable: true)] private UInt32 _ratedBatteryVoltage1; // 0x304A
//[HoldingRegister<UInt32>(12358, writable: true)] private UInt32 _minSocBattery1; // 0x3046 [HoldingRegister<UInt32>(12358, writable: true)] private UInt32 _minSocBattery1; // 0x3046
//[HoldingRegister<UInt32>(12360, writable: true)] private UInt32 _setValueBattery1; // 0x3048 [HoldingRegister<UInt32>(12360, writable: true)] private UInt32 _setValueBattery1; // 0x3048
//[HoldingRegister<UInt32>(12364, writable: true)] private UInt32 _activeChargeDischarge; // 0x304A //[HoldingRegister<UInt32>(12362, writable: true)] private UInt32 _activeChargeDischarge; // 0x304A // this
//[HoldingRegister<UInt32>(12366, writable: true)] private UInt32 _activeChargeDischargePower; // 0x304C [HoldingRegister<UInt32>(12364, writable: true)] private UInt32 _activeChargeDischargePower; // 0x304C
//[HoldingRegister<UInt32>(12380, writable: true)] private UInt32 _enableIslandProtection; // 0x305C [HoldingRegister<UInt32>(12380, writable: true)] private UInt32 _enableIslandProtection; // 0x305C
//[HoldingRegister<UInt32>(12382, writable: true)] private UInt32 _pvAccessMode; // 0x305E [HoldingRegister<UInt32>(12382, writable: true)] private UInt32 _pvAccessMode; // 0x305E
// ─────────────────────────────────────────────── // ───────────────────────────────────────────────
// System & Battery-2 Configuration // System & Battery-2 Configuration
// ─────────────────────────────────────────────── // ───────────────────────────────────────────────
//[HoldingRegister<UInt32>(12384, writable: true)] private UInt32 _outputVoltageAdjustmentFactor; // 0x3060 [HoldingRegister<UInt32>(12384, writable: true)] private UInt32 _outputVoltageAdjustmentFactor; // 0x3060
//[HoldingRegister<UInt32>(12386, writable: true)] private UInt32 _setValueBatteryUndervoltage1; // 0x3062 [HoldingRegister<UInt32>(12386, writable: true)] private UInt32 _setValueBatteryUndervoltage1; // 0x3062
//[HoldingRegister<UInt32>(12388, writable: true)] private UInt32 _inverterPowerLimit; // 0x3064 [HoldingRegister<UInt32>(12388, writable: true)] private UInt32 _inverterPowerLimit; // 0x3064
//[HoldingRegister<UInt32>(12400, writable: true)] private UInt32 _battery2Capacity; // 0x30B0 [HoldingRegister<UInt32>(12400, writable: true)] private UInt32 _battery2Capacity; // 0x30B0
//[HoldingRegister<UInt32>(12402, writable: true)] private UInt32 _maxChargingCurrentBattery2; // 0x30B2 [HoldingRegister<UInt32>(12402, writable: true)] private UInt32 _maxChargingCurrentBattery2; // 0x30B2
//[HoldingRegister<UInt32>(12404, writable: true)] private UInt32 _maxDischargingCurrentBattery2; // 0x30B4 [HoldingRegister<UInt32>(12404, writable: true)] private UInt32 _maxDischargingCurrentBattery2; // 0x30B4
//[HoldingRegister<UInt32>(12406, writable: true)] private UInt32 _battery2RatedVoltage; // 0x30B6 [HoldingRegister<UInt32>(12406, writable: true)] private UInt32 _battery2RatedVoltage; // 0x30B6
//[HoldingRegister<UInt32>(12408, writable: true)] private UInt32 _battery2MinSoc; // 0x30B8 [HoldingRegister<UInt32>(12408, writable: true)] private UInt32 _battery2MinSoc; // 0x30B8
//[HoldingRegister<UInt32>(12410, writable: true)] private UInt32 _battery2OverVoltageSetting; // 0x30BA [HoldingRegister<UInt32>(12410, writable: true)] private UInt32 _battery2OverVoltageSetting; // 0x30BA
//[HoldingRegister<UInt32>(12412, writable: true)] private UInt32 _battery2UnderVoltageSetpoint; // 0x30BC [HoldingRegister<UInt32>(12412, writable: true)] private UInt32 _battery2UnderVoltageSetpoint; // 0x30BC
// //
//[HoldingRegister<UInt32>(12414, writable: true)] private UInt32 _singleOrParallelMachine; // 0x30BE [HoldingRegister<UInt32>(12414, writable: true)] private UInt32 _singleOrParallelMachine; // 0x30BE
//[HoldingRegister<UInt32>(12416, writable: true)] private UInt32 _numberOfSystemModules; // 0x30C0 [HoldingRegister<UInt32>(12416, writable: true)] private UInt32 _numberOfSystemModules; // 0x30C0
//[HoldingRegister<UInt32>(12418, writable: true)] private UInt32 _parallelModuleMachineNumber; // 0x30C2 [HoldingRegister<UInt32>(12418, writable: true)] private UInt32 _parallelModuleMachineNumber; // 0x30C2
//[HoldingRegister<UInt32>(12420, writable: true)] private UInt32 _accreditedCountries; // 0x30C4 [HoldingRegister<UInt32>(12420, writable: true)] private UInt32 _accreditedCountries; // 0x30C4
[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
// ─────────────────────────────────────────────── // ───────────────────────────────────────────────
// System Control & Diagnostic Registers // System Control & Diagnostic Registers
// ─────────────────────────────────────────────── // ───────────────────────────────────────────────
[HoldingRegister<UInt32>(15426, writable: true)] private UInt32 _powerOn; // 0x3C42 [HoldingRegister<UInt32>(15426, writable: true)] private UInt32 _powerOn; // 0x3C42
[HoldingRegister<UInt32>(15428, writable: true)] private UInt32 _powerOff; // 0x3C44 [HoldingRegister<UInt32>(15428, writable: true)] private UInt32 _powerOff; // 0x3C44
//[HoldingRegister<UInt32>(15430, writable: true)] private UInt32 _faultClearing; // 0x3C46 [HoldingRegister<UInt32>(15430, writable: true)] private UInt32 _faultClearing; // 0x3C46
//[HoldingRegister<UInt32>(15518, writable: true)] private UInt32 _meterReverseManualDetection; // 0x3C9E [HoldingRegister<UInt32>(15518, writable: true)] private UInt32 _meterReverseManualDetection; // 0x3C9E
//[HoldingRegister<UInt32>(15520, writable: true)] private UInt32 _batteryVoltageRating; // 0x3CA0 //[HoldingRegister<UInt32>(15520, writable: true)] private UInt32 _batteryVoltageRating; // 0x3CA0 This causing the inverter to switch off, please consider testing it first before uncommenting
//[HoldingRegister<UInt32>(15524, writable: true)] private UInt32 _battery1Activation; // 0x3CA4 [HoldingRegister<UInt32>(15522, writable: true)] private UInt32 _battery1Activation; // 0x3CA2
//[HoldingRegister<UInt32>(15526, writable: true)] private UInt32 _battery2Activation; // 0x3CA6 [HoldingRegister<UInt32>(15524, writable: true)] private UInt32 _battery2Activation; // 0x3CA4
// ─────────────────────────────────────────────── // ───────────────────────────────────────────────
@ -337,8 +516,6 @@ public partial class SinexcelRecord
// Time-based scheduling (period 1) configuration // Time-based scheduling (period 1) configuration
// ─────────────────────────────────────────────── // ───────────────────────────────────────────────
//[HoldingRegister<UInt32>(49328, writable: true)] private UInt32 _Timed_Charge_and_Discharge_Off; // 0xC0B4, bit flags SunSat
//[HoldingRegister<UInt32>(49330, writable: true)] private UInt32 _Other_time_period_mode; // 0xC0B4, bit flags SunSat
[HoldingRegister<UInt32>(49332, writable: true)] private UInt32 _repetitiveWeeks; // 0xC0B4, bit flags SunSat [HoldingRegister<UInt32>(49332, writable: true)] private UInt32 _repetitiveWeeks; // 0xC0B4, bit flags SunSat
[HoldingRegister<UInt32>(49334, writable: true)] private UInt32 _effectiveStartDate; // 0xC0B6, UNIX timestamp (UTC+offset) [HoldingRegister<UInt32>(49334, writable: true)] private UInt32 _effectiveStartDate; // 0xC0B6, UNIX timestamp (UTC+offset)
[HoldingRegister<UInt32>(49336, writable: true)] private UInt32 _effectiveEndDate; // 0xC0B8, UNIX timestamp (UTC+offset) [HoldingRegister<UInt32>(49336, writable: true)] private UInt32 _effectiveEndDate; // 0xC0B8, UNIX timestamp (UTC+offset)