use of io.openems.impl.protocol.modbus.internal.SignedWordElement in project openems by OpenEMS.
the class FeneconCommercialCharger method defineModbusProtocol.
/*
* Methods
*/
@Override
protected ModbusProtocol defineModbusProtocol() throws ConfigException {
ModbusProtocol protocol = new //
ModbusProtocol(new WriteableModbusRegisterRange(0x0503, new UnsignedWordElement(0x0503, pvPowerLimitCommand = new ModbusWriteLongChannel("PvPowerLimitCommand", this).multiplier(2).unit("W"))), new //
ModbusRegisterRange(//
0xA000, new UnsignedWordElement(0xA000, bmsDCDCWorkState = //
new ModbusReadLongChannel("BmsDCDCWorkState", this).label(2, //
"Initial").label(4, //
"Stop").label(8, //
"Ready").label(16, //
"Running").label(32, //
"Fault").label(64, //
"Debug").label(128, "Locked")), new UnsignedWordElement(0xA001, bmsDCDCWorkMode = //
new ModbusReadLongChannel("BmsDCDCWorkMode", this).label(128, //
"Constant Current").label(256, //
"Constant Voltage").label(512, "Boost MPPT"))), new //
ModbusRegisterRange(//
0xA100, new //
UnsignedWordElement(//
0xA100, //
new ModbusBitWrappingChannel("BmsDCDCSuggestiveInformation1", this, this.thingState).warningBit(0, //
WarningCharger.CurrentSamplingChannelAbnormityOnHighVoltageSide).warningBit(1, //
WarningCharger.CurrentSamplingChannelAbnormityOnLowVoltageSide).warningBit(6, //
WarningCharger.EEPROMParametersOverRange).warningBit(7, //
WarningCharger.UpdateEEPROMFailed).warningBit(8, //
WarningCharger.ReadEEPROMFailed).warningBit(9, //
WarningCharger.CurrentSamplingChannelAbnormityBeforeInductance)), new //
UnsignedWordElement(//
0xA101, //
new ModbusBitWrappingChannel("BmsDCDCSuggestiveInformation2", this, this.thingState).warningBit(0, //
WarningCharger.ReactorPowerDecreaseCausedByOvertemperature).warningBit(1, //
WarningCharger.IGBTPowerDecreaseCausedByOvertemperature).warningBit(2, //
WarningCharger.TemperatureChanel3PowerDecreaseCausedByOvertemperature).warningBit(3, //
WarningCharger.TemperatureChanel4PowerDecreaseCausedByOvertemperature).warningBit(4, //
WarningCharger.TemperatureChanel5PowerDecreaseCausedByOvertemperature).warningBit(5, //
WarningCharger.TemperatureChanel6PowerDecreaseCausedByOvertemperature).warningBit(6, //
WarningCharger.TemperatureChanel7PowerDecreaseCausedByOvertemperature).warningBit(7, //
WarningCharger.TemperatureChanel8PowerDecreaseCausedByOvertemperature).warningBit(8, //
WarningCharger.Fan1StopFailed).warningBit(9, //
WarningCharger.Fan2StopFailed).warningBit(10, //
WarningCharger.Fan3StopFailed).warningBit(11, //
WarningCharger.Fan4StopFailed).warningBit(12, //
WarningCharger.Fan1StartupFailed).warningBit(13, //
WarningCharger.Fan2StartupFailed).warningBit(14, //
WarningCharger.Fan3StartupFailed).warningBit(15, //
WarningCharger.Fan4StartupFailed)), new //
UnsignedWordElement(//
0xA102, //
new ModbusBitWrappingChannel("BmsDCDCSuggestiveInformation3", this, this.thingState).warningBit(0, //
WarningCharger.HighVoltageSideOvervoltage).warningBit(1, //
WarningCharger.HighVoltageSideUndervoltage).warningBit(2, //
WarningCharger.HighVoltageSideVoltageChangeUnconventionally)), new //
UnsignedWordElement(//
0xA103, //
new ModbusBitWrappingChannel("BmsDCDCSuggestiveInformation4", this, this.thingState).warningBit(0, WarningCharger.CurrentAbnormityBeforeDCConverterWorkOnHighVoltageSide).warningBit(1, WarningCharger.CurrentAbnormityBeforeDCConverterWorkOnLowVoltageSXide).warningBit(2, WarningCharger.InitialDutyRatioAbnormityBeforeDCConverterWork).warningBit(3, WarningCharger.VoltageAbnormityBeforeDCConverterWorkOnHighVoltageSide).warningBit(4, WarningCharger.VoltageAbnormityBeforeDCConverterWorkOnLowVoltageSide)), new UnsignedWordElement(0xA104, //
new ModbusBitWrappingChannel("BmsDCDCSuggestiveInformation5", this, this.thingState).warningBit(0, //
WarningCharger.HighVoltageBreakerInspectionAbnormity).warningBit(1, //
WarningCharger.LowVoltageBreakerInspectionAbnormity).warningBit(2, //
WarningCharger.BsmDCDC5DCPrechargeContactorInspectionAbnormity).warningBit(3, //
WarningCharger.DCPrechargeContactorOpenUnsuccessfully).warningBit(4, //
WarningCharger.DCMainContactorInspectionAbnormity).warningBit(5, //
WarningCharger.DCMainContactorOpenUnsuccessfully).warningBit(6, //
WarningCharger.OutputContactorCloseUnsuccessfully).warningBit(7, //
WarningCharger.OutputContactorOpenUnsuccessfully).warningBit(8, //
WarningCharger.ACMainContactorCloseUnsuccessfully).warningBit(9, //
WarningCharger.ACMainContactorOpenUnsuccessfully).warningBit(10, //
WarningCharger.NegContactorOpenUnsuccessfully).warningBit(11, //
WarningCharger.NegContactorCloseUnsuccessfully).warningBit(12, //
WarningCharger.NegContactorStateAbnormal)), new DummyElement(0xA105, 0xA10F), new //
UnsignedWordElement(//
0xA110, //
new ModbusBitWrappingChannel("BmsDCDCAbnormity1", this, this.thingState).faultBit(0, //
FaultCharger.HighVoltageSideOfDCConverterUndervoltage).faultBit(1, //
FaultCharger.HighVoltageSideOfDCConverterOvervoltage).faultBit(2, //
FaultCharger.LowVoltageSideOfDCConverterUndervoltage).faultBit(3, //
FaultCharger.LowVoltageSideOfDCConverterOvervoltage).faultBit(4, //
FaultCharger.HighVoltageSideOfDCConverterOvercurrentFault).faultBit(5, //
FaultCharger.LowVoltageSideOfDCConverterOvercurrentFault).faultBit(6, //
FaultCharger.DCConverterIGBTFault).faultBit(7, //
FaultCharger.DCConverterPrechargeUnmet)), new UnsignedWordElement(0xA111, //
new ModbusBitWrappingChannel("BmsDCDCAbnormity2", this, this.thingState).faultBit(0, //
FaultCharger.BECUCommunicationDisconnected).faultBit(1, //
FaultCharger.DCConverterCommunicationDisconnected).faultBit(2, //
FaultCharger.CurrentConfigurationOverRange).faultBit(3, //
FaultCharger.TheBatteryRequestStop).faultBit(5, //
FaultCharger.OvercurrentRelayFault).faultBit(6, //
FaultCharger.LightningProtectionDeviceFault).faultBit(7, //
FaultCharger.DCConverterPriamaryContactorDisconnectedAbnormally).faultBit(9, //
FaultCharger.DCDisconnectedAbnormallyOnLowVoltageSideOfDCConvetor).faultBit(12, //
FaultCharger.DCConvetorEEPROMAbnormity1).faultBit(13, //
FaultCharger.DCConvetorEEPROMAbnormity1Second).faultBit(14, //
FaultCharger.EDCConvetorEEPROMAbnormity1)), new //
UnsignedWordElement(//
0xA112, //
new ModbusBitWrappingChannel("BmsDCDCAbnormity3", this, this.thingState).faultBit(0, //
FaultCharger.DCConvertorGeneralOverload).faultBit(1, //
FaultCharger.DCShortCircuit).faultBit(2, //
FaultCharger.PeakPulseCurrentProtection).faultBit(3, //
FaultCharger.DCDisconnectAbnormallyOnHighVoltageSideOfDCConvetor).faultBit(4, //
FaultCharger.EffectivePulseValueOverhigh).faultBit(5, //
FaultCharger.DCConverteSevereOverload).faultBit(6, //
FaultCharger.DCBreakerDisconnectAbnormallyOnHighVoltageSideOfDCConvetor).faultBit(7, //
FaultCharger.DCBreakerDisconnectAbnormallyOnLowVoltageSideOfDCConvetor).faultBit(8, //
FaultCharger.DCConvetorPrechargeContactorCloseFailed).faultBit(9, //
FaultCharger.DCConvetorMainContactorCloseFailed).faultBit(10, //
FaultCharger.ACContactorStateAbnormityOfDCConvetor).faultBit(11, //
FaultCharger.DCConvetorEmergencyStop).faultBit(12, //
FaultCharger.DCConverterChargingGunDisconnected).faultBit(13, //
FaultCharger.DCCurrentAbnormityBeforeDCConvetorWork).faultBit(14, //
FaultCharger.FuSeDisconnected).faultBit(15, //
FaultCharger.DCConverterHardwareCurrentOrVoltageFault)), new //
UnsignedWordElement(//
0xA113, //
new ModbusBitWrappingChannel("BmsDCDCAbnormity4", this, this.thingState).faultBit(0, //
FaultCharger.DCConverterCrystalOscillatorCircuitInvalidation).faultBit(1, //
FaultCharger.DCConverterResetCircuitInvalidation).faultBit(2, //
FaultCharger.DCConverterSamplingCircuitInvalidation).faultBit(3, //
FaultCharger.DCConverterDigitalIOCircuitInvalidation).faultBit(4, //
FaultCharger.DCConverterPWMCircuitInvalidation).faultBit(5, //
FaultCharger.DCConverterX5045CircuitInvalidation).faultBit(6, //
FaultCharger.DCConverterCANCircuitInvalidation).faultBit(7, //
FaultCharger.DCConverterSoftwareANDHardwareProtectionCircuitInvalidation).faultBit(8, //
FaultCharger.DCConverterPowerCircuitInvalidation).faultBit(9, //
FaultCharger.DCConverterCPUInvalidation).faultBit(10, //
FaultCharger.DCConverterTINT0InterruptInvalidation).faultBit(11, //
FaultCharger.DCConverterADCInterruptInvalidation).faultBit(12, //
FaultCharger.DCConverterCAPITN4InterruptInvalidation).faultBit(13, //
FaultCharger.DCConverterCAPINT6InterruptInvalidation).faultBit(14, //
FaultCharger.DCConverterT3PINTinterruptInvalidation).faultBit(15, //
FaultCharger.DCConverterT4PINTinterruptInvalidation)), new //
UnsignedWordElement(//
0xA114, //
new ModbusBitWrappingChannel("BmsDCDCAbnormity5", this, this.thingState).faultBit(0, //
FaultCharger.DCConverterPDPINTAInterruptInvalidation).faultBit(1, //
FaultCharger.DCConverterT1PINTInterruptInvalidation).faultBit(2, //
FaultCharger.DCConverterRESVInterruptInvalidation).faultBit(3, //
FaultCharger.DCConverter100usTaskInvalidation).faultBit(4, //
FaultCharger.DCConverterClockInvalidation).faultBit(5, //
FaultCharger.DCConverterEMSMemoryInvalidation).faultBit(6, //
FaultCharger.DCConverterExteriorCommunicationInvalidation).faultBit(7, //
FaultCharger.DCConverterIOInterfaceInvalidation).faultBit(8, //
FaultCharger.DCConverterInputVoltageBoundFault).faultBit(9, //
FaultCharger.DCConverterOutterVoltageBoundFault).faultBit(10, //
FaultCharger.DCConverterOutputVoltageBoundFault).faultBit(11, //
FaultCharger.DCConverterInductCurrentBoundFault).faultBit(12, //
FaultCharger.DCConverterInputCurrentBoundFault).faultBit(13, //
FaultCharger.DCConverterOutputCurrentBoundFault)), new //
UnsignedWordElement(//
0xA115, //
new ModbusBitWrappingChannel("BmsDCDCAbnormity6", this, this.thingState).faultBit(0, //
FaultCharger.DCReactorOverTemperature).faultBit(1, //
FaultCharger.DCIGBTOverTemperature).faultBit(2, //
FaultCharger.DCConverterChanel3OverTemperature).faultBit(3, //
FaultCharger.DCConverterChanel4OverTemperature).faultBit(4, //
FaultCharger.DCConverterChanel5OverTemperature).faultBit(5, //
FaultCharger.DCConverterChanel6OverTemperature).faultBit(6, //
FaultCharger.DCConverterChanel7OverTemperature).faultBit(7, //
FaultCharger.DCConverterChanel8OverTemperature).faultBit(8, //
FaultCharger.DCReactorTemperatureSamplingInvalidation).faultBit(9, //
FaultCharger.DCIGBTTemperatureSamplingInvalidation).faultBit(10, //
FaultCharger.DCConverterChanel3TemperatureSamplingInvalidation).faultBit(11, //
FaultCharger.DCConverterChanel4TemperatureSamplingInvalidation).faultBit(12, //
FaultCharger.DCConverterChanel5TemperatureSamplingInvalidation).faultBit(13, //
FaultCharger.DCConverterChanel6TemperatureSamplingInvalidation).faultBit(14, //
FaultCharger.DCConverterChanel7TemperatureSamplingInvalidation).faultBit(15, //
FaultCharger.DCConverterChanel8TemperatureSamplingInvalidation)), new UnsignedWordElement(0xA116, //
new ModbusBitWrappingChannel("BmsDCDCAbnormity7", this, this.thingState).faultBit(4, //
FaultCharger.DCConverterInductanceCurrentSamplingInvalidation).faultBit(5, //
FaultCharger.CurrentSamplingInvalidationOnTheLowVoltageSideOfDCConverter).faultBit(6, //
FaultCharger.VoltageSamplingInvalidationOnTheLowVoltageSideOfDCConverter).faultBit(7, //
FaultCharger.InsulationInspectionFault).faultBit(8, //
FaultCharger.NegContactorCloseUnsuccessly).faultBit(9, //
FaultCharger.NegContactorCutWhenRunning)), new DummyElement(0xA117, 0xA11F), new UnsignedWordElement(0xA120, bmsDCDCSwitchState = //
new StatusBitChannel("BmsDCDCSwitchState", this).label(1, //
"DC precharge contactor").label(2, //
"DC main contactor").label(4, //
"Output contactor").label(8, //
"Output breaker").label(16, //
"Input breaker").label(32, //
"AC contactor").label(64, //
"Emergency stop button").label(128, "NegContactor"))), new //
ModbusRegisterRange(//
0xA130, new SignedWordElement(0xA130, bmsDCDCOutputVoltage = new ModbusReadLongChannel("BmsDCDCOutputVoltage", this).unit("mV").multiplier(2)), new SignedWordElement(0xA131, bmsDCDCOutputCurrent = new ModbusReadLongChannel("BmsDCDCOutputCurrent", this).unit("mA").multiplier(2)), new SignedWordElement(0xA132, bmsDCDCOutputPower = new ModbusReadLongChannel("BmsDCDCOutputPower", this).unit("W").multiplier(2)), new SignedWordElement(0xA133, bmsDCDCInputVoltage = new ModbusReadLongChannel("BmsDCDCInputVoltage", this).unit("mV").multiplier(2)), new SignedWordElement(0xA134, bmsDCDCInputCurrent = new ModbusReadLongChannel("BmsDCDCInputCurrent", this).unit("mA").multiplier(2)), new SignedWordElement(0xA135, bmsDCDCInputPower = new ModbusReadLongChannel("BmsDCDCInputPower", this).unit("W").multiplier(2)), new SignedWordElement(0xA136, bmsDCDCInputEnergy = new ModbusReadLongChannel("BmsDCDCInputEnergy", this).unit("Wh").multiplier(2)), new SignedWordElement(0xA137, bmsDCDCOutputEnergy = new ModbusReadLongChannel("BmsDCDCOutputEnergy", this).unit("Wh").multiplier(2)), new DummyElement(0xA138, 0xA13F), new SignedWordElement(0xA140, bmsDCDCReactorTemperature = new ModbusReadLongChannel("BmsDCDCReactorTemperature", this).unit("°C")), new SignedWordElement(0xA141, bmsDCDCIgbtTemperature = new ModbusReadLongChannel("BmsDCDCIgbtTemperature", this).unit("°C")), new DummyElement(0xA142, 0xA14F), new UnsignedDoublewordElement(0xA150, bmsDCDCInputTotalChargeEnergy = new ModbusReadLongChannel("BmsDCDCInputTotalChargeEnergy", this).unit("Wh").multiplier(2)).wordOrder(WordOrder.LSWMSW), new UnsignedDoublewordElement(0xA152, bmsDCDCInputTotalDischargeEnergy = new ModbusReadLongChannel("BmsDCDCInputTotalDischargeEnergy", this).unit("Wh").multiplier(2)).wordOrder(WordOrder.LSWMSW), new UnsignedDoublewordElement(0xA154, bmsDCDCOutputTotalChargeEnergy = new ModbusReadLongChannel("BmsDCDCOutputTotalChargeEnergy", this).unit("Wh").multiplier(2)).wordOrder(WordOrder.LSWMSW), new UnsignedDoublewordElement(0xA156, bmsDCDCOutputTotalDischargeEnergy = new ModbusReadLongChannel("BmsDCDCOutputTotalDischargeEnergy", this).unit("Wh").multiplier(2)).wordOrder(WordOrder.LSWMSW)), new //
ModbusRegisterRange(//
0xA300, new UnsignedWordElement(0xA300, bmsDCDC1WorkState = //
new ModbusReadLongChannel("BmsDCDC1WorkState", this).label(2, //
"Initial").label(4, //
"Stop").label(8, //
"Ready").label(16, //
"Running").label(32, //
"Fault").label(64, //
"Debug").label(128, "Locked")), new UnsignedWordElement(0xA301, bmsDCDC1WorkMode = //
new ModbusReadLongChannel("BmsDCDC1WorkMode", this).label(128, //
"Constant Current").label(256, //
"Constant Voltage").label(512, "Boost MPPT"))), new //
ModbusRegisterRange(//
0xA400, new //
UnsignedWordElement(//
0xA400, // used BsmDCDC1 as prefix on each one if it is used before
//
new ModbusBitWrappingChannel("BmsDCDC1SuggestiveInformation1", this, this.thingState).warningBit(0, //
WarningCharger.BsmDCDC1CurrentSamplingChannelAbnormityOnHighVoltageSide).warningBit(1, //
WarningCharger.BsmDCDC1CurrentSamplingChannelAbnormityOnLowVoltageSide).warningBit(6, //
WarningCharger.BmsDCDC1EEPROMParametersOverRange).warningBit(7, //
WarningCharger.BsmDCDC1UpdateEEPROMFailed).warningBit(8, //
WarningCharger.BsmDCDC1ReadEEPROMFailed).warningBit(9, //
WarningCharger.BsmDCDC1CurrentSamplingChannelAbnormityBeforeInductance)), new //
UnsignedWordElement(//
0xA401, // Prefix = "BsmDCDC1"
//
new ModbusBitWrappingChannel("BmsDCDC1SuggestiveInformation2", this, this.thingState).warningBit(0, //
WarningCharger.BsmDCDC1ReactorPowerDecreaseCausedByOvertemperature).warningBit(1, //
WarningCharger.BsmDCDC1IGBTPowerDecreaseCausedByOvertemperature).warningBit(2, //
WarningCharger.BsmDCDC1TemperatureChanel3PowerDecreaseCausedByOvertemperature).warningBit(3, //
WarningCharger.BsmDCDC1TemperatureChanel4PowerDecreaseCausedByOvertemperature).warningBit(4, //
WarningCharger.BsmDCDC1TemperatureChanel5PowerDecreaseCausedByOvertemperature).warningBit(5, //
WarningCharger.BsmDCDC1TemperatureChanel6PowerDecreaseCausedByOvertemperature).warningBit(6, //
WarningCharger.BsmDCDC1TemperatureChanel7PowerDecreaseCausedByOvertemperature).warningBit(7, //
WarningCharger.BsmDCDC1TemperatureChanel8PowerDecreaseCausedByOvertemperature).warningBit(8, //
WarningCharger.BsmDCDC1Fan1StopFailed).warningBit(9, //
WarningCharger.BsmDCDC1Fan2StopFailed).warningBit(10, //
WarningCharger.BsmDCDC1Fan3StopFailed).warningBit(11, //
WarningCharger.BsmDCDC1Fan4StopFailed).warningBit(12, //
WarningCharger.BsmDCDC1Fan1StartupFailed).warningBit(13, //
WarningCharger.BsmDCDC1Fan2StartupFailed).warningBit(14, //
WarningCharger.BsmDCDC1Fan3StartupFailed).warningBit(15, //
WarningCharger.BsmDCDC1Fan4StartupFailed)), //
new //
UnsignedWordElement(//
0xA402, // prefix = "BsmDCDC1"
//
new ModbusBitWrappingChannel("BmsDCDC1SuggestiveInformation3", this, this.thingState).warningBit(0, //
WarningCharger.BsmDCDC1HighVoltageSideOvervoltage).warningBit(1, //
WarningCharger.BsmDCDC1HighVoltageSideUndervoltage).warningBit(2, //
WarningCharger.BsmDCDC1HighVoltageSideVoltageChangeUnconventionally)), new //
UnsignedWordElement(//
0xA403, // prefix = "BsmDCDC1"
//
new ModbusBitWrappingChannel("BmsDCDC1SuggestiveInformation4", this, this.thingState).warningBit(0, WarningCharger.BmsDCDC1CurrentAbnormityBeforeDCConverterWorkOnHighVoltageSide).warningBit(1, WarningCharger.BmsDCDC1CurrentAbnormityBeforeDCConverterWorkOnLowVoltageSXide).warningBit(2, WarningCharger.BmsDCDC1InitialDutyRatioAbnormityBeforeDCConverterWork).warningBit(3, WarningCharger.BmsDCDC1VoltageAbnormityBeforeDCConverterWorkOnHighVoltageSide).warningBit(4, WarningCharger.BmsDCDC1VoltageAbnormityBeforeDCConverterWorkOnLowVoltageSide)), new //
UnsignedWordElement(//
0xA404, // prefix = "BsmDCDC1"
//
new ModbusBitWrappingChannel("BmsDCDC1SuggestiveInformation5", this, this.thingState).warningBit(0, //
WarningCharger.BmsDCDC1HighVoltageBreakerInspectionAbnormity).warningBit(1, //
WarningCharger.BmsDCDC1LowVoltageBreakerInspectionAbnormity).warningBit(2, //
WarningCharger.BmsDCDC1BsmDCDC5DCPrechargeContactorInspectionAbnormity).warningBit(3, //
WarningCharger.BmsDCDC1DCPrechargeContactorOpenUnsuccessfully).warningBit(4, //
WarningCharger.BmsDCDC1DCMainContactorInspectionAbnormity).warningBit(5, //
WarningCharger.BmsDCDC1DCMainContactorOpenUnsuccessfully).warningBit(6, //
WarningCharger.BmsDCDC1OutputContactorCloseUnsuccessfully).warningBit(7, //
WarningCharger.BmsDCDC1OutputContactorOpenUnsuccessfully).warningBit(8, //
WarningCharger.BmsDCDC1ACMainContactorCloseUnsuccessfully).warningBit(9, //
WarningCharger.BmsDCDC1ACMainContactorOpenUnsuccessfully).warningBit(10, //
WarningCharger.BmsDCDC1NegContactorOpenUnsuccessfully).warningBit(11, //
WarningCharger.BmsDCDC1NegContactorCloseUnsuccessfully).warningBit(12, //
WarningCharger.BmsDCDC1NegContactorStateAbnormal)), new DummyElement(0xA405, 0xA40F), new UnsignedWordElement(0xA410, // prefix = "BsmDCDC1"
//
new ModbusBitWrappingChannel("BmsDCDC1Abnormity1", this, this.thingState).faultBit(0, //
FaultCharger.BmsDCDC1HighVoltageSideOfDCConverterUndervoltage).faultBit(1, //
FaultCharger.BmsDCDC1HighVoltageSideOfDCConverterOvervoltage).faultBit(2, //
FaultCharger.BmsDCDC1LowVoltageSideOfDCConverterUndervoltage).faultBit(3, //
FaultCharger.BmsDCDC1LowVoltageSideOfDCConverterOvervoltage).faultBit(4, //
FaultCharger.BmsDCDC1HighVoltageSideOfDCConverterOvercurrentFault).faultBit(5, //
FaultCharger.BmsDCDC1LowVoltageSideOfDCConverterOvercurrentFault).faultBit(6, //
FaultCharger.BmsDCDC1DCConverterIGBTFault).faultBit(7, //
FaultCharger.BmsDCDC1DCConverterPrechargeUnmet)), new UnsignedWordElement(0xA411, // prefix = "BsmDCDC1"
//
new ModbusBitWrappingChannel("BmsDCDC1Abnormity2", this, this.thingState).faultBit(0, //
FaultCharger.BmsDCDC1BECUCommunicationDisconnected).faultBit(1, //
FaultCharger.BmsDCDC1DCConverterCommunicationDisconnected).faultBit(2, //
FaultCharger.BmsDCDC1CurrentConfigurationOverRange).faultBit(3, //
FaultCharger.BmsDCDC1TheBatteryRequestStop).faultBit(5, //
FaultCharger.BmsDCDC1OvercurrentRelayFault).faultBit(6, //
FaultCharger.BmsDCDC1LightningProtectionDeviceFault).faultBit(7, //
FaultCharger.BmsDCDC1DCConverterPriamaryContactorDisconnectedAbnormally).faultBit(9, //
FaultCharger.BmsDCDC1DCDisconnectedAbnormallyOnLowVoltageSideOfDCConvetor).faultBit(12, //
FaultCharger.BmsDCDC1DCConvetorEEPROMAbnormity1).faultBit(13, //
FaultCharger.BmsDCDC1DCConvetorEEPROMAbnormity1Second).faultBit(14, //
FaultCharger.BmsDCDC1EDCConvetorEEPROMAbnormity1)), new //
UnsignedWordElement(//
0xA412, // prefix = "BsmDCDC1"
//
new ModbusBitWrappingChannel("BmsDCDC1Abnormity3", this, this.thingState).faultBit(0, //
FaultCharger.BsmDCDC1DCConvertorGeneralOverload).faultBit(1, //
FaultCharger.BsmDCDC1DCShortCircuit).faultBit(2, //
FaultCharger.BsmDCDC1PeakPulseCurrentProtection).faultBit(3, //
FaultCharger.BsmDCDC1DCDisconnectAbnormallyOnHighVoltageSideOfDCConvetor).faultBit(4, //
FaultCharger.BsmDCDC1EffectivePulseValueOverhigh).faultBit(5, //
FaultCharger.BsmDCDC1DCConverteSevereOverload).faultBit(6, //
FaultCharger.BsmDCDC1DCBreakerDisconnectAbnormallyOnHighVoltageSideOfDCConvetor).faultBit(7, //
FaultCharger.BsmDCDC1DCBreakerDisconnectAbnormallyOnLowVoltageSideOfDCConvetor).faultBit(8, //
FaultCharger.BsmDCDC1DCConvetorPrechargeContactorCloseFailed).faultBit(9, //
FaultCharger.BsmDCDC1DCConvetorMainContactorCloseFailed).faultBit(10, //
FaultCharger.BsmDCDC1ACContactorStateAbnormityOfDCConvetor).faultBit(11, //
FaultCharger.BsmDCDC1DCConvetorEmergencyStop).faultBit(12, //
FaultCharger.BsmDCDC1DCConverterChargingGunDisconnected).faultBit(13, //
FaultCharger.BsmDCDC1DCCurrentAbnormityBeforeDCConvetorWork).faultBit(14, //
FaultCharger.BsmDCDC1FuSeDisconnected).faultBit(15, //
FaultCharger.BsmDCDC1DCConverterHardwareCurrentOrVoltageFault)), new UnsignedWordElement(0xA413, // prefix = "BsmDCDC1"
//
new ModbusBitWrappingChannel("BmsDCDC1Abnormity4", this, this.thingState).faultBit(0, //
FaultCharger.BmsDCDC1DCConverterCrystalOscillatorCircuitInvalidation).faultBit(1, //
FaultCharger.BmsDCDC1DCConverterResetCircuitInvalidation).faultBit(2, //
FaultCharger.BmsDCDC1DCConverterSamplingCircuitInvalidation).faultBit(3, //
FaultCharger.BmsDCDC1DCConverterDigitalIOCircuitInvalidation).faultBit(4, //
FaultCharger.BmsDCDC1DCConverterPWMCircuitInvalidation).faultBit(5, //
FaultCharger.BmsDCDC1DCConverterX5045CircuitInvalidation).faultBit(6, //
FaultCharger.BmsDCDC1DCConverterCANCircuitInvalidation).faultBit(7, //
FaultCharger.BmsDCDC1DCConverterSoftwareANDHardwareProtectionCircuitInvalidation).faultBit(8, //
FaultCharger.BmsDCDC1DCConverterPowerCircuitInvalidation).faultBit(9, //
FaultCharger.BmsDCDC1DCConverterCPUInvalidation).faultBit(10, //
FaultCharger.BmsDCDC1DCConverterTINT0InterruptInvalidation).faultBit(11, //
FaultCharger.BmsDCDC1DCConverterADCInterruptInvalidation).faultBit(12, //
FaultCharger.BmsDCDC1DCConverterCAPITN4InterruptInvalidation).faultBit(13, //
FaultCharger.BmsDCDC1DCConverterCAPINT6InterruptInvalidation).faultBit(14, //
FaultCharger.BmsDCDC1DCConverterT3PINTinterruptInvalidation).faultBit(15, //
FaultCharger.BmsDCDC1DCConverterT4PINTinterruptInvalidation)), //
new UnsignedWordElement(0xA414, // prefix = "BsmDCDC1"
//
new ModbusBitWrappingChannel("BmsDCDC1Abnormity5", this, this.thingState).faultBit(0, //
FaultCharger.BmsDCDC1DCConverterPDPINTAInterruptInvalidation).faultBit(1, //
FaultCharger.BmsDCDC1DCConverterT1PINTInterruptInvalidationSecond).faultBit(2, //
FaultCharger.BmsDCDC1DCConverterRESVInterruptInvalidation).faultBit(3, //
FaultCharger.BmsDCDC1DCConverter100usTaskInvalidation).faultBit(4, //
FaultCharger.BmsDCDC1DCConverterClockInvalidation).faultBit(5, //
FaultCharger.BmsDCDC1DCConverterEMSMemoryInvalidation).faultBit(6, //
FaultCharger.BmsDCDC1DCConverterExteriorCommunicationInvalidation).faultBit(7, //
FaultCharger.BmsDCDC1DCConverterIOInterfaceInvalidation).faultBit(8, //
FaultCharger.BmsDCDC1DCConverterInputVoltageBoundFault).faultBit(9, //
FaultCharger.BmsDCDC1DCConverterOutterVoltageBoundFault).faultBit(10, //
FaultCharger.BmsDCDC1DCConverterOutputVoltageBoundFault).faultBit(11, //
FaultCharger.BmsDCDC1DCConverterInductCurrentBoundFault).faultBit(12, //
FaultCharger.BmsDCDC1DCConverterInputCurrentBoundFault).faultBit(13, //
FaultCharger.BmsDCDC1DCConverterOutputCurrentBoundFault)), //
new UnsignedWordElement(0xA415, // prefix = "BsmDCDC1"
//
new ModbusBitWrappingChannel("BmsDCDC1Abnormity6", this, this.thingState).faultBit(0, //
FaultCharger.BmsDCDC1DCReactorOverTemperature).faultBit(1, //
FaultCharger.BmsDCDC1DCIGBTOverTemperature).faultBit(2, //
FaultCharger.BmsDCDC1DCConverterChanel3OverTemperature).faultBit(3, //
FaultCharger.BmsDCDC1DCConverterChanel4OverTemperature).faultBit(4, //
FaultCharger.BmsDCDC1DCConverterChanel5OverTemperature).faultBit(5, //
FaultCharger.BmsDCDC1DCConverterChanel6OverTemperature).faultBit(6, //
FaultCharger.BmsDCDC1DCConverterChanel7OverTemperature).faultBit(7, //
FaultCharger.BmsDCDC1DCConverterChanel8OverTemperature).faultBit(8, //
FaultCharger.BmsDCDC1DCReactorTemperatureSamplingInvalidation).faultBit(9, //
FaultCharger.BmsDCDC1DCIGBTTemperatureSamplingInvalidation).faultBit(10, //
FaultCharger.BmsDCDC1DCConverterChanel3TemperatureSamplingInvalidation).faultBit(11, //
FaultCharger.BmsDCDC1DCConverterChanel4TemperatureSamplingInvalidation).faultBit(12, //
FaultCharger.BmsDCDC1DCConverterChanel5TemperatureSamplingInvalidation).faultBit(13, //
FaultCharger.BmsDCDC1DCConverterChanel6TemperatureSamplingInvalidation).faultBit(14, //
FaultCharger.BmsDCDC1DCConverterChanel7TemperatureSamplingInvalidation).faultBit(15, //
FaultCharger.BmsDCDC1DCConverterChanel8TemperatureSamplingInvalidation)), //
new UnsignedWordElement(0xA416, // prefix = "BsmDCDC1"
//
new ModbusBitWrappingChannel("BmsDCDC1Abnormity7", this, this.thingState).faultBit(4, //
FaultCharger.BmsDCDC1DCConverterInductanceCurrentSamplingInvalidation).faultBit(5, //
FaultCharger.BmsDCDC1CurrentSamplingInvalidationOnTheLowVoltageSideOfDCConverter).faultBit(6, //
FaultCharger.BmsDCDC1VoltageSamplingInvalidationOnTheLowVoltageSideOfDCConverter).faultBit(7, //
FaultCharger.BmsDCDC1InsulationInspectionFault).faultBit(8, //
FaultCharger.BmsDCDC1NegContactorCloseUnsuccessly).faultBit(9, //
FaultCharger.BmsDCDC1NegContactorCutWhenRunning)), //
new DummyElement(0xA417, 0xA41F), new UnsignedWordElement(0xA420, bmsDCDC1SwitchState = //
new StatusBitChannel("BmsDCDC1SwitchState", this).label(1, //
"DC precharge contactor").label(2, //
"DC main contactor").label(4, //
"Output contactor").label(8, //
"Output breaker").label(16, //
"Input breaker").label(32, //
"AC contactor").label(64, //
"Emergency stop button").label(128, "NegContactor"))), new //
ModbusRegisterRange(//
0xA430, new SignedWordElement(0xA430, bmsDCDC1OutputVoltage = new ModbusReadLongChannel("BmsDCDC1OutputVoltage", this).unit("mV").multiplier(2)), new SignedWordElement(0xA431, bmsDCDC1OutputCurrent = new ModbusReadLongChannel("BmsDCDC1OutputCurrent", this).unit("mA").multiplier(2)), new SignedWordElement(0xA432, bmsDCDC1OutputPower = new ModbusReadLongChannel("BmsDCDC1OutputPower", this).unit("W").multiplier(2)), new SignedWordElement(0xA433, bmsDCDC1InputVoltage = new ModbusReadLongChannel("BmsDCDC1InputVoltage", this).unit("mV").multiplier(2)), new SignedWordElement(0xA434, bmsDCDC1InputCurrent = new ModbusReadLongChannel("BmsDCDC1InputCurrent", this).unit("mA").multiplier(2)), new SignedWordElement(0xA435, bmsDCDC1InputPower = new ModbusReadLongChannel("BmsDCDC1InputPower", this).unit("W").multiplier(2)), new SignedWordElement(0xA436, bmsDCDC1InputEnergy = new ModbusReadLongChannel("BmsDCDC1InputEnergy", this).unit("Wh").multiplier(2)), new SignedWordElement(0xA437, bmsDCDC1OutputEnergy = new ModbusReadLongChannel("BmsDCDC1OutputEnergy", this).unit("Wh").multiplier(2)), new DummyElement(0xA438, 0xA43F), new SignedWordElement(0xA440, bmsDCDC1ReactorTemperature = new ModbusReadLongChannel("BmsDCDC1ReactorTemperature", this).unit("°C")), new SignedWordElement(0xA441, bmsDCDC1IgbtTemperature = new ModbusReadLongChannel("BmsDCDC1IgbtTemperature", this).unit("°C")), new DummyElement(0xA442, 0xA44F), new UnsignedDoublewordElement(0xA450, bmsDCDC1InputTotalChargeEnergy = new ModbusReadLongChannel("BmsDCDC1InputTotalChargeEnergy", this).unit("Wh").multiplier(2)).wordOrder(WordOrder.LSWMSW), new UnsignedDoublewordElement(0xA452, bmsDCDC1InputTotalDischargeEnergy = new ModbusReadLongChannel("BmsDCDC1InputTotalDischargeEnergy", this).unit("Wh").multiplier(2)).wordOrder(WordOrder.LSWMSW), new UnsignedDoublewordElement(0xA454, bmsDCDC1OutputTotalChargeEnergy = new ModbusReadLongChannel("BmsDCDC1OutputTotalChargeEnergy", this).unit("Wh").multiplier(2)).wordOrder(WordOrder.LSWMSW), new UnsignedDoublewordElement(0xA456, bmsDCDC1OutputTotalDischargeEnergy = new ModbusReadLongChannel("BmsDCDC1OutputTotalDischargeEnergy", this).unit("Wh").multiplier(2)).wordOrder(WordOrder.LSWMSW)), new //
ModbusRegisterRange(//
0xA600, new UnsignedWordElement(0xA600, pvDCDCWorkState = //
new ModbusReadLongChannel("PvDCDCWorkState", this).label(2, //
"Initial").label(4, //
"Stop").label(8, //
"Ready").label(16, //
"Running").label(32, //
"Fault").label(64, //
"Debug").label(128, "Locked")), new UnsignedWordElement(0xA601, pvDCDCWorkMode = //
new ModbusReadLongChannel("PvDCDCWorkMode", this).label(128, //
"Constant Current").label(256, //
"Constant Voltage").label(512, "Boost MPPT"))), new //
ModbusRegisterRange(//
0xA700, new //
UnsignedWordElement(//
0xA700, // prefix = "PvDCDC "
//
new ModbusBitWrappingChannel("PvDCDCSuggestiveInformation1", this, this.thingState).warningBit(0, //
WarningCharger.PvDCDCCurrentSamplingChannelAbnormityOnHighVoltageSide).warningBit(1, //
WarningCharger.PvDCDCCurrentSamplingChannelAbnormityOnLowVoltageSide).warningBit(6, //
WarningCharger.PvDCDCEEPROMParametersOverRange).warningBit(7, //
WarningCharger.PvDCDCUpdateEEPROMFailed).warningBit(8, //
WarningCharger.PvDCDCReadEEPROMFailed).warningBit(9, //
WarningCharger.PvDCDCCurrentSamplingChannelAbnormityBeforeInductance)), new //
UnsignedWordElement(//
0xA701, // prefix = "PvDCDC "
//
new ModbusBitWrappingChannel("PvDCDCSuggestiveInformation2", this, this.thingState).warningBit(0, //
WarningCharger.PvDCDCReactorPowerDecreaseCausedByOvertemperature).warningBit(1, //
WarningCharger.PvDCDCIGBTPowerDecreaseCausedByOvertemperature).warningBit(2, //
WarningCharger.PvDCDCTemperatureChanel3PowerDecreaseCausedByOvertemperature).warningBit(3, //
WarningCharger.PvDCDCTemperatureChanel4PowerDecreaseCausedByOvertemperature).warningBit(4, //
WarningCharger.PvDCDCTemperatureChanel5PowerDecreaseCausedByOvertemperature).warningBit(5, //
WarningCharger.PvDCDCTemperatureChanel6PowerDecreaseCausedByOvertemperature).warningBit(6, //
WarningCharger.PvDCDCTemperatureChanel7PowerDecreaseCausedByOvertemperature).warningBit(7, //
WarningCharger.PvDCDCTemperatureChanel8PowerDecreaseCausedByOvertemperature).warningBit(8, //
WarningCharger.PvDCDCFan1StopFailed).warningBit(9, //
WarningCharger.PvDCDCFan2StopFailed).warningBit(10, //
WarningCharger.PvDCDCFan3StopFailed).warningBit(11, //
WarningCharger.PvDCDCFan4StopFailed).warningBit(12, //
WarningCharger.PvDCDCFan1StartupFailed).warningBit(13, //
WarningCharger.PvDCDCFan2StartupFailed).warningBit(14, //
WarningCharger.PvDCDCFan3StartupFailed).warningBit(15, //
WarningCharger.PvDCDCFan4StartupFailed)), new //
UnsignedWordElement(//
0xA702, // prefix = "PvDCDC"
//
new ModbusBitWrappingChannel("PvDCDCSuggestiveInformation3", this, this.thingState).warningBit(0, //
WarningCharger.PvDCDCHighVoltageSideOvervoltage).warningBit(1, //
WarningCharger.PvDCDCHighVoltageSideUndervoltage).warningBit(2, //
WarningCharger.PvDCDCHighVoltageSideVoltageChangeUnconventionally)), new UnsignedWordElement(0xA703, // prefix = "PvDCDC"
//
new ModbusBitWrappingChannel("PvDCDCSuggestiveInformation4", this, this.thingState).warningBit(0, WarningCharger.PvDCDCCurrentAbnormityBeforeDCConverterWorkOnHighVoltageSide).warningBit(1, WarningCharger.PvDCDCCurrentAbnormityBeforeDCConverterWorkOnLowVoltageSXide).warningBit(2, WarningCharger.PvDCDCInitialDutyRatioAbnormityBeforeDCConverterWork).warningBit(3, WarningCharger.PvDCDCVoltageAbnormityBeforeDCConverterWorkOnHighVoltageSide).warningBit(4, WarningCharger.PvDCDCVoltageAbnormityBeforeDCConverterWorkOnLowVoltageSide)), new //
UnsignedWordElement(//
0xA704, // prefix = "PvDCDC"
//
new ModbusBitWrappingChannel("PvDCDCSuggestiveInformation5", this, this.thingState).warningBit(0, //
WarningCharger.PvDCDCHighVoltageBreakerInspectionAbnormity).warningBit(1, //
WarningCharger.PvDCDCLowVoltageBreakerInspectionAbnormity).warningBit(2, //
WarningCharger.PvDCDCBsmDCDC5DCPrechargeContactorInspectionAbnormity).warningBit(3, //
WarningCharger.PvDCDCDCPrechargeContactorOpenUnsuccessfully).warningBit(4, //
WarningCharger.PvDCDCDCMainContactorInspectionAbnormity).warningBit(5, //
WarningCharger.PvDCDCDCMainContactorOpenUnsuccessfully).warningBit(6, //
WarningCharger.PvDCDCOutputContactorCloseUnsuccessfully).warningBit(7, //
WarningCharger.PvDCDCOutputContactorOpenUnsuccessfully).warningBit(8, //
WarningCharger.PvDCDCACMainContactorCloseUnsuccessfully).warningBit(9, //
WarningCharger.PvDCDCACMainContactorOpenUnsuccessfully).warningBit(10, //
WarningCharger.PvDCDCNegContactorOpenUnsuccessfully).warningBit(11, //
WarningCharger.PvDCDCNegContactorCloseUnsuccessfully).warningBit(12, //
WarningCharger.PvDCDCNegContactorStateAbnormal)), new DummyElement(0xA705, 0xA70F), new //
UnsignedWordElement(//
0xA710, // prefix = "PvDCDC"
//
new ModbusBitWrappingChannel("PvDCDCAbnormity1", this, this.thingState).faultBit(0, //
FaultCharger.PvDCDCHighVoltageSideOfDCConverterUndervoltage).faultBit(1, //
FaultCharger.PvDCDCHighVoltageSideOfDCConverterOvervoltage).faultBit(2, //
FaultCharger.PvDCDCLowVoltageSideOfDCConverterUndervoltage).faultBit(3, //
FaultCharger.PvDCDCLowVoltageSideOfDCConverterOvervoltage).faultBit(4, //
FaultCharger.PvDCDCHighVoltageSideOfDCConverterOvercurrentFault).faultBit(5, //
FaultCharger.PvDCDCLowVoltageSideOfDCConverterOvercurrentFault).faultBit(6, //
FaultCharger.PvDCDCDCConverterIGBTFault).faultBit(7, //
FaultCharger.PvDCDCDCConverterPrechargeUnmet)), new UnsignedWordElement(0xA711, // prefix = "PvDCDC"
//
new ModbusBitWrappingChannel("PvDCDCAbnormity2", this, this.thingState).faultBit(0, //
FaultCharger.PvDCDCBECUCommunicationDisconnected).faultBit(1, //
FaultCharger.PvDCDCDCConverterCommunicationDisconnected).faultBit(2, //
FaultCharger.PvDCDCCurrentConfigurationOverRange).faultBit(3, //
FaultCharger.PvDCDCTheBatteryRequestStop).faultBit(5, //
FaultCharger.PvDCDCOvercurrentRelayFault).faultBit(6, //
FaultCharger.PvDCDCLightningProtectionDeviceFault).faultBit(7, //
FaultCharger.PvDCDCDCConverterPriamaryContactorDisconnectedAbnormally).faultBit(9, //
FaultCharger.PvDCDCDCDisconnectedAbnormallyOnLowVoltageSideOfDCConvetor).faultBit(12, //
FaultCharger.PvDCDCDCConvetorEEPROMAbnormity1).faultBit(13, //
FaultCharger.PvDCDCDCConvetorEEPROMAbnormity1Second).faultBit(14, //
FaultCharger.PvDCDCEDCConvetorEEPROMAbnormity1)), new //
UnsignedWordElement(//
0xA712, // prefix = "PvDCDC"
//
new ModbusBitWrappingChannel("PvDCDCAbnormity3", this, this.thingState).faultBit(0, //
FaultCharger.PvDCDCDCConvertorGeneralOverload).faultBit(1, //
FaultCharger.PvDCDCDCShortCircuit).faultBit(2, //
FaultCharger.PvDCDCPeakPulseCurrentProtection).faultBit(3, //
FaultCharger.PvDCDCDCDisconnectAbnormallyOnHighVoltageSideOfDCConvetor).faultBit(4, //
FaultCharger.PvDCDCEffectivePulseValueOverhigh).faultBit(5, //
FaultCharger.PvDCDCDCConverteSevereOverload).faultBit(6, //
FaultCharger.PvDCDCDCBreakerDisconnectAbnormallyOnHighVoltageSideOfDCConvetor).faultBit(7, //
FaultCharger.PvDCDCDCBreakerDisconnectAbnormallyOnLowVoltageSideOfDCConvetor).faultBit(8, //
FaultCharger.PvDCDCDCConvetorPrechargeContactorCloseFailed).faultBit(9, //
FaultCharger.PvDCDCDCConvetorMainContactorCloseFailed).faultBit(10, //
FaultCharger.PvDCDCACContactorStateAbnormityOfDCConvetor).faultBit(11, //
FaultCharger.PvDCDCDCConvetorEmergencyStop).faultBit(12, //
FaultCharger.PvDCDCDCConverterChargingGunDisconnected).faultBit(13, //
FaultCharger.PvDCDCDCCurrentAbnormityBeforeDCConvetorWork).faultBit(14, //
FaultCharger.PvDCDCFuSeDisconnected).faultBit(15, //
FaultCharger.PvDCDCDCConverterHardwareCurrentOrVoltageFault)), new //
UnsignedWordElement(//
0xA713, // prefix = "PvDCDC"
//
new ModbusBitWrappingChannel("PvDCDCAbnormity4", this, this.thingState).faultBit(0, //
FaultCharger.PvDCDCDCConverterCrystalOscillatorCircuitInvalidation).faultBit(1, //
FaultCharger.PvDCDCDCConverterResetCircuitInvalidation).faultBit(2, //
FaultCharger.PvDCDCDCConverterSamplingCircuitInvalidation).faultBit(3, //
FaultCharger.PvDCDCDCConverterDigitalIOCircuitInvalidation).faultBit(4, //
FaultCharger.PvDCDCDCConverterPWMCircuitInvalidation).faultBit(5, //
FaultCharger.PvDCDCDCConverterX5045CircuitInvalidation).faultBit(6, //
FaultCharger.PvDCDCDCConverterCANCircuitInvalidation).faultBit(7, //
FaultCharger.PvDCDCDCConverterSoftwareANDHardwareProtectionCircuitInvalidation).faultBit(8, //
FaultCharger.PvDCDCDCConverterPowerCircuitInvalidation).faultBit(9, //
FaultCharger.PvDCDCDCConverterCPUInvalidation).faultBit(10, //
FaultCharger.PvDCDCDCConverterTINT0InterruptInvalidation).faultBit(11, //
FaultCharger.PvDCDCDCConverterADCInterruptInvalidation).faultBit(12, //
FaultCharger.PvDCDCDCConverterCAPITN4InterruptInvalidation).faultBit(13, //
FaultCharger.PvDCDCDCConverterCAPINT6InterruptInvalidation).faultBit(14, //
FaultCharger.PvDCDCDCConverterT3PINTinterruptInvalidation).faultBit(15, //
FaultCharger.PvDCDCDCConverterT4PINTinterruptInvalidation)), new UnsignedWordElement(0xA714, // prefix = "PvDCDC"
//
new ModbusBitWrappingChannel("PvDCDCAbnormity5", this, this.thingState).faultBit(0, //
FaultCharger.PvDCDCConverterPDPINTAInterruptInvalidation).faultBit(1, //
FaultCharger.PvDCDCConverterT1PINTInterruptInvalidationSecond).faultBit(2, //
FaultCharger.PvDCDCConverterRESVInterruptInvalidation).faultBit(3, //
FaultCharger.PvDCDCConverter100usTaskInvalidation).faultBit(4, //
FaultCharger.PvDCDCConverterClockInvalidation).faultBit(5, //
FaultCharger.PvDCDCConverterEMSMemoryInvalidation).faultBit(6, //
FaultCharger.PvDCDCConverterExteriorCommunicationInvalidation).faultBit(7, //
FaultCharger.PvDCDCConverterIOInterfaceInvalidation).faultBit(8, //
FaultCharger.PvDCDCConverterInputVoltageBoundFault).faultBit(9, //
FaultCharger.PvDCDCConverterOutterVoltageBoundFault).faultBit(10, //
FaultCharger.PvDCDCConverterOutputVoltageBoundFault).faultBit(11, //
FaultCharger.PvDCDCConverterInductCurrentBoundFault).faultBit(12, //
FaultCharger.PvDCDCConverterInputCurrentBoundFault).faultBit(13, //
FaultCharger.PvDCDCConverterOutputCurrentBoundFault)), new //
UnsignedWordElement(//
0xA715, // prefix = "PvDCDC"
//
new ModbusBitWrappingChannel("PvDCDCAbnormity6", this, this.thingState).faultBit(0, //
FaultCharger.PvDCDCDCReactorOverTemperature).faultBit(1, //
FaultCharger.PvDCDCDCIGBTOverTemperature).faultBit(2, //
FaultCharger.PvDCDCDCConverterChanel3OverTemperature).faultBit(3, //
FaultCharger.PvDCDCDCConverterChanel4OverTemperature).faultBit(4, //
FaultCharger.PvDCDCDCConverterChanel5OverTemperature).faultBit(5, //
FaultCharger.PvDCDCDCConverterChanel6OverTemperature).faultBit(6, //
FaultCharger.PvDCDCDCConverterChanel7OverTemperature).faultBit(7, //
FaultCharger.PvDCDCDCConverterChanel8OverTemperature).faultBit(8, //
FaultCharger.PvDCDCDCReactorTemperatureSamplingInvalidation).faultBit(9, //
FaultCharger.PvDCDCDCIGBTTemperatureSamplingInvalidation).faultBit(10, //
FaultCharger.PvDCDCDCConverterChanel3TemperatureSamplingInvalidation).faultBit(11, //
FaultCharger.PvDCDCDCConverterChanel4TemperatureSamplingInvalidation).faultBit(12, //
FaultCharger.PvDCDCDCConverterChanel5TemperatureSamplingInvalidation).faultBit(13, //
FaultCharger.PvDCDCDCConverterChanel6TemperatureSamplingInvalidation).faultBit(14, //
FaultCharger.PvDCDCDCConverterChanel7TemperatureSamplingInvalidation).faultBit(15, //
FaultCharger.PvDCDCDCConverterChanel8TemperatureSamplingInvalidation)), new //
UnsignedWordElement(//
0xA716, // prefix = "PvDCDC"
//
new ModbusBitWrappingChannel("PvDCDCAbnormity7", this, this.thingState).faultBit(4, //
FaultCharger.PvDCDCDCConverterInductanceCurrentSamplingInvalidation).faultBit(5, //
FaultCharger.PvDCDCCurrentSamplingInvalidationOnTheLowVoltageSideOfDCConverter).faultBit(6, //
FaultCharger.PvDCDCVoltageSamplingInvalidationOnTheLowVoltageSideOfDCConverter).faultBit(7, //
FaultCharger.PvDCDCInsulationInspectionFault).faultBit(8, //
FaultCharger.PvDCDCNegContactorCloseUnsuccessly).faultBit(9, //
FaultCharger.PvDCDCNegContactorCutWhenRunning)), new DummyElement(0xA717, 0xA71F), new UnsignedWordElement(0xA720, pvDCDCSwitchState = //
new StatusBitChannel("PvDCDCSwitchState", this).label(1, //
"DC precharge contactor").label(2, //
"DC main contactor").label(4, //
"Output contactor").label(8, //
"Output breaker").label(16, //
"Input breaker").label(32, //
"AC contactor").label(64, //
"Emergency stop button").label(128, "NegContactor"))), new //
ModbusRegisterRange(//
0xA730, new SignedWordElement(0xA730, pvDCDCOutputVoltage = new ModbusReadLongChannel("PvDCDCOutputVoltage", this).unit("mV").multiplier(2)), new SignedWordElement(0xA731, pvDCDCOutputCurrent = new ModbusReadLongChannel("PvDCDCOutputCurrent", this).unit("mA").multiplier(2)), new SignedWordElement(0xA732, pvDCDCOutputPower = new ModbusReadLongChannel("PvDCDCOutputPower", this).unit("W").multiplier(2)), new SignedWordElement(0xA733, pvDCDCInputVoltage = new ModbusReadLongChannel("PvDCDCInputVoltage", this).unit("mV").multiplier(2)), new SignedWordElement(0xA734, pvDCDCInputCurrent = new ModbusReadLongChannel("PvDCDCInputCurrent", this).unit("mA").multiplier(2)), new SignedWordElement(0xA735, pvDCDCInputPower = new ModbusReadLongChannel("PvDCDCInputPower", this).unit("W").multiplier(2)), new SignedWordElement(0xA736, pvDCDCInputEnergy = new ModbusReadLongChannel("PvDCDCInputEnergy", this).unit("Wh").multiplier(2)), new SignedWordElement(0xA737, pvDCDCOutputEnergy = new ModbusReadLongChannel("PvDCDCOutputEnergy", this).unit("Wh").multiplier(2)), new DummyElement(0xA738, 0xA73F), new SignedWordElement(0xA740, pvDCDCReactorTemperature = new ModbusReadLongChannel("PvDCDCReactorTemperature", this).unit("°C")), new SignedWordElement(0xA741, pvDCDCIgbtTemperature = new ModbusReadLongChannel("PvDCDCIgbtTemperature", this).unit("°C")), new DummyElement(0xA742, 0xA74F), new UnsignedDoublewordElement(0xA750, pvDCDCInputTotalChargeEnergy = new ModbusReadLongChannel("PvDCDCInputTotalChargeEnergy", this).unit("Wh").multiplier(2)).wordOrder(WordOrder.LSWMSW), new UnsignedDoublewordElement(0xA752, pvDCDCInputTotalDischargeEnergy = new ModbusReadLongChannel("PvDCDCInputTotalDischargeEnergy", this).unit("Wh").multiplier(2)).wordOrder(WordOrder.LSWMSW), new UnsignedDoublewordElement(0xA754, pvDCDCOutputTotalChargeEnergy = new ModbusReadLongChannel("PvDCDCOutputTotalChargeEnergy", this).unit("Wh").multiplier(2)).wordOrder(WordOrder.LSWMSW), new UnsignedDoublewordElement(0xA756, pvDCDCOutputTotalDischargeEnergy = new ModbusReadLongChannel("PvDCDCOutputTotalDischargeEnergy", this).unit("Wh").multiplier(2)).wordOrder(WordOrder.LSWMSW)), new //
ModbusRegisterRange(//
0xA900, new UnsignedWordElement(0xA900, pvDCDC1WorkState = //
new ModbusReadLongChannel("PvDCDC1WorkState", this).label(2, //
"Initial").label(4, //
"Stop").label(8, //
"Ready").label(16, //
"Running").label(32, //
"Fault").label(64, //
"Debug").label(128, "Locked")), new UnsignedWordElement(0xA901, pvDCDC1WorkMode = //
new ModbusReadLongChannel("PvDCDC1WorkMode", this).label(128, //
"Constant Current").label(256, //
"Constant Voltage").label(512, "Boost MPPT"))), new //
ModbusRegisterRange(//
0xAA00, new //
UnsignedWordElement(//
0xAA00, // Prefix = "PvDCDC1 "
//
new ModbusBitWrappingChannel("PvDCDC1SuggestiveInformation1", this, this.thingState).warningBit(0, //
WarningCharger.PvDCDC1CurrentSamplingChannelAbnormityOnHighVoltageSide).warningBit(1, //
WarningCharger.PvDCDC1CurrentSamplingChannelAbnormityOnLowVoltageSide).warningBit(6, //
WarningCharger.PvDCDC1EEPROMParametersOverRange).warningBit(7, //
WarningCharger.PvDCDC1UpdateEEPROMFailed).warningBit(8, //
WarningCharger.PvDCDC1ReadEEPROMFailed).warningBit(9, //
WarningCharger.PvDCDC1CurrentSamplingChannelAbnormityBeforeInductance)), new //
UnsignedWordElement(//
0xAA01, // Prefix = "PvDCDC1"
//
new ModbusBitWrappingChannel("PvDCDC1SuggestiveInformation2", this, this.thingState).warningBit(0, //
WarningCharger.PvDCDC1ReactorPowerDecreaseCausedByOvertemperature).warningBit(1, //
WarningCharger.PvDCDC1IGBTPowerDecreaseCausedByOvertemperature).warningBit(2, //
WarningCharger.PvDCDC1TemperatureChanel3PowerDecreaseCausedByOvertemperature).warningBit(3, //
WarningCharger.PvDCDC1TemperatureChanel4PowerDecreaseCausedByOvertemperature).warningBit(4, //
WarningCharger.PvDCDC1TemperatureChanel5PowerDecreaseCausedByOvertemperature).warningBit(5, //
WarningCharger.PvDCDC1TemperatureChanel6PowerDecreaseCausedByOvertemperature).warningBit(6, //
WarningCharger.PvDCDC1TemperatureChanel7PowerDecreaseCausedByOvertemperature).warningBit(7, //
WarningCharger.PvDCDC1TemperatureChanel8PowerDecreaseCausedByOvertemperature).warningBit(8, //
WarningCharger.PvDCDC1Fan1StopFailed).warningBit(9, //
WarningCharger.PvDCDC1Fan2StopFailed).warningBit(10, //
WarningCharger.PvDCDC1Fan3StopFailed).warningBit(11, //
WarningCharger.PvDCDC1Fan4StopFailed).warningBit(12, //
WarningCharger.PvDCDC1Fan1StartupFailed).warningBit(13, //
WarningCharger.PvDCDC1Fan2StartupFailed).warningBit(14, //
WarningCharger.PvDCDC1Fan3StartupFailed).warningBit(15, //
WarningCharger.PvDCDC1Fan4StartupFailed)), new //
UnsignedWordElement(//
0xAA02, // prefix = "PvDCDC1"
//
new ModbusBitWrappingChannel("PvDCDC1SuggestiveInformation3", this, this.thingState).warningBit(0, //
WarningCharger.PvDCDC1HighVoltageSideOvervoltage).warningBit(1, //
WarningCharger.PvDCDC1HighVoltageSideUndervoltage).warningBit(2, //
WarningCharger.PvDCDC1HighVoltageSideVoltageChangeUnconventionally)), new //
UnsignedWordElement(//
0xAA03, // prefix = "PvDCDC1"
//
new ModbusBitWrappingChannel("PvDCDC1SuggestiveInformation4", this, this.thingState).warningBit(0, WarningCharger.PvDCDC1CurrentAbnormityBeforeDCConverterWorkOnHighVoltageSide).warningBit(1, WarningCharger.PvDCDC1CurrentAbnormityBeforeDCConverterWorkOnLowVoltageSXide).warningBit(2, WarningCharger.PvDCDC1InitialDutyRatioAbnormityBeforeDCConverterWork).warningBit(3, WarningCharger.PvDCDC1VoltageAbnormityBeforeDCConverterWorkOnHighVoltageSide).warningBit(4, WarningCharger.PvDCDC1VoltageAbnormityBeforeDCConverterWorkOnLowVoltageSide)), new UnsignedWordElement(0xAA04, // prefix = "PvDCDC1"
//
new ModbusBitWrappingChannel("PvDCDC1SuggestiveInformation5", this, this.thingState).warningBit(0, //
WarningCharger.PvDCDC1HighVoltageBreakerInspectionAbnormity).warningBit(1, //
WarningCharger.PvDCDC1LowVoltageBreakerInspectionAbnormity).warningBit(2, //
WarningCharger.PvDCDC1BsmDCDC5DCPrechargeContactorInspectionAbnormity).warningBit(3, //
WarningCharger.PvDCDC1DCPrechargeContactorOpenUnsuccessfully).warningBit(4, //
WarningCharger.PvDCDC1DCMainContactorInspectionAbnormity).warningBit(5, //
WarningCharger.PvDCDC1DCMainContactorOpenUnsuccessfully).warningBit(6, //
WarningCharger.PvDCDC1OutputContactorCloseUnsuccessfully).warningBit(7, //
WarningCharger.PvDCDC1OutputContactorOpenUnsuccessfully).warningBit(8, //
WarningCharger.PvDCDC1ACMainContactorCloseUnsuccessfully).warningBit(9, //
WarningCharger.PvDCDC1ACMainContactorOpenUnsuccessfully).warningBit(10, //
WarningCharger.PvDCDC1NegContactorOpenUnsuccessfully).warningBit(11, //
WarningCharger.PvDCDC1NegContactorCloseUnsuccessfully).warningBit(12, //
WarningCharger.PvDCDC1NegContactorStateAbnormal)), new DummyElement(0xAA05, 0xAA0F), new //
UnsignedWordElement(//
0xAA10, // prefix = "PvDCDC1"
//
new ModbusBitWrappingChannel("PvDCDC1Abnormity1", this, this.thingState).faultBit(0, //
FaultCharger.PvDCDC1HighVoltageSideOfDCConverterUndervoltage).faultBit(1, //
FaultCharger.PvDCDC1HighVoltageSideOfDCConverterOvervoltage).faultBit(2, //
FaultCharger.PvDCDC1LowVoltageSideOfDCConverterUndervoltage).faultBit(3, //
FaultCharger.PvDCDC1LowVoltageSideOfDCConverterOvervoltage).faultBit(4, //
FaultCharger.PvDCDC1HighVoltageSideOfDCConverterOvercurrentFault).faultBit(5, //
FaultCharger.PvDCDC1LowVoltageSideOfDCConverterOvercurrentFault).faultBit(6, //
FaultCharger.PvDCDC1DCConverterIGBTFault).faultBit(7, //
FaultCharger.PvDCDC1DCConverterPrechargeUnmet)), new //
UnsignedWordElement(//
0xAA11, // prefix = "PvDCDC1"
//
new ModbusBitWrappingChannel("PvDCDC1Abnormity2", this, this.thingState).faultBit(0, //
FaultCharger.PvDCDC1BECUCommunicationDisconnected).faultBit(1, //
FaultCharger.PvDCDC1DCConverterCommunicationDisconnected).faultBit(2, //
FaultCharger.PvDCDC1CurrentConfigurationOverRange).faultBit(3, //
FaultCharger.PvDCDC1TheBatteryRequestStop).faultBit(5, //
FaultCharger.PvDCDC1OvercurrentRelayFault).faultBit(6, //
FaultCharger.PvDCDC1LightningProtectionDeviceFault).faultBit(7, //
FaultCharger.PvDCDC1DCConverterPriamaryContactorDisconnectedAbnormally).faultBit(9, //
FaultCharger.PvDCDC1DCDisconnectedAbnormallyOnLowVoltageSideOfDCConvetor).faultBit(12, //
FaultCharger.PvDCDC1DCConvetorEEPROMAbnormity1).faultBit(13, //
FaultCharger.PvDCDC1DCConvetorEEPROMAbnormity1Second).faultBit(14, //
FaultCharger.PvDCDC1EDCConvetorEEPROMAbnormity1)), new UnsignedWordElement(0xAA12, // prefix = "PvDCDC1"
//
new ModbusBitWrappingChannel("PvDCDC1Abnormity3", this, this.thingState).faultBit(0, //
FaultCharger.PvDCDC1DCConvertorGeneralOverload).faultBit(1, //
FaultCharger.PvDCDC1DCShortCircuit).faultBit(2, //
FaultCharger.PvDCDC1PeakPulseCurrentProtection).faultBit(3, //
FaultCharger.PvDCDC1DCDisconnectAbnormallyOnHighVoltageSideOfDCConvetor).faultBit(4, //
FaultCharger.PvDCDC1EffectivePulseValueOverhigh).faultBit(5, //
FaultCharger.PvDCDC1DCConverteSevereOverload).faultBit(6, //
FaultCharger.PvDCDC1DCBreakerDisconnectAbnormallyOnHighVoltageSideOfDCConvetor).faultBit(7, //
FaultCharger.PvDCDC1DCBreakerDisconnectAbnormallyOnLowVoltageSideOfDCConvetor).faultBit(8, //
FaultCharger.PvDCDC1DCConvetorPrechargeContactorCloseFailed).faultBit(9, //
FaultCharger.PvDCDC1DCConvetorMainContactorCloseFailed).faultBit(10, //
FaultCharger.PvDCDC1ACContactorStateAbnormityOfDCConvetor).faultBit(11, //
FaultCharger.PvDCDC1DCConvetorEmergencyStop).faultBit(12, //
FaultCharger.PvDCDC1DCConverterChargingGunDisconnected).faultBit(13, //
FaultCharger.PvDCDC1DCCurrentAbnormityBeforeDCConvetorWork).faultBit(14, //
FaultCharger.PvDCDC1FuSeDisconnected).faultBit(15, //
FaultCharger.PvDCDC1DCConverterHardwareCurrentOrVoltageFault)), //
new UnsignedWordElement(0xAA13, // prefix = "PvDCDC1"
//
new ModbusBitWrappingChannel("PvDCDC1Abnormity4", this, this.thingState).faultBit(0, //
FaultCharger.PvDCDC1DCConverterCrystalOscillatorCircuitInvalidation).faultBit(1, //
FaultCharger.PvDCDC1DCConverterResetCircuitInvalidation).faultBit(2, //
FaultCharger.PvDCDC1DCConverterSamplingCircuitInvalidation).faultBit(3, //
FaultCharger.PvDCDC1DCConverterDigitalIOCircuitInvalidation).faultBit(4, //
FaultCharger.PvDCDC1DCConverterPWMCircuitInvalidation).faultBit(5, //
FaultCharger.PvDCDC1DCConverterX5045CircuitInvalidation).faultBit(6, //
FaultCharger.PvDCDC1DCConverterCANCircuitInvalidation).faultBit(7, //
FaultCharger.PvDCDC1DCConverterSoftwareANDHardwareProtectionCircuitInvalidation).faultBit(8, //
FaultCharger.PvDCDC1DCConverterPowerCircuitInvalidation).faultBit(9, //
FaultCharger.PvDCDC1DCConverterCPUInvalidation).faultBit(10, //
FaultCharger.PvDCDC1DCConverterTINT0InterruptInvalidation).faultBit(11, //
FaultCharger.PvDCDC1DCConverterADCInterruptInvalidation).faultBit(12, //
FaultCharger.PvDCDC1DCConverterCAPITN4InterruptInvalidation).faultBit(13, //
FaultCharger.PvDCDC1DCConverterCAPINT6InterruptInvalidation).faultBit(14, //
FaultCharger.PvDCDC1DCConverterT3PINTinterruptInvalidation).faultBit(15, //
FaultCharger.PvDCDC1DCConverterT4PINTinterruptInvalidation)), //
new UnsignedWordElement(0xAA14, // prefix = "PvDCDC1"
//
new ModbusBitWrappingChannel("PvDCDC1Abnormity5", this, this.thingState).faultBit(0, //
FaultCharger.PvDCDC1DCConverterPDPINTAInterruptInvalidation).faultBit(1, //
FaultCharger.PvDCDC1DCConverterT1PINTInterruptInvalidationSecond).faultBit(2, //
FaultCharger.PvDCDC1DCConverterRESVInterruptInvalidation).faultBit(3, //
FaultCharger.PvDCDC1DCConverter100usTaskInvalidation).faultBit(4, //
FaultCharger.PvDCDC1DCConverterClockInvalidation).faultBit(5, //
FaultCharger.PvDCDC1DCConverterEMSMemoryInvalidation).faultBit(6, //
FaultCharger.PvDCDC1DCConverterExteriorCommunicationInvalidation).faultBit(7, //
FaultCharger.PvDCDC1DCConverterIOInterfaceInvalidation).faultBit(8, //
FaultCharger.PvDCDC1DCConverterInputVoltageBoundFault).faultBit(9, //
FaultCharger.PvDCDC1DCConverterOutterVoltageBoundFault).faultBit(10, //
FaultCharger.PvDCDC1DCConverterOutputVoltageBoundFault).faultBit(11, //
FaultCharger.PvDCDC1DCConverterInductCurrentBoundFault).faultBit(12, //
FaultCharger.PvDCDC1DCConverterInputCurrentBoundFault).faultBit(13, //
FaultCharger.PvDCDC1DCConverterOutputCurrentBoundFault)), //
new UnsignedWordElement(0xAA15, // prefix = "PvDCDC1"
//
new ModbusBitWrappingChannel("PvDCDC1Abnormity6", this, this.thingState).faultBit(0, //
FaultCharger.PvDCDC1DCReactorOverTemperature).faultBit(1, //
FaultCharger.PvDCDC1DCIGBTOverTemperature).faultBit(2, //
FaultCharger.PvDCDC1DCConverterChanel3OverTemperature).faultBit(3, //
FaultCharger.PvDCDC1DCConverterChanel4OverTemperature).faultBit(4, //
FaultCharger.PvDCDC1DCConverterChanel5OverTemperature).faultBit(5, //
FaultCharger.PvDCDC1DCConverterChanel6OverTemperature).faultBit(6, //
FaultCharger.PvDCDC1DCConverterChanel7OverTemperature).faultBit(7, //
FaultCharger.PvDCDC1DCConverterChanel8OverTemperature).faultBit(8, //
FaultCharger.PvDCDC1DCReactorTemperatureSamplingInvalidation).faultBit(9, //
FaultCharger.PvDCDC1DCIGBTTemperatureSamplingInvalidation).faultBit(10, //
FaultCharger.PvDCDC1DCConverterChanel3TemperatureSamplingInvalidation).faultBit(11, //
FaultCharger.PvDCDC1DCConverterChanel4TemperatureSamplingInvalidation).faultBit(12, //
FaultCharger.PvDCDC1DCConverterChanel5TemperatureSamplingInvalidation).faultBit(13, //
FaultCharger.PvDCDC1DCConverterChanel6TemperatureSamplingInvalidation).faultBit(14, //
FaultCharger.PvDCDC1DCConverterChanel7TemperatureSamplingInvalidation).faultBit(15, //
FaultCharger.PvDCDC1DCConverterChanel8TemperatureSamplingInvalidation)), //
new UnsignedWordElement(0xAA16, // prefix = "PvDCDC1"
//
new ModbusBitWrappingChannel("PvDCDC1Abnormity7", this, this.thingState).faultBit(4, //
FaultCharger.PvDCDC1DCConverterInductanceCurrentSamplingInvalidation).faultBit(5, //
FaultCharger.PvDCDC1CurrentSamplingInvalidationOnTheLowVoltageSideOfDCConverter).faultBit(6, //
FaultCharger.PvDCDC1VoltageSamplingInvalidationOnTheLowVoltageSideOfDCConverter).faultBit(7, //
FaultCharger.PvDCDC1InsulationInspectionFault).faultBit(8, //
FaultCharger.PvDCDC1NegContactorCloseUnsuccessly).faultBit(9, //
FaultCharger.PvDCDC1NegContactorCutWhenRunning)), //
new DummyElement(0xAA17, 0xAA1F), new UnsignedWordElement(0xAA20, pvDCDC1SwitchState = //
new StatusBitChannel("PvDCDC1SwitchState", this).label(1, //
"DC precharge contactor").label(2, //
"DC main contactor").label(4, //
"Output contactor").label(8, //
"Output breaker").label(16, //
"Input breaker").label(32, //
"AC contactor").label(64, //
"Emergency stop button").label(128, "NegContactor"))), new //
ModbusRegisterRange(//
0xAA30, new SignedWordElement(0xAA30, pvDCDC1OutputVoltage = new ModbusReadLongChannel("PvDCDC1OutputVoltage", this).unit("mV").multiplier(2)), new SignedWordElement(0xAA31, pvDCDC1OutputCurrent = new ModbusReadLongChannel("PvDCDC1OutputCurrent", this).unit("mA").multiplier(2)), new SignedWordElement(0xAA32, pvDCDC1OutputPower = new ModbusReadLongChannel("PvDCDC1OutputPower", this).unit("W").multiplier(2)), new SignedWordElement(0xAA33, pvDCDC1InputVoltage = new ModbusReadLongChannel("PvDCDC1InputVoltage", this).unit("mV").multiplier(2)), new SignedWordElement(0xAA34, pvDCDC1InputCurrent = new ModbusReadLongChannel("PvDCDC1InputCurrent", this).unit("mA").multiplier(2)), new SignedWordElement(0xAA35, pvDCDC1InputPower = new ModbusReadLongChannel("PvDCDC1InputPower", this).unit("W").multiplier(2)), new SignedWordElement(0xAA36, pvDCDC1InputEnergy = new ModbusReadLongChannel("PvDCDC1InputEnergy", this).unit("Wh").multiplier(2)), new SignedWordElement(0xAA37, pvDCDC1OutputEnergy = new ModbusReadLongChannel("PvDCDC1OutputEnergy", this).unit("Wh").multiplier(2)), new DummyElement(0xAA38, 0xAA3F), new SignedWordElement(0xAA40, pvDCDC1ReactorTemperature = new ModbusReadLongChannel("PvDCDC1ReactorTemperature", this).unit("°C")), new SignedWordElement(0xAA41, pvDCDC1IgbtTemperature = new ModbusReadLongChannel("PvDCDC1IgbtTemperature", this).unit("°C")), new DummyElement(0xAA42, 0xAA4F), new UnsignedDoublewordElement(0xAA50, pvDCDC1InputTotalChargeEnergy = new ModbusReadLongChannel("PvDCDC1InputTotalChargeEnergy", this).unit("Wh").multiplier(2)).wordOrder(WordOrder.LSWMSW), new UnsignedDoublewordElement(0xAA52, pvDCDC1InputTotalDischargeEnergy = new ModbusReadLongChannel("PvDCDC1InputTotalDischargeEnergy", this).unit("Wh").multiplier(2)).wordOrder(WordOrder.LSWMSW), new UnsignedDoublewordElement(0xAA54, pvDCDC1OutputTotalChargeEnergy = new ModbusReadLongChannel("PvDCDC1OutputTotalChargeEnergy", this).unit("Wh").multiplier(2)).wordOrder(WordOrder.LSWMSW), new UnsignedDoublewordElement(0xAA56, pvDCDC1OutputTotalDischargeEnergy = new ModbusReadLongChannel("PvDCDC1OutputTotalDischargeEnergy", this).unit("Wh").multiplier(2)).wordOrder(WordOrder.LSWMSW)));
actualPower = new FunctionalReadChannel<Long>("ActualPower", this, (channels) -> {
long erg = 0;
try {
for (ReadChannel<Long> ch : channels) {
erg += ch.value();
}
return erg;
} catch (InvalidValueException e) {
return null;
}
}, pvDCDCInputPower, pvDCDC1InputPower);
inputVoltage = new FunctionalReadChannel<Long>("InputVoltage", this, (channels) -> {
long erg = 0;
try {
for (ReadChannel<Long> ch : channels) {
if (erg < ch.value()) {
erg = ch.value();
}
}
return erg;
} catch (InvalidValueException e) {
return null;
}
}, pvDCDCInputVoltage, pvDCDC1InputVoltage);
return protocol;
}
use of io.openems.impl.protocol.modbus.internal.SignedWordElement in project openems by OpenEMS.
the class FeneconProEss method defineModbusProtocol.
/*
* Methods
*/
@Override
protected ModbusProtocol defineModbusProtocol() throws ConfigException {
ModbusProtocol protokol = new ModbusProtocol(new //
ModbusRegisterRange(//
100, new //
UnsignedWordElement(//
100, systemState = //
new ModbusReadLongChannel("SystemState", this).label(0, //
STANDBY).label(1, //
"Start Off-Grid").label(2, //
START).label(3, //
FAULT).label(4, "Off-grid PV")), new //
UnsignedWordElement(//
101, controlMode = //
new ModbusReadLongChannel("ControlMode", this).label(1, //
"Remote").label(2, //
"Local")), new //
UnsignedWordElement(//
102, workMode = //
new ModbusReadLongChannel("WorkMode", this).label(2, //
"Economy").label(6, //
"Remote").label(8, //
"Timing")), //
new DummyElement(103), new //
UnsignedDoublewordElement(//
104, totalBatteryChargeEnergy = new ModbusReadLongChannel("TotalBatteryChargeEnergy", this).unit(//
"Wh")), new //
UnsignedDoublewordElement(//
106, totalBatteryDischargeEnergy = new ModbusReadLongChannel("TotalBatteryDischargeEnergy", this).unit(//
"Wh")), new //
UnsignedWordElement(//
108, batteryGroupState = //
new ModbusReadLongChannel("BatteryGroupState", this).label(0, //
"Initial").label(1, //
"Stop").label(2, //
"Starting").label(3, //
"Running").label(4, //
"Stopping").label(5, "Fail")), new //
UnsignedWordElement(//
109, soc = new ModbusReadLongChannel("Soc", this).unit("%").interval(0, 100)), new //
UnsignedWordElement(//
110, batteryVoltage = new ModbusReadLongChannel("BatteryVoltage", this).unit("mV").multiplier(2)), new //
SignedWordElement(//
111, batteryCurrent = new ModbusReadLongChannel("BatteryCurrent", this).unit("mA").multiplier(2)), new //
SignedWordElement(//
112, batteryPower = new ModbusReadLongChannel("BatteryPower", this).unit("W")), new UnsignedWordElement(113, //
new ModbusBitWrappingChannel("BatteryGroupAlarm", this, state).warningBit(0, // Fail, The system should be stopped
WarningEss.FailTheSystemShouldBeStopped).warningBit(1, // Common low voltage alarm
WarningEss.CommonLowVoltageAlarm).warningBit(2, // Common high voltage alarm
WarningEss.CommonHighVoltageAlarm).warningBit(3, // Charging over current alarm
WarningEss.ChargingOverCurrentAlarm).warningBit(4, // Discharging over current alarm
WarningEss.DischargingOverCurrentAlarm).warningBit(5, // Over temperature alarm
WarningEss.OverTemperatureAlarm).warningBit(6, // Interal communication abnormal
WarningEss.InteralCommunicationAbnormal)), new //
UnsignedWordElement(//
114, pcsOperationState = new ModbusReadLongChannel("PcsOperationState", this).label(0, //
"Self-checking").label(1, //
"Standby").label(2, //
"Off grid PV").label(3, //
"Off grid").label(4, //
ON_GRID).label(5, //
"Fail").label(6, //
"bypass 1").label(7, "bypass 2")), //
new DummyElement(115, 117), new //
SignedWordElement(//
118, currentL1 = new ModbusReadLongChannel("CurrentL1", this).unit("mA").multiplier(2)), new //
SignedWordElement(//
119, currentL2 = new ModbusReadLongChannel("CurrentL2", this).unit("mA").multiplier(2)), new //
SignedWordElement(//
120, currentL3 = new ModbusReadLongChannel("CurrentL3", this).unit("mA").multiplier(2)), new //
UnsignedWordElement(//
121, voltageL1 = new ModbusReadLongChannel("VoltageL1", this).unit("mV").multiplier(2)), new //
UnsignedWordElement(//
122, voltageL2 = new ModbusReadLongChannel("VoltageL2", this).unit("mV").multiplier(2)), new //
UnsignedWordElement(//
123, voltageL3 = new ModbusReadLongChannel("VoltageL3", this).unit("mV").multiplier(2)), new //
SignedWordElement(//
124, activePowerL1 = new ModbusReadLongChannel("ActivePowerL1", this).unit("W")), new //
SignedWordElement(//
125, activePowerL2 = new ModbusReadLongChannel("ActivePowerL2", this).unit("W")), new //
SignedWordElement(//
126, activePowerL3 = new ModbusReadLongChannel("ActivePowerL3", this).unit("W")), new //
SignedWordElement(//
127, reactivePowerL1 = new ModbusReadLongChannel("ReactivePowerL1", this).unit("var")), new //
SignedWordElement(//
128, reactivePowerL2 = new ModbusReadLongChannel("ReactivePowerL2", this).unit("var")), new //
SignedWordElement(//
129, reactivePowerL3 = new ModbusReadLongChannel("ReactivePowerL3", this).unit("var")), new DummyElement(130), new //
UnsignedWordElement(//
131, frequencyL1 = new ModbusReadLongChannel("FrequencyL1", this).unit("mHz").multiplier(1)), new //
UnsignedWordElement(//
132, frequencyL2 = new ModbusReadLongChannel("FrequencyL2", this).unit("mHz").multiplier(1)), new //
UnsignedWordElement(//
133, frequencyL3 = new ModbusReadLongChannel("FrequencyL3", this).unit("mHz").multiplier(1)), new //
UnsignedWordElement(//
134, phaseAllowedApparent = new ModbusReadLongChannel("PhaseAllowedApparentPower", this).unit("VA")), new DummyElement(135, 140), new //
UnsignedWordElement(//
141, allowedCharge = new ModbusReadLongChannel("AllowedCharge", this).negate().unit("W")), new //
UnsignedWordElement(//
142, allowedDischarge = new ModbusReadLongChannel("AllowedDischarge", this).unit("W"))), new ModbusRegisterRange(150, new UnsignedWordElement(150, //
new ModbusBitWrappingChannel("PcsAlarm1L1", this, state).warningBit(0, // Grid undervoltage
WarningEss.GridUndervoltageL1).warningBit(1, // Grid overvoltage
WarningEss.GridOvervoltageL1).warningBit(2, // Grid under frequency
WarningEss.GridUnderFrequencyL1).warningBit(3, // Grid over frequency
WarningEss.GridOverFrequencyL1).warningBit(4, // Grid power supply off
WarningEss.GridPowerSupplyOffL1).warningBit(5, // Grid condition unmeet
WarningEss.GridConditionUnmeetL1).warningBit(6, // DC under voltage
WarningEss.DCUnderVoltageL1).warningBit(7, // Input over resistance
WarningEss.InputOverResistanceL1).warningBit(8, // Combination error
WarningEss.CombinationErrorL1).warningBit(9, // Comm with inverter error
WarningEss.CommWithInverterErrorL1).warningBit(10, // Tme error
WarningEss.TmeErrorL1)), new UnsignedWordElement(151, new ModbusBitWrappingChannel("PcsAlarm2L1", this, state)), new UnsignedWordElement(152, //
new ModbusBitWrappingChannel("PcsFault1L1", this, state).faultBit(0, // Control current overload
FaultEss.ControlCurrentOverload100PercentL1).faultBit(1, // Control current overload
FaultEss.ControlCurrentOverload110PercentL1).faultBit(2, // Control current overload
FaultEss.ControlCurrentOverload150PercentL1).faultBit(3, // Control current overload
FaultEss.ControlCurrentOverload200PercentL1).faultBit(4, // Control current overload
FaultEss.ControlCurrentOverload120PercentL1).faultBit(5, // Control current overload
FaultEss.ControlCurrentOverload300PercentL1).faultBit(6, // Control transient load 300%
FaultEss.ControlTransientLoad300PercentL1).faultBit(7, // Grid over current
FaultEss.GridOverCurrentL1).faultBit(8, // Locking waveform too many times
FaultEss.LockingWaveformTooManyTimesL1).faultBit(9, // Inverter voltage zero drift
FaultEss.InverterVoltageZeroDriftErrorL1).faultBit(10, // Grid voltage zero drift error
FaultEss.GridVoltageZeroDriftErrorL1).faultBit(11, // Control current zero drift
FaultEss.ControlCurrentZeroDriftErrorL1).faultBit(12, // Inverter current zero drift
FaultEss.InverterCurrentZeroDriftErrorL1).faultBit(13, // Grid current zero drift error
FaultEss.GridCurrentZeroDriftErrorL1).faultBit(14, // PDP protection
FaultEss.PDPProtectionL1).faultBit(15, // Hardware control current
FaultEss.HardwareControlCurrentProtectionL1)), // protection
new UnsignedWordElement(153, //
new ModbusBitWrappingChannel("PcsFault2L1", this, state).faultBit(0, // Hardware AC volt. protection
FaultEss.HardwareACVoltageProtectionL1).faultBit(1, // Hardware DC curr. protection
FaultEss.HardwareDCCurrentProtectionL1).faultBit(2, // Hardware temperature
FaultEss.HardwareTemperatureProtectionL1).faultBit(3, // No capturing signal
FaultEss.NoCapturingSignalL1).faultBit(4, // DC overvoltage
FaultEss.DCOvervoltageL1).faultBit(5, // DC disconnected
FaultEss.DCDisconnectedL1).faultBit(6, // Inverter undervoltage
FaultEss.InverterUndervoltageL1).faultBit(7, // Inverter overvoltage
FaultEss.InverterOvervoltageL1).faultBit(8, // Current sensor fail
FaultEss.CurrentSensorFailL1).faultBit(9, // Voltage sensor fail
FaultEss.VoltageSensorFailL1).faultBit(10, // Power uncontrollable
FaultEss.PowerUncontrollableL1).faultBit(11, // Current uncontrollable
FaultEss.CurrentUncontrollableL1).faultBit(12, // Fan error
FaultEss.FanErrorL1).faultBit(13, // Phase lack
FaultEss.PhaseLackL1).faultBit(14, // Inverter relay fault
FaultEss.InverterRelayFaultL1).faultBit(15, // Grid relay fault
FaultEss.GridRealyFaultL1)), new UnsignedWordElement(154, //
new ModbusBitWrappingChannel("PcsFault3L1", this, state).faultBit(0, // Control panel overtemp
FaultEss.ControlPanelOvertempL1).faultBit(1, // Power panel overtemp
FaultEss.PowerPanelOvertempL1).faultBit(2, // DC input overcurrent
FaultEss.DCInputOvercurrentL1).faultBit(3, // Capacitor overtemp
FaultEss.CapacitorOvertempL1).faultBit(4, // Radiator overtemp
FaultEss.RadiatorOvertempL1).faultBit(5, // Transformer overtemp
FaultEss.TransformerOvertempL1).faultBit(6, // Combination comm error
FaultEss.CombinationCommErrorL1).faultBit(7, // EEPROM error
FaultEss.EEPROMErrorL1).faultBit(8, // Load current zero drift error
FaultEss.LoadCurrentZeroDriftErrorL1).faultBit(9, // Current limit-R error
FaultEss.CurrentLimitRErrorL1).faultBit(10, // Phase sync error
FaultEss.PhaseSyncErrorL1).faultBit(11, // External PV current zero
FaultEss.ExternalPVCurrentZeroDriftErrorL1).faultBit(12, // External grid current
FaultEss.ExternalGridCurrentZeroDriftErrorL1)), // zero drift error
new UnsignedWordElement(155, //
new ModbusBitWrappingChannel("PcsAlarm1L2", this, state).warningBit(0, // Grid undervoltage
WarningEss.GridUndervoltageL2).warningBit(1, // Grid overvoltage
WarningEss.GridOvervoltageL2).warningBit(2, // Grid under frequency
WarningEss.GridUnderFrequencyL2).warningBit(3, // Grid over frequency
WarningEss.GridOverFrequencyL2).warningBit(4, // Grid power supply off
WarningEss.GridPowerSupplyOffL2).warningBit(5, // Grid condition unmeet
WarningEss.GridConditionUnmeetL2).warningBit(6, // DC under voltage
WarningEss.DCUnderVoltageL2).warningBit(7, // Input over resistance
WarningEss.InputOverResistanceL2).warningBit(8, // Combination error
WarningEss.CombinationErrorL2).warningBit(9, // Comm with inverter error
WarningEss.CommWithInverterErrorL2).warningBit(10, // Tme error
WarningEss.TmeErrorL2)), new UnsignedWordElement(156, new ModbusBitWrappingChannel("PcsAlarm2L2", this, state)), new UnsignedWordElement(157, //
new ModbusBitWrappingChannel("PcsFault1L2", this, state).faultBit(0, // Control current overload
FaultEss.ControlCurrentOverload100PercentL2).faultBit(1, // Control current overload
FaultEss.ControlCurrentOverload110PercentL2).faultBit(2, // Control current overload
FaultEss.ControlCurrentOverload150PercentL2).faultBit(3, // Control current overload
FaultEss.ControlCurrentOverload200PercentL2).faultBit(4, // Control current overload
FaultEss.ControlCurrentOverload120PercentL2).faultBit(5, // Control current overload
FaultEss.ControlCurrentOverload300PercentL2).faultBit(6, // Control transient load 300%
FaultEss.ControlTransientLoad300PercentL2).faultBit(7, // Grid over current
FaultEss.GridOverCurrentL2).faultBit(8, // Locking waveform too many times
FaultEss.LockingWaveformTooManyTimesL2).faultBit(9, // Inverter voltage zero drift
FaultEss.InverterVoltageZeroDriftErrorL2).faultBit(10, // Grid voltage zero drift error
FaultEss.GridVoltageZeroDriftErrorL2).faultBit(11, // Control current zero drift
FaultEss.ControlCurrentZeroDriftErrorL2).faultBit(12, // Inverter current zero drift
FaultEss.InverterCurrentZeroDriftErrorL2).faultBit(13, // Grid current zero drift error
FaultEss.GridCurrentZeroDriftErrorL2).faultBit(14, // PDP protection
FaultEss.PDPProtectionL2).faultBit(15, // Hardware control current
FaultEss.HardwareControlCurrentProtectionL2)), // protection
new UnsignedWordElement(158, //
new ModbusBitWrappingChannel("PcsFault2L2", this, state).faultBit(0, // Hardware AC volt. protection
FaultEss.HardwareACVoltageProtectionL2).faultBit(1, // Hardware DC curr. protection
FaultEss.HardwareDCCurrentProtectionL2).faultBit(2, // Hardware temperature
FaultEss.HardwareTemperatureProtectionL2).faultBit(3, // No capturing signal
FaultEss.NoCapturingSignalL2).faultBit(4, // DC overvoltage
FaultEss.DCOvervoltageL2).faultBit(5, // DC disconnected
FaultEss.DCDisconnectedL2).faultBit(6, // Inverter undervoltage
FaultEss.InverterUndervoltageL2).faultBit(7, // Inverter overvoltage
FaultEss.InverterOvervoltageL2).faultBit(8, // Current sensor fail
FaultEss.CurrentSensorFailL2).faultBit(9, // Voltage sensor fail
FaultEss.VoltageSensorFailL2).faultBit(10, // Power uncontrollable
FaultEss.PowerUncontrollableL2).faultBit(11, // Current uncontrollable
FaultEss.CurrentUncontrollableL2).faultBit(12, // Fan error
FaultEss.FanErrorL2).faultBit(13, // Phase lack
FaultEss.PhaseLackL2).faultBit(14, // Inverter relay fault
FaultEss.InverterRelayFaultL2).faultBit(15, // Grid relay fault
FaultEss.GridRealyFaultL2)), new UnsignedWordElement(159, //
new ModbusBitWrappingChannel("PcsFault3L2", this, state).faultBit(0, // Control panel overtemp
FaultEss.ControlPanelOvertempL2).faultBit(1, // Power panel overtemp
FaultEss.PowerPanelOvertempL2).faultBit(2, // DC input overcurrent
FaultEss.DCInputOvercurrentL2).faultBit(3, // Capacitor overtemp
FaultEss.CapacitorOvertempL2).faultBit(4, // Radiator overtemp
FaultEss.RadiatorOvertempL2).faultBit(5, // Transformer overtemp
FaultEss.TransformerOvertempL2).faultBit(6, // Combination comm error
FaultEss.CombinationCommErrorL2).faultBit(7, // EEPROM error
FaultEss.EEPROMErrorL2).faultBit(8, // Load current zero drift error
FaultEss.LoadCurrentZeroDriftErrorL2).faultBit(9, // Current limit-R error
FaultEss.CurrentLimitRErrorL2).faultBit(10, // Phase sync error
FaultEss.PhaseSyncErrorL2).faultBit(11, // External PV current zero
FaultEss.ExternalPVCurrentZeroDriftErrorL2).faultBit(12, // External grid current
FaultEss.ExternalGridCurrentZeroDriftErrorL2)), // zero drift error
new UnsignedWordElement(160, //
new ModbusBitWrappingChannel("PcsAlarm1L3", this, state).warningBit(0, // Grid undervoltage
WarningEss.GridUndervoltageL3).warningBit(1, // Grid overvoltage
WarningEss.GridOvervoltageL3).warningBit(2, // Grid under frequency
WarningEss.GridUnderFrequencyL3).warningBit(3, // Grid over frequency
WarningEss.GridOverFrequencyL3).warningBit(4, // Grid power supply off
WarningEss.GridPowerSupplyOffL3).warningBit(5, // Grid condition unmeet
WarningEss.GridConditionUnmeetL3).warningBit(6, // DC under voltage
WarningEss.DCUnderVoltageL3).warningBit(7, // Input over resistance
WarningEss.InputOverResistanceL3).warningBit(8, // Combination error
WarningEss.CombinationErrorL3).warningBit(9, // Comm with inverter error
WarningEss.CommWithInverterErrorL3).warningBit(10, // Tme error
WarningEss.TmeErrorL3)), new UnsignedWordElement(161, new ModbusBitWrappingChannel("PcsAlarm2L3", this, state)), new UnsignedWordElement(162, //
new ModbusBitWrappingChannel("PcsFault1L3", this, state).faultBit(0, // Control current overload
FaultEss.ControlCurrentOverload100PercentL3).faultBit(1, // Control current overload
FaultEss.ControlCurrentOverload110PercentL3).faultBit(2, // Control current overload
FaultEss.ControlCurrentOverload150PercentL3).faultBit(3, // Control current overload
FaultEss.ControlCurrentOverload200PercentL3).faultBit(4, // Control current overload
FaultEss.ControlCurrentOverload120PercentL3).faultBit(5, // Control current overload
FaultEss.ControlCurrentOverload300PercentL3).faultBit(6, // Control transient load 300%
FaultEss.ControlTransientLoad300PercentL3).faultBit(7, // Grid over current
FaultEss.GridOverCurrentL3).faultBit(8, // Locking waveform too many times
FaultEss.LockingWaveformTooManyTimesL3).faultBit(9, // Inverter voltage zero drift
FaultEss.InverterVoltageZeroDriftErrorL3).faultBit(10, // Grid voltage zero drift error
FaultEss.GridVoltageZeroDriftErrorL3).faultBit(11, // Control current zero drift
FaultEss.ControlCurrentZeroDriftErrorL3).faultBit(12, // Inverter current zero drift
FaultEss.InverterCurrentZeroDriftErrorL3).faultBit(13, // Grid current zero drift error
FaultEss.GridCurrentZeroDriftErrorL3).faultBit(14, // PDP protection
FaultEss.PDPProtectionL3).faultBit(15, // Hardware control current
FaultEss.HardwareControlCurrentProtectionL3)), // protection
new UnsignedWordElement(163, //
new ModbusBitWrappingChannel("PcsFault2L3", this, state).faultBit(0, // Hardware AC volt. protection
FaultEss.HardwareACVoltageProtectionL3).faultBit(1, // Hardware DC curr. protection
FaultEss.HardwareDCCurrentProtectionL3).faultBit(2, // Hardware temperature
FaultEss.HardwareTemperatureProtectionL3).faultBit(3, // No capturing signal
FaultEss.NoCapturingSignalL3).faultBit(4, // DC overvoltage
FaultEss.DCOvervoltageL3).faultBit(5, // DC disconnected
FaultEss.DCDisconnectedL3).faultBit(6, // Inverter undervoltage
FaultEss.InverterUndervoltageL3).faultBit(7, // Inverter overvoltage
FaultEss.InverterOvervoltageL3).faultBit(8, // Current sensor fail
FaultEss.CurrentSensorFailL3).faultBit(9, // Voltage sensor fail
FaultEss.VoltageSensorFailL3).faultBit(10, // Power uncontrollable
FaultEss.PowerUncontrollableL3).faultBit(11, // Current uncontrollable
FaultEss.CurrentUncontrollableL3).faultBit(12, // Fan error
FaultEss.FanErrorL3).faultBit(13, // Phase lack
FaultEss.PhaseLackL3).faultBit(14, // Inverter relay fault
FaultEss.InverterRelayFaultL3).faultBit(15, // Grid relay fault
FaultEss.GridRealyFaultL3)), new UnsignedWordElement(164, //
new ModbusBitWrappingChannel("PcsFault3L3", this, state).faultBit(0, // Control panel overtemp
FaultEss.ControlPanelOvertempL3).faultBit(1, // Power panel overtemp
FaultEss.PowerPanelOvertempL3).faultBit(2, // DC input overcurrent
FaultEss.DCInputOvercurrentL3).faultBit(3, // Capacitor overtemp
FaultEss.CapacitorOvertempL3).faultBit(4, // Radiator overtemp
FaultEss.RadiatorOvertempL3).faultBit(5, // Transformer overtemp
FaultEss.TransformerOvertempL3).faultBit(6, // Combination comm error
FaultEss.CombinationCommErrorL3).faultBit(7, // EEPROM error
FaultEss.EEPROMErrorL3).faultBit(8, // Load current zero drift error
FaultEss.LoadCurrentZeroDriftErrorL3).faultBit(9, // Current limit-R error
FaultEss.CurrentLimitRErrorL3).faultBit(10, // Phase sync error
FaultEss.PhaseSyncErrorL3).faultBit(11, // External PV current zero
FaultEss.ExternalPVCurrentZeroDriftErrorL3).faultBit(12, // External grid current
FaultEss.ExternalGridCurrentZeroDriftErrorL3))), // zero drift error
new //
WriteableModbusRegisterRange(//
200, new UnsignedWordElement(200, setWorkState = //
new ModbusWriteLongChannel("SetWorkState", this).label(0, //
"Local control").label(1, // "Remote control on grid starting"
START).label(2, //
"Remote control off grid starting").label(3, //
STANDBY).label(4, STOP))), new //
WriteableModbusRegisterRange(//
206, new SignedWordElement(206, //
setActivePowerL1 = new ModbusWriteLongChannel("SetActivePowerL1", this).unit("W")), new SignedWordElement(207, setReactivePowerL1 = new ModbusWriteLongChannel("SetReactivePowerL1", this).unit(//
"Var")), new SignedWordElement(208, //
setActivePowerL2 = new ModbusWriteLongChannel("SetActivePowerL2", this).unit("W")), new SignedWordElement(209, setReactivePowerL2 = new ModbusWriteLongChannel("SetReactivePowerL2", this).unit(//
"Var")), new SignedWordElement(210, //
setActivePowerL3 = new ModbusWriteLongChannel("SetActivePowerL3", this).unit("W")), new SignedWordElement(211, //
setReactivePowerL3 = new ModbusWriteLongChannel("SetReactivePowerL3", this).unit("Var"))), //
new ModbusRegisterRange(3020, new UnsignedWordElement(3020, batteryVoltageSection1 = new ModbusReadLongChannel("BatteryVoltageSection1", this).unit("mV")), new UnsignedWordElement(3021, batteryVoltageSection2 = new ModbusReadLongChannel("BatteryVoltageSection2", this).unit("mV")), new UnsignedWordElement(3022, batteryVoltageSection3 = new ModbusReadLongChannel("BatteryVoltageSection3", this).unit("mV")), new UnsignedWordElement(3023, batteryVoltageSection4 = new ModbusReadLongChannel("BatteryVoltageSection4", this).unit("mV")), new UnsignedWordElement(3024, batteryVoltageSection5 = new ModbusReadLongChannel("BatteryVoltageSection5", this).unit("mV")), new UnsignedWordElement(3025, batteryVoltageSection6 = new ModbusReadLongChannel("BatteryVoltageSection6", this).unit("mV")), new UnsignedWordElement(3026, batteryVoltageSection7 = new ModbusReadLongChannel("BatteryVoltageSection7", this).unit("mV")), new UnsignedWordElement(3027, batteryVoltageSection8 = new ModbusReadLongChannel("BatteryVoltageSection8", this).unit("mV")), new UnsignedWordElement(3028, batteryVoltageSection9 = new ModbusReadLongChannel("BatteryVoltageSection9", this).unit("mV")), new UnsignedWordElement(3029, batteryVoltageSection10 = new ModbusReadLongChannel("BatteryVoltageSection10", this).unit("mV")), new UnsignedWordElement(3030, batteryVoltageSection11 = new ModbusReadLongChannel("BatteryVoltageSection11", this).unit("mV")), new UnsignedWordElement(3031, batteryVoltageSection12 = new ModbusReadLongChannel("BatteryVoltageSection12", this).unit("mV")), new UnsignedWordElement(3032, batteryVoltageSection13 = new ModbusReadLongChannel("BatteryVoltageSection13", this).unit("mV")), new UnsignedWordElement(3033, batteryVoltageSection14 = new ModbusReadLongChannel("BatteryVoltageSection14", this).unit("mV")), new UnsignedWordElement(3034, batteryVoltageSection15 = new ModbusReadLongChannel("BatteryVoltageSection15", this).unit("mV")), new UnsignedWordElement(3035, batteryVoltageSection16 = new ModbusReadLongChannel("BatteryVoltageSection16", this).unit("mV")), new UnsignedWordElement(3036, batteryTemperatureSection1 = new ModbusReadLongChannel("BatteryTemperatureSection1", this).unit("°C").delta(-40L)), new UnsignedWordElement(3037, batteryTemperatureSection2 = new ModbusReadLongChannel("BatteryTemperatureSection2", this).unit("°C").delta(-40L)), new UnsignedWordElement(3038, batteryTemperatureSection3 = new ModbusReadLongChannel("BatteryTemperatureSection3", this).unit("°C").delta(-40L)), new UnsignedWordElement(3039, batteryTemperatureSection4 = new ModbusReadLongChannel("BatteryTemperatureSection4", this).unit("°C").delta(-40L)), new UnsignedWordElement(3040, batteryTemperatureSection5 = new ModbusReadLongChannel("BatteryTemperatureSection5", this).unit("°C").delta(-40L)), new UnsignedWordElement(3041, batteryTemperatureSection6 = new ModbusReadLongChannel("BatteryTemperatureSection6", this).unit("°C").delta(-40L)), new UnsignedWordElement(3042, batteryTemperatureSection7 = new ModbusReadLongChannel("BatteryTemperatureSection7", this).unit("°C").delta(-40L)), new UnsignedWordElement(3043, batteryTemperatureSection8 = new ModbusReadLongChannel("BatteryTemperatureSection8", this).unit("°C").delta(-40L)), new UnsignedWordElement(3044, batteryTemperatureSection9 = new ModbusReadLongChannel("BatteryTemperatureSection9", this).unit("°C").delta(-40L)), new UnsignedWordElement(3045, batteryTemperatureSection10 = new ModbusReadLongChannel("BatteryTemperatureSection10", this).unit("°C").delta(-40L)), new UnsignedWordElement(3046, batteryTemperatureSection11 = new ModbusReadLongChannel("BatteryTemperatureSection11", this).unit("°C").delta(-40L)), new UnsignedWordElement(3047, batteryTemperatureSection12 = new ModbusReadLongChannel("BatteryTemperatureSection12", this).unit("°C").delta(-40L)), new UnsignedWordElement(3048, batteryTemperatureSection13 = new ModbusReadLongChannel("BatteryTemperatureSection13", this).unit("°C").delta(-40L)), new UnsignedWordElement(3049, batteryTemperatureSection14 = new ModbusReadLongChannel("BatteryTemperatureSection14", this).unit("°C").delta(-40L)), new UnsignedWordElement(3050, batteryTemperatureSection15 = new ModbusReadLongChannel("BatteryTemperatureSection15", this).unit("°C").delta(-40L)), new UnsignedWordElement(3051, batteryTemperatureSection16 = new ModbusReadLongChannel("BatteryTemperatureSection16", this).unit("°C").delta(-40L))), new //
WriteableModbusRegisterRange(//
9014, new UnsignedWordElement(9014, rtcYear = new ModbusWriteLongChannel("Year", this)), new UnsignedWordElement(9015, rtcMonth = new ModbusWriteLongChannel("Month", this)), new UnsignedWordElement(9016, rtcDay = new ModbusWriteLongChannel("Day", this)), new UnsignedWordElement(9017, rtcHour = new ModbusWriteLongChannel("Hour", this)), new UnsignedWordElement(9018, rtcMinute = new ModbusWriteLongChannel("Minute", this)), new UnsignedWordElement(9019, rtcSecond = new ModbusWriteLongChannel("Second", this))), new WriteableModbusRegisterRange(30558, new UnsignedWordElement(30558, setSetupMode = new ModbusWriteLongChannel("SetSetupMode", this).label(0, EssNature.OFF).label(1, EssNature.ON))), new WriteableModbusRegisterRange(30559, new UnsignedWordElement(30559, setPcsMode = //
new ModbusWriteLongChannel("SetPcsMode", this).label(0, //
"Emergency").label(1, //
"ConsumersPeakPattern").label(2, //
"Economic").label(3, //
"Eco").label(4, //
"Debug").label(5, //
"SmoothPv").label(6, "Remote"))), new ModbusRegisterRange(30157, new UnsignedWordElement(30157, setupMode = //
new ModbusReadLongChannel("SetupMode", this).label(0, //
EssNature.OFF).label(1, EssNature.ON)), new UnsignedWordElement(30158, pcsMode = //
new ModbusReadLongChannel("PcsMode", this).label(0, //
"Emergency").label(1, //
"ConsumersPeakPattern").label(2, //
"Economic").label(3, //
"Eco").label(4, //
"Debug").label(5, //
"SmoothPv").label(6, "Remote"))));
gridMode = new FunctionalReadChannel<Long>("GridMode", this, (channels) -> {
ReadChannel<Long> state = channels[0];
try {
if (state.value() == 1L) {
return 0L;
} else {
return 1L;
}
} catch (InvalidValueException e) {
return null;
}
}, systemState).label(0L, OFF_GRID).label(1L, ON_GRID);
allowedApparent = new FunctionalReadChannel<Long>("AllowedApparent", this, (channels) -> {
ReadChannel<Long> apparent = channels[0];
try {
return apparent.value() * 3;
} catch (InvalidValueException e) {
log.error(e.getMessage());
}
return 0l;
}, phaseAllowedApparent);
// FaultChannels
state.addFaultChannel(new ValueToBooleanThingStateChannel(FaultEss.SystemFault, this, systemState, 3L));
state.addFaultChannel(new ValueToBooleanThingStateChannel(FaultEss.BatteryFault, this, batteryGroupState, 5L));
state.addFaultChannel(new ValueToBooleanThingStateChannel(FaultEss.PCSFault, this, pcsOperationState, 5L));
// WarningChannels
state.addWarningChannel(new ValueToBooleanThingStateChannel(WarningEss.OFFGrid, this, systemState, 1L));
return protokol;
}
use of io.openems.impl.protocol.modbus.internal.SignedWordElement in project openems by OpenEMS.
the class RefuEss method defineModbusProtocol.
@Override
protected ModbusProtocol defineModbusProtocol() throws ConfigException {
ModbusProtocol protocol = new //
ModbusProtocol(new //
ModbusInputRegisterRange(//
0x100, new //
UnsignedWordElement(//
0x100, systemState = //
new ModbusReadLongChannel("SystemState", this).label(0, //
STOP).label(1, //
"Init").label(2, //
"Pre-operation").label(3, //
STANDBY).label(4, //
START).label(5, FAULT)), new //
UnsignedWordElement(//
0x101, //
new ModbusBitWrappingChannel("SystemError1", this, this.thingState).faultBit(0, //
FaultEss.BMSInError).faultBit(1, //
FaultEss.BMSInErrorSecond).faultBit(2, //
FaultEss.BMSUndervoltage).faultBit(3, //
FaultEss.BMSOvercurrent).faultBit(4, //
FaultEss.ErrorBMSLimitsNotInitialized).faultBit(5, //
FaultEss.ConnectError).faultBit(6, //
FaultEss.OvervoltageWarning).faultBit(7, //
FaultEss.UndervoltageWarning).faultBit(8, //
FaultEss.OvercurrentWarning).faultBit(9, //
FaultEss.BMSReady).faultBit(10, //
FaultEss.TREXReady)), new UnsignedWordElement(0x102, communicationInformations = //
new StatusBitChannel("CommunicationInformations", this).label(1, //
"Gateway Initialized").label(2, //
"Modbus Slave Status").label(4, //
"Modbus Master Status").label(8, //
"CAN Timeout").label(16, //
"First Communication Ok")), new UnsignedWordElement(0x103, inverterStatus = //
new StatusBitChannel("InverterStatus", this).label(1, //
"Ready to Power on").label(2, //
"Ready for Operating").label(4, //
"Enabled").label(8, //
"Fault").label(256, //
"Warning").label(512, //
"Voltage/Current mode").label(1024, //
"Power mode").label(2048, //
"AC relays close").label(4096, //
"DC relays 1 close").label(8192, //
"DC relays 2 close").label(16384, //
"Mains OK")), new UnsignedWordElement(0x104, errorCode = new ModbusReadLongChannel("ErrorCode", this)), new UnsignedWordElement(0x105, dcDcStatus = //
new StatusBitChannel("DCDCStatus", this).label(1, //
"Ready to Power on").label(2, //
"Ready for Operating").label(4, //
"Enabled").label(8, //
"DCDC Fault").label(128, //
"DCDC Warning").label(256, //
"Voltage/Current mode").label(512, //
"Power mode")), new UnsignedWordElement(0x106, dcDcError = new ModbusReadLongChannel("DCDCError", this)), new SignedWordElement(0x107, batteryCurrentPcs = new ModbusReadLongChannel("BatteryCurrentPcs", this).unit("mA").multiplier(//
2)), new SignedWordElement(0x108, batteryVoltagePcs = new ModbusReadLongChannel("BatteryVoltagePcs", this).unit("mV").multiplier(//
2)), new SignedWordElement(0x109, //
current = new ModbusReadLongChannel("Current", this).unit("mA").multiplier(2)), new SignedWordElement(0x10A, //
currentL1 = new ModbusReadLongChannel("CurrentL1", this).unit("mA").multiplier(2)), new SignedWordElement(0x10B, //
currentL2 = new ModbusReadLongChannel("CurrentL2", this).unit("mA").multiplier(2)), new SignedWordElement(0x10C, //
currentL3 = new ModbusReadLongChannel("CurrentL3", this).unit("mA").multiplier(2)), new SignedWordElement(0x10D, //
activePower = new ModbusReadLongChannel("ActivePower", this).unit("W").multiplier(2)), new SignedWordElement(0x10E, activePowerL1 = new ModbusReadLongChannel("ActivePowerL1", this).unit("W").multiplier(//
2)), new SignedWordElement(0x10F, activePowerL2 = new ModbusReadLongChannel("ActivePowerL2", this).unit("W").multiplier(//
2)), new SignedWordElement(0x110, activePowerL3 = new ModbusReadLongChannel("ActivePowerL3", this).unit("W").multiplier(//
2)), new SignedWordElement(0x111, reactivePower = new ModbusReadLongChannel("ReactivePower", this).unit("Var").multiplier(//
2)), new SignedWordElement(0x112, reactivePowerL1 = new ModbusReadLongChannel("ReactivePowerL1", this).unit("Var").multiplier(//
2)), new SignedWordElement(0x113, reactivePowerL2 = new ModbusReadLongChannel("ReactivePowerL2", this).unit("Var").multiplier(//
2)), new SignedWordElement(0x114, reactivePowerL3 = new ModbusReadLongChannel("ReactivePowerL3", this).unit("Var").multiplier(//
2)), //
new SignedWordElement(0x115, cosPhi3p = new ModbusReadLongChannel("CosPhi3p", this).unit("")), //
new SignedWordElement(0x116, cosPhiL1 = new ModbusReadLongChannel("CosPhiL1", this).unit("")), //
new SignedWordElement(0x117, cosPhiL2 = new ModbusReadLongChannel("CosPhiL2", this).unit("")), //
new SignedWordElement(0x118, cosPhiL3 = new ModbusReadLongChannel("CosPhiL3", this).unit(""))), new //
ModbusInputRegisterRange(//
0x11A, new SignedWordElement(0x11A, pcsAllowedCharge = new ModbusReadLongChannel("PcsAllowedCharge", this).unit("kW").multiplier(2)), new SignedWordElement(0x11B, pcsAllowedDischarge = new ModbusReadLongChannel("PcsAllowedDischarge", this).unit("kW").multiplier(2)), new //
UnsignedWordElement(//
0x11C, batteryState = //
new ModbusReadLongChannel("BatteryState", this).label(0, //
"Initial").label(1, //
STOP).label(2, //
"Starting").label(3, //
START).label(4, //
"Stopping").label(5, //
"Fault")), new //
UnsignedWordElement(//
0x11D, batteryMode = new ModbusReadLongChannel("BatteryMode", this).label(0, "Normal Mode")), new SignedWordElement(0x11E, batteryVoltage = new ModbusReadLongChannel("BatteryVoltage", this).unit("mV").multiplier(2)), new SignedWordElement(0x11F, batteryCurrent = new ModbusReadLongChannel("BatteryCurrent", this).unit("mA").multiplier(2)), new //
SignedWordElement(//
0x120, batteryPower = //
new ModbusReadLongChannel("BatteryPower", this).unit("W").multiplier(2)), new //
UnsignedWordElement(//
0x121, soc = new ModbusReadLongChannel("Soc", this).unit("%")), new //
UnsignedWordElement(//
0x122, allowedChargeCurrent = new ModbusReadLongChannel("AllowedChargeCurrent", this).unit(//
"mA").multiplier(//
2).negate()), new //
UnsignedWordElement(//
0x123, allowedDischargeCurrent = new ModbusReadLongChannel("AllowedDischargeCurrent", this).unit("mA").multiplier(2)), new //
UnsignedWordElement(//
0x124, allowedCharge = new ModbusReadLongChannel("AllowedCharge", this).unit("W").multiplier(2).negate()), new //
UnsignedWordElement(//
0x125, allowedDischarge = new ModbusReadLongChannel("AllowedDischarge", this).unit("W").multiplier(2)), new //
SignedDoublewordElement(//
0x126, batteryChargeEnergy = new ModbusReadLongChannel("BatteryChargeEnergy", this).unit("kWh")).wordorder(WordOrder.LSWMSW), new //
SignedDoublewordElement(//
0x128, batteryDischargeEnergy = new ModbusReadLongChannel("BatteryDischargeEnergy", this).unit("kWh")).wordorder(WordOrder.LSWMSW), new //
UnsignedWordElement(//
0x12A, batteryOperationStatus = new StatusBitChannel("BatteryOperationStatus", this).label(1, //
"Battery group 1 operating").label(2, //
"Battery group 2 operating").label(4, //
"Battery group 3 operating").label(8, "Battery group 4 operating")), new //
UnsignedWordElement(//
0x12B, batteryHighestVoltage = new ModbusReadLongChannel("BatteryHighestVoltage", this).unit("mV")), new //
UnsignedWordElement(//
0x12C, batteryLowestVoltage = new ModbusReadLongChannel("BatteryLowestVoltage", this).unit("mV")), new //
SignedWordElement(//
0x12D, batteryHighestTemperature = new ModbusReadLongChannel("BatteryHighestTemperature", this).unit("�C")), new //
SignedWordElement(//
0x12E, batteryLowestTemperature = new ModbusReadLongChannel("BatteryLowestTemperature", this).unit("�C")), new //
UnsignedWordElement(//
0x12F, batteryStopRequest = new ModbusReadLongChannel("BatteryStopRequest", this)), new //
UnsignedWordElement(//
0x130, //
new ModbusBitWrappingChannel("BatteryAlarm1", this, this.thingState).warningBit(0, //
WarningEss.NormalChargingOverCurrent).warningBit(1, //
WarningEss.CharginigCurrentOverLimit).warningBit(2, //
WarningEss.DischargingCurrentOverLimit).warningBit(3, //
WarningEss.NormalHighVoltage).warningBit(4, //
WarningEss.NormalLowVoltage).warningBit(5, //
WarningEss.AbnormalVoltageVariation).warningBit(6, //
WarningEss.NormalHighTemperature).warningBit(7, //
WarningEss.NormalLowTemperature).warningBit(8, //
WarningEss.AbnormalTemperatureVariation).warningBit(9, //
WarningEss.SeriousHighVoltage).warningBit(10, //
WarningEss.SeriousLowVoltage).warningBit(11, //
WarningEss.SeriousLowTemperature).warningBit(12, //
WarningEss.ChargingSeriousOverCurrent).warningBit(13, //
WarningEss.DischargingSeriousOverCurrent).warningBit(14, //
WarningEss.AbnormalCapacityAlarm)), new //
UnsignedWordElement(//
0x131, //
new ModbusBitWrappingChannel("BatteryAlarm2", this, this.thingState).warningBit(0, //
WarningEss.EEPROMParameterFailure).warningBit(1, WarningEss.SwitchOfInsideCombinedCabinet).warningBit(5, WarningEss.ShouldNotBeConnectedToGridDueToTheDCSideCondition).warningBit(7, //
WarningEss.EmergencyStopRequireFromSystemController)), new //
UnsignedWordElement(//
0x132, //
new ModbusBitWrappingChannel("BatteryAlarm3", this, this.thingState).warningBit(0, //
WarningEss.BatteryGroup1EnableAndNotConnectedToGrid).warningBit(1, //
WarningEss.BatteryGroup2EnableAndNotConnectedToGrid).warningBit(2, //
WarningEss.BatteryGroup3EnableAndNotConnectedToGrid).warningBit(3, //
WarningEss.BatteryGroup4EnableAndNotConnectedToGrid)), new //
UnsignedWordElement(//
0x133, //
new ModbusBitWrappingChannel("BatteryAlarm4", this, this.thingState).warningBit(0, WarningEss.TheIsolationSwitchOfBatteryGroup1Open).warningBit(1, WarningEss.TheIsolationSwitchOfBatteryGroup2Open).warningBit(2, WarningEss.TheIsolationSwitchOfBatteryGroup3Open).warningBit(3, //
WarningEss.TheIsolationSwitchOfBatteryGroup4Open)), //
new DummyElement(0x134), new UnsignedWordElement(0x135, //
new ModbusBitWrappingChannel("BatteryAlarm6", this, this.thingState).warningBit(0, //
WarningEss.BalancingSamplingFailureOfBatteryGroup1).warningBit(1, //
WarningEss.BalancingSamplingFailureOfBatteryGroup2).warningBit(2, //
WarningEss.BalancingSamplingFailureOfBatteryGroup3).warningBit(3, //
WarningEss.BalancingSamplingFailureOfBatteryGroup4)), new //
UnsignedWordElement(//
0x136, //
new ModbusBitWrappingChannel("BatteryAlarm7", this, this.thingState).warningBit(0, //
WarningEss.BalancingControlFailureOfBatteryGroup1).warningBit(1, //
WarningEss.BalancingControlFailureOfBatteryGroup2).warningBit(2, //
WarningEss.BalancingControlFailureOfBatteryGroup3).warningBit(3, //
WarningEss.BalancingControlFailureOfBatteryGroup4)), new //
UnsignedWordElement(//
0x137, //
new ModbusBitWrappingChannel("BatteryFault1", this, this.thingState).faultBit(0, //
FaultEss.NoEnableBateryGroupOrUsableBatteryGroup).faultBit(1, //
FaultEss.NormalLeakageOfBatteryGroup).faultBit(2, //
FaultEss.SeriousLeakageOfBatteryGroup).faultBit(3, //
FaultEss.BatteryStartFailure).faultBit(4, //
FaultEss.BatteryStopFailure).faultBit(5, //
FaultEss.InterruptionOfCANCommunicationBetweenBatteryGroupAndController).faultBit(10, //
FaultEss.EmergencyStopAbnormalOfAuxiliaryCollector).faultBit(11, //
FaultEss.LeakageSelfDetectionOnNegative).faultBit(12, //
FaultEss.LeakageSelfDetectionOnPositive).faultBit(13, //
FaultEss.SelfDetectionFailureOnBattery)), new //
UnsignedWordElement(//
0x138, //
new ModbusBitWrappingChannel("BatteryFault2", this, this.thingState).faultBit(0, //
FaultEss.CANCommunicationInterruptionBetweenBatteryGroupAndGroup1).faultBit(1, //
FaultEss.CANCommunicationInterruptionBetweenBatteryGroupAndGroup2).faultBit(2, //
FaultEss.CANCommunicationInterruptionBetweenBatteryGroupAndGroup3).faultBit(3, //
FaultEss.CANCommunicationInterruptionBetweenBatteryGroupAndGroup4)), new //
UnsignedWordElement(//
0x139, //
new ModbusBitWrappingChannel("BatteryFault3", this, this.thingState).faultBit(0, //
FaultEss.MainContractorAbnormalInBatterySelfDetectGroup1).faultBit(1, //
FaultEss.MainContractorAbnormalInBatterySelfDetectGroup2).faultBit(2, //
FaultEss.MainContractorAbnormalInBatterySelfDetectGroup3).faultBit(3, //
FaultEss.MainContractorAbnormalInBatterySelfDetectGroup4)), new //
UnsignedWordElement(//
0x13A, //
new ModbusBitWrappingChannel("BatteryFault4", this, this.thingState).faultBit(0, //
FaultEss.PreChargeContractorAbnormalOnBatterySelfDetectGroup1).faultBit(1, //
FaultEss.PreChargeContractorAbnormalOnBatterySelfDetectGroup2).faultBit(2, //
FaultEss.PreChargeContractorAbnormalOnBatterySelfDetectGroup3).faultBit(3, //
FaultEss.PreChargeContractorAbnormalOnBatterySelfDetectGroup4)), new //
UnsignedWordElement(//
0x13B, //
new ModbusBitWrappingChannel("BatteryFault5", this, this.thingState).faultBit(0, //
FaultEss.MainContactFailureOnBatteryControlGroup1).faultBit(1, //
FaultEss.MainContactFailureOnBatteryControlGroup2).faultBit(2, //
FaultEss.MainContactFailureOnBatteryControlGroup3).faultBit(3, //
FaultEss.MainContactFailureOnBatteryControlGroup4)), new //
UnsignedWordElement(//
0x13C, //
new ModbusBitWrappingChannel("BatteryFault6", this, this.thingState).faultBit(0, //
FaultEss.PreChargeFailureOnBatteryControlGroup1).faultBit(1, //
FaultEss.PreChargeFailureOnBatteryControlGroup2).faultBit(2, //
FaultEss.PreChargeFailureOnBatteryControlGroup3).faultBit(3, //
FaultEss.PreChargeFailureOnBatteryControlGroup4)), new //
UnsignedWordElement(//
0x13D, //
new ModbusBitWrappingChannel("BatteryFault7", this, this.thingState)), new //
UnsignedWordElement(//
0x13E, //
new ModbusBitWrappingChannel("BatteryFault8", this, this.thingState)), //
new //
UnsignedWordElement(//
0x13F, //
new ModbusBitWrappingChannel("BatteryFault9", this, this.thingState).faultBit(2, //
FaultEss.SamplingCircuitAbnormalForBMU).faultBit(3, //
FaultEss.PowerCableDisconnectFailure).faultBit(4, //
FaultEss.SamplingCircuitDisconnectFailure).faultBit(6, //
FaultEss.CANDisconnectForMasterAndSlave).faultBit(9, //
FaultEss.SammplingCircuitFailure).faultBit(10, //
FaultEss.SingleBatteryFailure).faultBit(11, //
FaultEss.CircuitDetectionAbnormalForMainContactor).faultBit(12, //
FaultEss.CircuitDetectionAbnormalForMainContactorSecond).faultBit(13, //
FaultEss.CircuitDetectionAbnormalForFancontactor).faultBit(14, //
FaultEss.BMUPowerContactorCircuitDetectionAbnormal).faultBit(15, //
FaultEss.CentralContactorCircuitDetectionAbnormal)), new //
UnsignedWordElement(//
0x140, //
new ModbusBitWrappingChannel("BatteryFault10", this, this.thingState).faultBit(2, //
FaultEss.SeriousTemperatureFault).faultBit(3, //
FaultEss.CommunicationFaultForSystemController).faultBit(7, //
FaultEss.FrogAlarm).faultBit(8, //
FaultEss.FuseFault).faultBit(10, //
FaultEss.NormalLeakage).faultBit(11, //
FaultEss.SeriousLeakage).faultBit(12, //
FaultEss.CANDisconnectionBetweenBatteryGroupAndBatteryStack).faultBit(13, //
FaultEss.CentralContactorCircuitOpen).faultBit(14, //
FaultEss.BMUPowerContactorOpen)), new //
UnsignedWordElement(//
0x141, //
new ModbusBitWrappingChannel("BatteryFault11", this, this.thingState)), new //
UnsignedWordElement(//
0x142, //
new ModbusBitWrappingChannel("BatteryFault12", this, this.thingState)), new UnsignedWordElement(0x143, //
batteryFault13 = new StatusBitChannel("BatteryFault13", this)), new UnsignedWordElement(0x144, //
batteryFault14 = new StatusBitChannel("BatteryFault14", this)), new //
UnsignedWordElement(//
0x145, //
batteryGroupControlStatus = new StatusBitChannel("BatteryGroupControlStatus", this)), new UnsignedWordElement(0x146, //
errorLog1 = new StatusBitChannel("ErrorLog1", this)), new UnsignedWordElement(0x147, //
errorLog2 = new StatusBitChannel("ErrorLog2", this)), new UnsignedWordElement(0x148, //
errorLog3 = new StatusBitChannel("ErrorLog3", this)), new UnsignedWordElement(0x149, //
errorLog4 = new StatusBitChannel("ErrorLog4", this)), new UnsignedWordElement(0x14a, //
errorLog5 = new StatusBitChannel("ErrorLog5", this)), new UnsignedWordElement(0x14b, //
errorLog6 = new StatusBitChannel("ErrorLog6", this)), new UnsignedWordElement(0x14c, //
errorLog7 = new StatusBitChannel("ErrorLog7", this)), new UnsignedWordElement(0x14d, //
errorLog8 = new StatusBitChannel("ErrorLog8", this)), new UnsignedWordElement(0x14e, //
errorLog9 = new StatusBitChannel("ErrorLog9", this)), new UnsignedWordElement(0x14f, //
errorLog10 = new StatusBitChannel("ErrorLog10", this)), new UnsignedWordElement(0x150, //
errorLog11 = new StatusBitChannel("ErrorLog11", this)), new UnsignedWordElement(0x151, //
errorLog12 = new StatusBitChannel("ErrorLog12", this)), new UnsignedWordElement(0x152, //
errorLog13 = new StatusBitChannel("ErrorLog13", this)), new UnsignedWordElement(0x153, //
errorLog14 = new StatusBitChannel("ErrorLog14", this)), new UnsignedWordElement(0x154, //
errorLog15 = new StatusBitChannel("ErrorLog15", this)), new UnsignedWordElement(0x155, //
errorLog16 = new StatusBitChannel("ErrorLog16", this))), new //
WriteableModbusRegisterRange(//
0x200, new //
UnsignedWordElement(//
0x200, setWorkState = //
new ModbusWriteLongChannel("SetWorkState", this).label(0, //
STOP).label(1, START)), new //
UnsignedWordElement(//
0x201, setSystemErrorReset = new ModbusWriteLongChannel("SetSystemErrorReset", //
this).label(0, //
OFF).label(1, ON)), new //
UnsignedWordElement(//
0x202, setOperationMode = //
new ModbusWriteLongChannel("SetOperationMode", this).label(0, //
"P/Q Set point").label(1, "IAC / cosphi set point"))), new WriteableModbusRegisterRange(0x203, new //
SignedWordElement(//
0x203, setActivePower = //
new ModbusWriteLongChannel("SetActivePower", this).unit("W").multiplier(2))), new WriteableModbusRegisterRange(0x204, new //
SignedWordElement(//
0x204, setActivePowerL1 = //
new ModbusWriteLongChannel("SetActivePowerL1", this).unit("W").multiplier(2)), new //
SignedWordElement(//
0x205, setActivePowerL2 = //
new ModbusWriteLongChannel("SetActivePowerL2", this).unit("W").multiplier(2)), new //
SignedWordElement(//
0x206, setActivePowerL3 = //
new ModbusWriteLongChannel("SetActivePowerL3", this).unit("W").multiplier(2))), new WriteableModbusRegisterRange(0x207, new //
SignedWordElement(//
0x207, setReactivePower = //
new ModbusWriteLongChannel("SetReactivePower", this).unit("W").multiplier(2))), new WriteableModbusRegisterRange(0x208, new //
SignedWordElement(//
0x208, setReactivePowerL1 = //
new ModbusWriteLongChannel("SetReactivePowerL1", this).unit("W").multiplier(2)), new //
SignedWordElement(//
0x209, setReactivePowerL2 = //
new ModbusWriteLongChannel("SetReactivePowerL2", this).unit("W").multiplier(2)), new //
SignedWordElement(//
0x20A, setReactivePowerL3 = //
new ModbusWriteLongChannel("SetReactivePowerL3", this).unit("W").multiplier(2))));
this.power = new SymmetricPowerImpl(100000, setActivePower, setReactivePower, getParent().getBridge());
this.allowedChargeLimit = new PGreaterEqualLimitation(power);
this.allowedChargeLimit.setP(this.allowedCharge.valueOptional().orElse(0L));
this.batFullLimit = new NoPBetweenLimitation(power);
this.power.addStaticLimitation(batFullLimit);
this.allowedCharge.addChangeListener(new ChannelChangeListener() {
@Override
public void channelChanged(Channel channel, Optional<?> newValue, Optional<?> oldValue) {
allowedChargeLimit.setP(allowedCharge.valueOptional().orElse(0L));
if (allowedCharge.isValuePresent()) {
if (allowedCharge.getValue() > -100) {
batFullLimit.setP(0L, 5000L);
} else {
batFullLimit.setP(null, null);
}
}
}
});
this.power.addStaticLimitation(this.allowedChargeLimit);
this.allowedDischargeLimit = new PSmallerEqualLimitation(power);
this.allowedDischargeLimit.setP(this.allowedDischarge.valueOptional().orElse(0L));
this.batEmptyLimit = new NoPBetweenLimitation(power);
this.power.addStaticLimitation(batEmptyLimit);
this.allowedDischarge.addChangeListener(new ChannelChangeListener() {
@Override
public void channelChanged(Channel channel, Optional<?> newValue, Optional<?> oldValue) {
allowedDischargeLimit.setP(allowedDischarge.valueOptional().orElse(0L));
if (allowedDischarge.isValuePresent()) {
if (allowedDischarge.getValue() < 100) {
batEmptyLimit.setP(-5000L, 0L);
} else {
batEmptyLimit.setP(null, null);
}
}
}
});
return protocol;
}
use of io.openems.impl.protocol.modbus.internal.SignedWordElement in project openems by OpenEMS.
the class FeneconCommercialEss method defineModbusProtocol.
/*
* Methods
*/
@Override
protected ModbusProtocol defineModbusProtocol() throws ConfigException {
ModbusProtocol protocol = new //
ModbusProtocol(new //
ModbusRegisterRange(//
0x0101, new //
UnsignedWordElement(//
0x0101, systemState = //
new ModbusReadLongChannel("SystemState", this).label(2, //
STOP).label(4, //
"PV-Charge").label(8, //
"Standby").label(16, //
START).label(32, //
FAULT).label(64, //
"Debug")), new //
UnsignedWordElement(//
0x0102, controlMode = //
new ModbusReadLongChannel("ControlMode", this).label(1, //
"Remote").label(2, //
"Local")), // WorkMode: RemoteDispatch
new DummyElement(0x0103), new //
UnsignedWordElement(//
0x0104, batteryMaintenanceState = //
new ModbusReadLongChannel("BatteryMaintenanceState", this).label(0, //
OFF).label(1, //
ON)), new //
UnsignedWordElement(//
0x0105, inverterState = //
new ModbusReadLongChannel("InverterState", this).label(0, //
"Init").label(2, //
"Fault").label(4, //
STOP).label(8, //
STANDBY).label(16, // ,
"Grid-Monitor").label(32, //
"Ready").label(64, //
START).label(128, //
"Debug")), new //
UnsignedWordElement(//
0x0106, gridMode = //
new ModbusReadLongChannel("GridMode", this).label(1, //
OFF_GRID).label(2, //
ON_GRID)), //
new DummyElement(0x0107), new //
UnsignedWordElement(//
0x0108, //
protocolVersion = new ModbusReadLongChannel("ProtocolVersion", this)), new //
UnsignedWordElement(//
0x0109, systemManufacturer = //
new ModbusReadLongChannel("SystemManufacturer", this).label(1, //
"BYD")), new //
UnsignedWordElement(//
0x010A, systemType = //
new ModbusReadLongChannel("SystemType", this).label(1, //
"CESS")), //
new DummyElement(0x010B, 0x010F), new //
UnsignedWordElement(//
0x0110, //
new ModbusBitWrappingChannel("SuggestiveInformation1", this, this.thingState).warningBit(2, // EmergencyStop
WarningEss.EmergencyStop).warningBit(6, // KeyManualStop
WarningEss.KeyManualStop)), new //
UnsignedWordElement(//
0x0111, //
new ModbusBitWrappingChannel("SuggestiveInformation2", this, this.thingState).warningBit(3, // Transformer
WarningEss.TransformerPhaseBTemperatureSensorInvalidation).warningBit(12, // SD memory card
WarningEss.SDMemoryCardInvalidation)), //
new DummyElement(0x0112, 0x0124), new //
UnsignedWordElement(//
0x0125, //
new ModbusBitWrappingChannel("SuggestiveInformation3", this, this.thingState).warningBit(0, //
WarningEss.InverterCommunicationAbnormity).warningBit(1, //
WarningEss.BatteryStackCommunicationAbnormity).warningBit(2, //
WarningEss.MultifunctionalAmmeterCommunicationAbnormity).warningBit(4, //
WarningEss.RemoteCommunicationAbnormity).warningBit(8, //
WarningEss.PVDC1CommunicationAbnormity).warningBit(9, //
WarningEss.PVDC2CommunicationAbnormity)), new //
UnsignedWordElement(//
0x0126, //
new ModbusBitWrappingChannel("SuggestiveInformation4", this, this.thingState).warningBit(3, //
WarningEss.TransformerSevereOvertemperature)), //
new DummyElement(0x0127, 0x014F), new //
UnsignedWordElement(//
0x0150, switchState = //
new StatusBitChannel("BatteryStringSwitchState", this).label(1, //
"Main contactor").label(2, //
"Precharge contactor").label(4, //
"FAN contactor").label(8, //
"BMU power supply relay").label(16, //
"Middle relay"))), //
new //
ModbusRegisterRange(//
0x0180, new //
UnsignedWordElement(//
0x0180, //
new ModbusBitWrappingChannel("Abnormity1", this, this.thingState).faultBit(0, //
FaultEss.DCPrechargeContactorCloseUnsuccessfully).faultBit(1, //
FaultEss.ACPrechargeContactorCloseUnsuccessfully).faultBit(2, //
FaultEss.ACMainContactorCloseUnsuccessfully).faultBit(3, //
FaultEss.DCElectricalBreaker1CloseUnsuccessfully).faultBit(4, //
FaultEss.DCMainContactorCloseUnsuccessfully).faultBit(5, //
FaultEss.ACBreakerTrip).faultBit(6, //
FaultEss.ACMainContactorOpenWhenRunning).faultBit(7, //
FaultEss.DCMainContactorOpenWhenRunning).faultBit(8, //
FaultEss.ACMainContactorOpenUnsuccessfully).faultBit(9, //
FaultEss.DCElectricalBreaker1OpenUnsuccessfully).faultBit(10, //
FaultEss.DCMainContactorOpenUnsuccessfully).faultBit(11, //
FaultEss.HardwarePDPFault).faultBit(12, //
FaultEss.MasterStopSuddenly)), new DummyElement(0x0181), new //
UnsignedWordElement(//
0x0182, //
new ModbusBitWrappingChannel("Abnormity2", this, this.thingState).faultBit(0, //
FaultEss.DCShortCircuitProtection).faultBit(1, //
FaultEss.DCOvervoltageProtection).faultBit(2, //
FaultEss.DCUndervoltageProtection).faultBit(3, //
FaultEss.DCInverseNoConnectionProtection).faultBit(4, //
FaultEss.DCDisconnectionProtection).faultBit(5, //
FaultEss.CommutingVoltageAbnormityProtection).faultBit(6, //
FaultEss.DCOvercurrentProtection).faultBit(7, //
FaultEss.Phase1PeakCurrentOverLimitProtection).faultBit(8, //
FaultEss.Phase2PeakCurrentOverLimitProtection).faultBit(9, //
FaultEss.Phase3PeakCurrentOverLimitProtection).faultBit(10, //
FaultEss.Phase1GridVoltageSamplingInvalidation).faultBit(11, //
FaultEss.Phase2VirtualCurrentOverLimitProtection).faultBit(12, //
FaultEss.Phase3VirtualCurrentOverLimitProtection).faultBit(13, //
FaultEss.Phase1GridVoltageSamplingInvalidation2).faultBit(14, //
FaultEss.Phase2ridVoltageSamplingInvalidation).faultBit(15, //
FaultEss.Phase3GridVoltageSamplingInvalidation)), new //
UnsignedWordElement(//
0x0183, //
new ModbusBitWrappingChannel("Abnormity3", this, this.thingState).faultBit(0, //
FaultEss.Phase1InvertVoltageSamplingInvalidation).faultBit(1, //
FaultEss.Phase2InvertVoltageSamplingInvalidation).faultBit(2, //
FaultEss.Phase3InvertVoltageSamplingInvalidation).faultBit(3, //
FaultEss.ACCurrentSamplingInvalidation).faultBit(4, //
FaultEss.DCCurrentSamplingInvalidation).faultBit(5, //
FaultEss.Phase1OvertemperatureProtection).faultBit(6, //
FaultEss.Phase2OvertemperatureProtection).faultBit(7, //
FaultEss.Phase3OvertemperatureProtection).faultBit(8, //
FaultEss.Phase1TemperatureSamplingInvalidation).faultBit(9, //
FaultEss.Phase2TemperatureSamplingInvalidation).faultBit(10, //
FaultEss.Phase3TemperatureSamplingInvalidation).faultBit(11, //
FaultEss.Phase1PrechargeUnmetProtection).faultBit(12, //
FaultEss.Phase2PrechargeUnmetProtection).faultBit(13, //
FaultEss.Phase3PrechargeUnmetProtection).faultBit(14, //
FaultEss.UnadaptablePhaseSequenceErrorProtection).faultBit(15, //
FaultEss.DSPProtection)), new //
UnsignedWordElement(//
0x0184, //
new ModbusBitWrappingChannel("Abnormity4", this, this.thingState).faultBit(0, //
FaultEss.Phase1GridVoltageSevereOvervoltageProtection).faultBit(1, //
FaultEss.Phase1GridVoltageGeneralOvervoltageProtection).faultBit(2, //
FaultEss.Phase2GridVoltageSevereOvervoltageProtection).faultBit(3, //
FaultEss.Phase2GridVoltageGeneralOvervoltageProtection).faultBit(4, //
FaultEss.Phase3GridVoltageSevereOvervoltageProtection).faultBit(5, //
FaultEss.Phase3GridVoltageGeneralOvervoltageProtection).faultBit(6, //
FaultEss.Phase1GridVoltageSevereUndervoltageProtection).faultBit(7, //
FaultEss.Phase1GridVoltageGeneralUndervoltageProtection).faultBit(8, //
FaultEss.Phase2GridVoltageSevereUndervoltageProtection).faultBit(9, //
FaultEss.Phase2GridVoltageGeneralUndervoltageProtection).faultBit(10, //
FaultEss.Phase3GridVoltageSevereUndervoltageProtection).faultBit(11, //
FaultEss.Phase3GridVoltageGeneralUndervoltageProtection).faultBit(12, //
FaultEss.SevereOverfrequncyProtection).faultBit(13, //
FaultEss.GeneralOverfrequncyProtection).faultBit(14, //
FaultEss.SevereUnderfrequncyProtection).faultBit(15, //
FaultEss.GeneralsUnderfrequncyProtection)), new //
UnsignedWordElement(//
0x0185, //
new ModbusBitWrappingChannel("Abnormity5", this, this.thingState).faultBit(0, //
FaultEss.Phase1Gridloss).faultBit(1, //
FaultEss.Phase2Gridloss).faultBit(2, //
FaultEss.Phase3Gridloss).faultBit(3, //
FaultEss.IslandingProtection).faultBit(4, //
FaultEss.Phase1UnderVoltageRideThrough).faultBit(5, //
FaultEss.Phase2UnderVoltageRideThrough).faultBit(6, //
FaultEss.Phase3UnderVoltageRideThrough).faultBit(7, //
FaultEss.Phase1InverterVoltageSevereOvervoltageProtection).faultBit(8, //
FaultEss.Phase1InverterVoltageGeneralOvervoltageProtection).faultBit(9, //
FaultEss.Phase2InverterVoltageSevereOvervoltageProtection).faultBit(10, //
FaultEss.Phase2InverterVoltageGeneralOvervoltageProtection).faultBit(11, //
FaultEss.Phase3InverterVoltageSevereOvervoltageProtection).faultBit(12, //
FaultEss.Phase3InverterVoltageGeneralOvervoltageProtection).faultBit(13, //
FaultEss.InverterPeakVoltageHighProtectionCauseByACDisconnect)), new //
UnsignedWordElement(//
0x0186, //
new ModbusBitWrappingChannel("SuggestiveInformation5", this, this.thingState).warningBit(0, //
WarningEss.DCPrechargeContactorInspectionAbnormity).warningBit(1, //
WarningEss.DCBreaker1InspectionAbnormity).warningBit(2, //
WarningEss.DCBreaker2InspectionAbnormity).warningBit(3, //
WarningEss.ACPrechargeContactorInspectionAbnormity).warningBit(4, //
WarningEss.ACMainontactorInspectionAbnormity).warningBit(5, //
WarningEss.ACBreakerInspectionAbnormity).warningBit(6, //
WarningEss.DCBreaker1CloseUnsuccessfully).warningBit(7, //
WarningEss.DCBreaker2CloseUnsuccessfully).warningBit(8, //
WarningEss.ControlSignalCloseAbnormallyInspectedBySystem).warningBit(9, //
WarningEss.ControlSignalOpenAbnormallyInspectedBySystem).warningBit(10, //
WarningEss.NeutralWireContactorCloseUnsuccessfully).warningBit(11, //
WarningEss.NeutralWireContactorOpenUnsuccessfully).warningBit(12, //
WarningEss.WorkDoorOpen).warningBit(13, //
WarningEss.Emergency1Stop).warningBit(14, //
WarningEss.ACBreakerCloseUnsuccessfully).warningBit(15, //
WarningEss.ControlSwitchStop)), new //
UnsignedWordElement(//
0x0187, //
new ModbusBitWrappingChannel("SuggestiveInformation6", this, this.thingState).warningBit(0, //
WarningEss.GeneralOverload).warningBit(1, //
WarningEss.SevereOverload).warningBit(2, //
WarningEss.BatteryCurrentOverLimit).warningBit(3, //
WarningEss.PowerDecreaseCausedByOvertemperature).warningBit(4, //
WarningEss.InverterGeneralOvertemperature).warningBit(5, //
WarningEss.ACThreePhaseCurrentUnbalance).warningBit(6, //
WarningEss.RestoreFactorySettingUnsuccessfully).warningBit(7, //
WarningEss.PoleBoardInvalidation).warningBit(8, //
WarningEss.SelfInspectionFailed).warningBit(9, //
WarningEss.ReceiveBMSFaultAndStop).warningBit(10, //
WarningEss.RefrigerationEquipmentinvalidation).warningBit(11, //
WarningEss.LargeTemperatureDifferenceAmongIGBTThreePhases).warningBit(12, //
WarningEss.EEPROMParametersOverRange).warningBit(13, //
WarningEss.EEPROMParametersBackupFailed).warningBit(14, //
WarningEss.DCBreakerCloseunsuccessfully)), //
new //
UnsignedWordElement(//
0x0188, //
new ModbusBitWrappingChannel("SuggestiveInformation7", this, this.thingState).warningBit(0, //
WarningEss.CommunicationBetweenInverterAndBSMUDisconnected).warningBit(1, //
WarningEss.CommunicationBetweenInverterAndMasterDisconnected).warningBit(2, //
WarningEss.CommunicationBetweenInverterAndUCDisconnected).warningBit(3, //
WarningEss.BMSStartOvertimeControlledByPCS).warningBit(4, //
WarningEss.BMSStopOvertimeControlledByPCS).warningBit(5, //
WarningEss.SyncSignalInvalidation).warningBit(6, //
WarningEss.SyncSignalContinuousCaputureFault).warningBit(7, WarningEss.SyncSignalSeveralTimesCaputureFault))), new //
ModbusRegisterRange(//
0x0200, new //
SignedWordElement(//
0x0200, batteryVoltage = new ModbusReadLongChannel("BatteryVoltage", this).unit("mV").multiplier(2)), new //
SignedWordElement(//
0x0201, batteryCurrent = new ModbusReadLongChannel("BatteryCurrent", this).unit("mA").multiplier(2)), new //
SignedWordElement(//
0x0202, batteryPower = new ModbusReadLongChannel("BatteryPower", this).unit("W").multiplier(2)), //
new DummyElement(0x0203, 0x0207), new //
UnsignedDoublewordElement(//
0x0208, acChargeEnergy = new ModbusReadLongChannel("AcChargeEnergy", this).unit("Wh").multiplier(2)).wordOrder(WordOrder.LSWMSW), new //
UnsignedDoublewordElement(//
0x020A, acDischargeEnergy = new ModbusReadLongChannel("AcDischargeEnergy", this).unit("Wh").multiplier(2)).wordOrder(WordOrder.LSWMSW), new DummyElement(0x020C, 0x020F), new //
SignedWordElement(//
0x0210, gridActivePower = new ModbusReadLongChannel("GridActivePower", this).unit("W").multiplier(2)), new //
SignedWordElement(//
0x0211, reactivePower = new ModbusReadLongChannel("ReactivePower", this).unit("var").multiplier(2)), new //
UnsignedWordElement(//
0x0212, apparentPower = new ModbusReadLongChannel("ApparentPower", this).unit("VA").multiplier(2)), new //
SignedWordElement(//
0x0213, currentL1 = new ModbusReadLongChannel("CurrentL1", this).unit("mA").multiplier(2)), new //
SignedWordElement(//
0x0214, currentL2 = new ModbusReadLongChannel("CurrentL2", this).unit("mA").multiplier(2)), new //
SignedWordElement(//
0x0215, currentL3 = new ModbusReadLongChannel("CurrentL3", this).unit("mA").multiplier(2)), //
new DummyElement(0x0216, 0x218), new //
UnsignedWordElement(//
0x0219, voltageL1 = new ModbusReadLongChannel("VoltageL1", this).unit("mV").multiplier(2)), new //
UnsignedWordElement(//
0x021A, voltageL2 = new ModbusReadLongChannel("VoltageL2", this).unit("mV").multiplier(2)), new //
UnsignedWordElement(//
0x021B, voltageL3 = new ModbusReadLongChannel("VoltageL3", this).unit("mV").multiplier(2)), new //
UnsignedWordElement(//
0x021C, frequency = new ModbusReadLongChannel("Frequency", this).unit("mHZ").multiplier(1))), new //
ModbusRegisterRange(//
0x0222, new //
UnsignedWordElement(//
0x0222, inverterVoltageL1 = new ModbusReadLongChannel("InverterVoltageL1", this).unit("mV").multiplier(//
2)), new //
UnsignedWordElement(//
0x0223, inverterVoltageL2 = new ModbusReadLongChannel("InverterVoltageL2", this).unit("mV").multiplier(//
2)), new //
UnsignedWordElement(//
0x0224, inverterVoltageL3 = new ModbusReadLongChannel("InverterVoltageL3", this).unit("mV").multiplier(//
2)), new //
UnsignedWordElement(//
0x0225, inverterCurrentL1 = new ModbusReadLongChannel("InverterCurrentL1", this).unit("mA").multiplier(//
2)), new //
UnsignedWordElement(//
0x0226, inverterCurrentL2 = new ModbusReadLongChannel("InverterCurrentL2", this).unit("mA").multiplier(//
2)), new //
UnsignedWordElement(//
0x0227, inverterCurrentL3 = new ModbusReadLongChannel("InverterCurrentL3", this).unit("mA").multiplier(//
2)), new //
SignedWordElement(//
0x0228, //
activePower = new ModbusReadLongChannel("ActivePower", this).unit("W").multiplier(2)), new DummyElement(0x0229, 0x022F), new //
SignedWordElement(//
0x0230, allowedCharge = new ModbusReadLongChannel("AllowedCharge", this).unit("W").multiplier(//
2)), new //
UnsignedWordElement(//
0x0231, allowedDischarge = new ModbusReadLongChannel("AllowedDischarge", this).unit("W").multiplier(//
2)), new //
UnsignedWordElement(//
0x0232, allowedApparent = new ModbusReadLongChannel("AllowedApparent", this).unit("VA").multiplier(//
2)), new DummyElement(0x0233, 0x23F), new //
SignedWordElement(//
0x0240, //
ipmTemperatureL1 = new ModbusReadLongChannel("IpmTemperatureL1", this).unit("�C")), new //
SignedWordElement(//
0x0241, //
ipmTemperatureL2 = new ModbusReadLongChannel("IpmTemperatureL2", this).unit("�C")), new //
SignedWordElement(//
0x0242, //
ipmTemperatureL3 = new ModbusReadLongChannel("IpmTemperatureL3", this).unit("�C")), new DummyElement(0x0243, 0x0248), new //
SignedWordElement(//
0x0249, transformerTemperatureL2 = new ModbusReadLongChannel("TransformerTemperatureL2", this).unit("�C"))), new //
WriteableModbusRegisterRange(//
0x0500, new //
UnsignedWordElement(//
0x0500, setWorkState = //
new ModbusWriteLongChannel("SetWorkState", this).label(4, //
STOP).label(32, //
STANDBY).label(64, START))), new //
WriteableModbusRegisterRange(//
0x0501, new //
SignedWordElement(//
0x0501, setActivePower = new ModbusWriteLongChannel("SetActivePower", this).unit("W").multiplier(2).minWriteChannel(allowedCharge).maxWriteChannel(allowedDischarge)), new //
SignedWordElement(//
0x0502, setReactivePower = new ModbusWriteLongChannel("SetReactivePower", this).unit("var").multiplier(2).minWriteChannel(allowedCharge).maxWriteChannel(allowedDischarge))), new //
ModbusRegisterRange(//
0x1402, new UnsignedWordElement(0x1402, soc = new ModbusReadLongChannel("Soc", this).unit("%").interval(0, 100)), new UnsignedWordElement(0x1403, soh = new ModbusReadLongChannel("Soh", this).unit("%").interval(0, 100)), new UnsignedWordElement(0x1404, batteryCellAverageTemperature = new ModbusReadLongChannel("BatteryCellAverageTemperature", this).unit("°C"))), new //
ModbusRegisterRange(//
0x1500, new UnsignedWordElement(0x1500, batteryCell1Voltage = new ModbusReadLongChannel("Cell1Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1501, batteryCell2Voltage = new ModbusReadLongChannel("Cell2Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1502, batteryCell3Voltage = new ModbusReadLongChannel("Cell3Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1503, batteryCell4Voltage = new ModbusReadLongChannel("Cell4Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1504, batteryCell5Voltage = new ModbusReadLongChannel("Cell5Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1505, batteryCell6Voltage = new ModbusReadLongChannel("Cell6Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1506, batteryCell7Voltage = new ModbusReadLongChannel("Cell7Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1507, batteryCell8Voltage = new ModbusReadLongChannel("Cell8Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1508, batteryCell9Voltage = new ModbusReadLongChannel("Cell9Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1509, batteryCell10Voltage = new ModbusReadLongChannel("Cell10Voltage", this).unit("mV")), //
new UnsignedWordElement(0x150A, batteryCell11Voltage = new ModbusReadLongChannel("Cell11Voltage", this).unit("mV")), //
new UnsignedWordElement(0x150B, batteryCell12Voltage = new ModbusReadLongChannel("Cell12Voltage", this).unit("mV")), //
new UnsignedWordElement(0x150C, batteryCell13Voltage = new ModbusReadLongChannel("Cell13Voltage", this).unit("mV")), //
new UnsignedWordElement(0x150D, batteryCell14Voltage = new ModbusReadLongChannel("Cell14Voltage", this).unit("mV")), //
new UnsignedWordElement(0x150E, batteryCell15Voltage = new ModbusReadLongChannel("Cell15Voltage", this).unit("mV")), //
new UnsignedWordElement(0x150F, batteryCell16Voltage = new ModbusReadLongChannel("Cell16Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1510, batteryCell17Voltage = new ModbusReadLongChannel("Cell17Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1511, batteryCell18Voltage = new ModbusReadLongChannel("Cell18Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1512, batteryCell19Voltage = new ModbusReadLongChannel("Cell19Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1513, batteryCell20Voltage = new ModbusReadLongChannel("Cell20Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1514, batteryCell21Voltage = new ModbusReadLongChannel("Cell21Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1515, batteryCell22Voltage = new ModbusReadLongChannel("Cell22Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1516, batteryCell23Voltage = new ModbusReadLongChannel("Cell23Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1517, batteryCell24Voltage = new ModbusReadLongChannel("Cell24Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1518, batteryCell25Voltage = new ModbusReadLongChannel("Cell25Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1519, batteryCell26Voltage = new ModbusReadLongChannel("Cell26Voltage", this).unit("mV")), //
new UnsignedWordElement(0x151A, batteryCell27Voltage = new ModbusReadLongChannel("Cell27Voltage", this).unit("mV")), //
new UnsignedWordElement(0x151B, batteryCell28Voltage = new ModbusReadLongChannel("Cell28Voltage", this).unit("mV")), //
new UnsignedWordElement(0x151C, batteryCell29Voltage = new ModbusReadLongChannel("Cell29Voltage", this).unit("mV")), //
new UnsignedWordElement(0x151D, batteryCell30Voltage = new ModbusReadLongChannel("Cell30Voltage", this).unit("mV")), //
new UnsignedWordElement(0x151E, batteryCell31Voltage = new ModbusReadLongChannel("Cell31Voltage", this).unit("mV")), //
new UnsignedWordElement(0x151F, batteryCell32Voltage = new ModbusReadLongChannel("Cell32Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1520, batteryCell33Voltage = new ModbusReadLongChannel("Cell33Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1521, batteryCell34Voltage = new ModbusReadLongChannel("Cell34Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1522, batteryCell35Voltage = new ModbusReadLongChannel("Cell35Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1523, batteryCell36Voltage = new ModbusReadLongChannel("Cell36Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1524, batteryCell37Voltage = new ModbusReadLongChannel("Cell37Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1525, batteryCell38Voltage = new ModbusReadLongChannel("Cell38Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1526, batteryCell39Voltage = new ModbusReadLongChannel("Cell39Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1527, batteryCell40Voltage = new ModbusReadLongChannel("Cell40Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1528, batteryCell41Voltage = new ModbusReadLongChannel("Cell41Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1529, batteryCell42Voltage = new ModbusReadLongChannel("Cell42Voltage", this).unit("mV")), //
new UnsignedWordElement(0x152A, batteryCell43Voltage = new ModbusReadLongChannel("Cell43Voltage", this).unit("mV")), //
new UnsignedWordElement(0x152B, batteryCell44Voltage = new ModbusReadLongChannel("Cell44Voltage", this).unit("mV")), //
new UnsignedWordElement(0x152C, batteryCell45Voltage = new ModbusReadLongChannel("Cell45Voltage", this).unit("mV")), //
new UnsignedWordElement(0x152D, batteryCell46Voltage = new ModbusReadLongChannel("Cell46Voltage", this).unit("mV")), //
new UnsignedWordElement(0x152E, batteryCell47Voltage = new ModbusReadLongChannel("Cell47Voltage", this).unit("mV")), //
new UnsignedWordElement(0x152F, batteryCell48Voltage = new ModbusReadLongChannel("Cell48Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1530, batteryCell49Voltage = new ModbusReadLongChannel("Cell49Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1531, batteryCell50Voltage = new ModbusReadLongChannel("Cell50Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1532, batteryCell51Voltage = new ModbusReadLongChannel("Cell51Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1533, batteryCell52Voltage = new ModbusReadLongChannel("Cell52Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1534, batteryCell53Voltage = new ModbusReadLongChannel("Cell53Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1535, batteryCell54Voltage = new ModbusReadLongChannel("Cell54Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1536, batteryCell55Voltage = new ModbusReadLongChannel("Cell55Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1537, batteryCell56Voltage = new ModbusReadLongChannel("Cell56Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1538, batteryCell57Voltage = new ModbusReadLongChannel("Cell57Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1539, batteryCell58Voltage = new ModbusReadLongChannel("Cell58Voltage", this).unit("mV")), //
new UnsignedWordElement(0x153A, batteryCell59Voltage = new ModbusReadLongChannel("Cell59Voltage", this).unit("mV")), //
new UnsignedWordElement(0x153B, batteryCell60Voltage = new ModbusReadLongChannel("Cell60Voltage", this).unit("mV")), //
new UnsignedWordElement(0x153C, batteryCell61Voltage = new ModbusReadLongChannel("Cell61Voltage", this).unit("mV")), //
new UnsignedWordElement(0x153D, batteryCell62Voltage = new ModbusReadLongChannel("Cell62Voltage", this).unit("mV")), //
new UnsignedWordElement(0x153E, batteryCell63Voltage = new ModbusReadLongChannel("Cell63Voltage", this).unit("mV")), //
new UnsignedWordElement(0x153F, batteryCell64Voltage = new ModbusReadLongChannel("Cell64Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1540, batteryCell65Voltage = new ModbusReadLongChannel("Cell65Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1541, batteryCell66Voltage = new ModbusReadLongChannel("Cell66Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1542, batteryCell67Voltage = new ModbusReadLongChannel("Cell67Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1543, batteryCell68Voltage = new ModbusReadLongChannel("Cell68Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1544, batteryCell69Voltage = new ModbusReadLongChannel("Cell69Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1545, batteryCell70Voltage = new ModbusReadLongChannel("Cell70Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1546, batteryCell71Voltage = new ModbusReadLongChannel("Cell71Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1547, batteryCell72Voltage = new ModbusReadLongChannel("Cell72Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1548, batteryCell73Voltage = new ModbusReadLongChannel("Cell73Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1549, batteryCell74Voltage = new ModbusReadLongChannel("Cell74Voltage", this).unit("mV")), //
new UnsignedWordElement(0x154A, batteryCell75Voltage = new ModbusReadLongChannel("Cell75Voltage", this).unit("mV")), //
new UnsignedWordElement(0x154B, batteryCell76Voltage = new ModbusReadLongChannel("Cell76Voltage", this).unit("mV")), //
new UnsignedWordElement(0x154C, batteryCell77Voltage = new ModbusReadLongChannel("Cell77Voltage", this).unit("mV")), //
new UnsignedWordElement(0x154D, batteryCell78Voltage = new ModbusReadLongChannel("Cell78Voltage", this).unit("mV")), //
new UnsignedWordElement(0x154E, batteryCell79Voltage = new ModbusReadLongChannel("Cell79Voltage", this).unit("mV")), //
new UnsignedWordElement(0x154F, batteryCell80Voltage = new ModbusReadLongChannel("Cell80Voltage", this).unit("mV"))), new //
ModbusRegisterRange(//
0x1550, new UnsignedWordElement(0x1550, batteryCell81Voltage = new ModbusReadLongChannel("Cell81Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1551, batteryCell82Voltage = new ModbusReadLongChannel("Cell82Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1552, batteryCell83Voltage = new ModbusReadLongChannel("Cell83Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1553, batteryCell84Voltage = new ModbusReadLongChannel("Cell84Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1554, batteryCell85Voltage = new ModbusReadLongChannel("Cell85Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1555, batteryCell86Voltage = new ModbusReadLongChannel("Cell86Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1556, batteryCell87Voltage = new ModbusReadLongChannel("Cell87Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1557, batteryCell88Voltage = new ModbusReadLongChannel("Cell88Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1558, batteryCell89Voltage = new ModbusReadLongChannel("Cell89Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1559, batteryCell90Voltage = new ModbusReadLongChannel("Cell90Voltage", this).unit("mV")), //
new UnsignedWordElement(0x155A, batteryCell91Voltage = new ModbusReadLongChannel("Cell91Voltage", this).unit("mV")), //
new UnsignedWordElement(0x155B, batteryCell92Voltage = new ModbusReadLongChannel("Cell92Voltage", this).unit("mV")), //
new UnsignedWordElement(0x155C, batteryCell93Voltage = new ModbusReadLongChannel("Cell93Voltage", this).unit("mV")), //
new UnsignedWordElement(0x155D, batteryCell94Voltage = new ModbusReadLongChannel("Cell94Voltage", this).unit("mV")), //
new UnsignedWordElement(0x155E, batteryCell95Voltage = new ModbusReadLongChannel("Cell95Voltage", this).unit("mV")), //
new UnsignedWordElement(0x155F, batteryCell96Voltage = new ModbusReadLongChannel("Cell96Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1560, batteryCell97Voltage = new ModbusReadLongChannel("Cell97Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1561, batteryCell98Voltage = new ModbusReadLongChannel("Cell98Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1562, batteryCell99Voltage = new ModbusReadLongChannel("Cell99Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1563, batteryCell100Voltage = new ModbusReadLongChannel("Cell100Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1564, batteryCell101Voltage = new ModbusReadLongChannel("Cell101Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1565, batteryCell102Voltage = new ModbusReadLongChannel("Cell102Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1566, batteryCell103Voltage = new ModbusReadLongChannel("Cell103Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1567, batteryCell104Voltage = new ModbusReadLongChannel("Cell104Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1568, batteryCell105Voltage = new ModbusReadLongChannel("Cell105Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1569, batteryCell106Voltage = new ModbusReadLongChannel("Cell106Voltage", this).unit("mV")), //
new UnsignedWordElement(0x156A, batteryCell107Voltage = new ModbusReadLongChannel("Cell107Voltage", this).unit("mV")), //
new UnsignedWordElement(0x156B, batteryCell108Voltage = new ModbusReadLongChannel("Cell108Voltage", this).unit("mV")), //
new UnsignedWordElement(0x156C, batteryCell109Voltage = new ModbusReadLongChannel("Cell109Voltage", this).unit("mV")), //
new UnsignedWordElement(0x156D, batteryCell110Voltage = new ModbusReadLongChannel("Cell110Voltage", this).unit("mV")), //
new UnsignedWordElement(0x156E, batteryCell111Voltage = new ModbusReadLongChannel("Cell111Voltage", this).unit("mV")), //
new UnsignedWordElement(0x156F, batteryCell112Voltage = new ModbusReadLongChannel("Cell112Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1570, batteryCell113Voltage = new ModbusReadLongChannel("Cell113Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1571, batteryCell114Voltage = new ModbusReadLongChannel("Cell114Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1572, batteryCell115Voltage = new ModbusReadLongChannel("Cell115Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1573, batteryCell116Voltage = new ModbusReadLongChannel("Cell116Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1574, batteryCell117Voltage = new ModbusReadLongChannel("Cell117Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1575, batteryCell118Voltage = new ModbusReadLongChannel("Cell18Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1576, batteryCell119Voltage = new ModbusReadLongChannel("Cell119Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1577, batteryCell120Voltage = new ModbusReadLongChannel("Cell120Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1578, batteryCell121Voltage = new ModbusReadLongChannel("Cell121Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1579, batteryCell122Voltage = new ModbusReadLongChannel("Cell122Voltage", this).unit("mV")), //
new UnsignedWordElement(0x157A, batteryCell123Voltage = new ModbusReadLongChannel("Cell123Voltage", this).unit("mV")), //
new UnsignedWordElement(0x157B, batteryCell124Voltage = new ModbusReadLongChannel("Cell124Voltage", this).unit("mV")), //
new UnsignedWordElement(0x157C, batteryCell125Voltage = new ModbusReadLongChannel("Cell125Voltage", this).unit("mV")), //
new UnsignedWordElement(0x157D, batteryCell126Voltage = new ModbusReadLongChannel("Cell126Voltage", this).unit("mV")), //
new UnsignedWordElement(0x157E, batteryCell127Voltage = new ModbusReadLongChannel("Cell127Voltage", this).unit("mV")), //
new UnsignedWordElement(0x157F, batteryCell128Voltage = new ModbusReadLongChannel("Cell128Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1580, batteryCell129Voltage = new ModbusReadLongChannel("Cell129Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1581, batteryCell130Voltage = new ModbusReadLongChannel("Cell130Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1582, batteryCell131Voltage = new ModbusReadLongChannel("Cell131Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1583, batteryCell132Voltage = new ModbusReadLongChannel("Cell132Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1584, batteryCell133Voltage = new ModbusReadLongChannel("Cell133Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1585, batteryCell134Voltage = new ModbusReadLongChannel("Cell134Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1586, batteryCell135Voltage = new ModbusReadLongChannel("Cell135Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1587, batteryCell136Voltage = new ModbusReadLongChannel("Cell136Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1588, batteryCell137Voltage = new ModbusReadLongChannel("Cell137Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1589, batteryCell138Voltage = new ModbusReadLongChannel("Cell138Voltage", this).unit("mV")), //
new UnsignedWordElement(0x158A, batteryCell139Voltage = new ModbusReadLongChannel("Cell139Voltage", this).unit("mV")), //
new UnsignedWordElement(0x158B, batteryCell140Voltage = new ModbusReadLongChannel("Cell140Voltage", this).unit("mV")), //
new UnsignedWordElement(0x158C, batteryCell141Voltage = new ModbusReadLongChannel("Cell141Voltage", this).unit("mV")), //
new UnsignedWordElement(0x158D, batteryCell142Voltage = new ModbusReadLongChannel("Cell142Voltage", this).unit("mV")), //
new UnsignedWordElement(0x158E, batteryCell143Voltage = new ModbusReadLongChannel("Cell143Voltage", this).unit("mV")), //
new UnsignedWordElement(0x158F, batteryCell144Voltage = new ModbusReadLongChannel("Cell144Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1590, batteryCell145Voltage = new ModbusReadLongChannel("Cell145Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1591, batteryCell146Voltage = new ModbusReadLongChannel("Cell146Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1592, batteryCell147Voltage = new ModbusReadLongChannel("Cell147Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1593, batteryCell148Voltage = new ModbusReadLongChannel("Cell148Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1594, batteryCell149Voltage = new ModbusReadLongChannel("Cell149Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1595, batteryCell150Voltage = new ModbusReadLongChannel("Cell150Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1596, batteryCell151Voltage = new ModbusReadLongChannel("Cell151Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1597, batteryCell152Voltage = new ModbusReadLongChannel("Cell152Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1598, batteryCell153Voltage = new ModbusReadLongChannel("Cell153Voltage", this).unit("mV")), //
new UnsignedWordElement(0x1599, batteryCell154Voltage = new ModbusReadLongChannel("Cell154Voltage", this).unit("mV")), //
new UnsignedWordElement(0x159A, batteryCell155Voltage = new ModbusReadLongChannel("Cell155Voltage", this).unit("mV")), //
new UnsignedWordElement(0x159B, batteryCell156Voltage = new ModbusReadLongChannel("Cell156Voltage", this).unit("mV")), //
new UnsignedWordElement(0x159C, batteryCell157Voltage = new ModbusReadLongChannel("Cell157Voltage", this).unit("mV")), //
new UnsignedWordElement(0x159D, batteryCell158Voltage = new ModbusReadLongChannel("Cell158Voltage", this).unit("mV")), //
new UnsignedWordElement(0x159E, batteryCell159Voltage = new ModbusReadLongChannel("Cell159Voltage", this).unit("mV")), //
new UnsignedWordElement(0x159F, batteryCell160Voltage = new ModbusReadLongChannel("Cell160Voltage", this).unit("mV"))), //
new //
ModbusRegisterRange(//
0x15A0, new UnsignedWordElement(0x15A0, batteryCell161Voltage = new ModbusReadLongChannel("Cell161Voltage", this).unit("mV")), //
new UnsignedWordElement(0x15A1, batteryCell162Voltage = new ModbusReadLongChannel("Cell162Voltage", this).unit("mV")), //
new UnsignedWordElement(0x15A2, batteryCell163Voltage = new ModbusReadLongChannel("Cell163Voltage", this).unit("mV")), //
new UnsignedWordElement(0x15A3, batteryCell164Voltage = new ModbusReadLongChannel("Cell164Voltage", this).unit("mV")), //
new UnsignedWordElement(0x15A4, batteryCell165Voltage = new ModbusReadLongChannel("Cell165Voltage", this).unit("mV")), //
new UnsignedWordElement(0x15A5, batteryCell166Voltage = new ModbusReadLongChannel("Cell166Voltage", this).unit("mV")), //
new UnsignedWordElement(0x15A6, batteryCell167Voltage = new ModbusReadLongChannel("Cell167Voltage", this).unit("mV")), //
new UnsignedWordElement(0x15A7, batteryCell168Voltage = new ModbusReadLongChannel("Cell168Voltage", this).unit("mV")), //
new UnsignedWordElement(0x15A8, batteryCell169Voltage = new ModbusReadLongChannel("Cell169Voltage", this).unit("mV")), //
new UnsignedWordElement(0x15A9, batteryCell170Voltage = new ModbusReadLongChannel("Cell170Voltage", this).unit("mV")), //
new UnsignedWordElement(0x15AA, batteryCell171Voltage = new ModbusReadLongChannel("Cell171Voltage", this).unit("mV")), //
new UnsignedWordElement(0x15AB, batteryCell172Voltage = new ModbusReadLongChannel("Cell172Voltage", this).unit("mV")), //
new UnsignedWordElement(0x15AC, batteryCell173Voltage = new ModbusReadLongChannel("Cell173Voltage", this).unit("mV")), //
new UnsignedWordElement(0x15AD, batteryCell174Voltage = new ModbusReadLongChannel("Cell174Voltage", this).unit("mV")), //
new UnsignedWordElement(0x15AE, batteryCell175Voltage = new ModbusReadLongChannel("Cell175Voltage", this).unit("mV")), //
new UnsignedWordElement(0x15AF, batteryCell176Voltage = new ModbusReadLongChannel("Cell176Voltage", this).unit("mV")), //
new UnsignedWordElement(0x15B0, batteryCell177Voltage = new ModbusReadLongChannel("Cell177Voltage", this).unit("mV")), //
new UnsignedWordElement(0x15B1, batteryCell178Voltage = new ModbusReadLongChannel("Cell178Voltage", this).unit("mV")), //
new UnsignedWordElement(0x15B2, batteryCell179Voltage = new ModbusReadLongChannel("Cell179Voltage", this).unit("mV")), //
new UnsignedWordElement(0x15B3, batteryCell180Voltage = new ModbusReadLongChannel("Cell180Voltage", this).unit("mV")), //
new UnsignedWordElement(0x15B4, batteryCell181Voltage = new ModbusReadLongChannel("Cell181Voltage", this).unit("mV")), //
new UnsignedWordElement(0x15B5, batteryCell182Voltage = new ModbusReadLongChannel("Cell182Voltage", this).unit("mV")), //
new UnsignedWordElement(0x15B6, batteryCell183Voltage = new ModbusReadLongChannel("Cell183Voltage", this).unit("mV")), //
new UnsignedWordElement(0x15B7, batteryCell184Voltage = new ModbusReadLongChannel("Cell184Voltage", this).unit("mV")), //
new UnsignedWordElement(0x15B8, batteryCell185Voltage = new ModbusReadLongChannel("Cell185Voltage", this).unit("mV")), //
new UnsignedWordElement(0x15B9, batteryCell186Voltage = new ModbusReadLongChannel("Cell186Voltage", this).unit("mV")), //
new UnsignedWordElement(0x15BA, batteryCell187Voltage = new ModbusReadLongChannel("Cell187Voltage", this).unit("mV")), //
new UnsignedWordElement(0x15BB, batteryCell188Voltage = new ModbusReadLongChannel("Cell188Voltage", this).unit("mV")), //
new UnsignedWordElement(0x15BC, batteryCell189Voltage = new ModbusReadLongChannel("Cell189Voltage", this).unit("mV")), //
new UnsignedWordElement(0x15BD, batteryCell190Voltage = new ModbusReadLongChannel("Cell190Voltage", this).unit("mV")), //
new UnsignedWordElement(0x15BE, batteryCell191Voltage = new ModbusReadLongChannel("Cell191Voltage", this).unit("mV")), //
new UnsignedWordElement(0x15BF, batteryCell192Voltage = new ModbusReadLongChannel("Cell192Voltage", this).unit("mV")), //
new UnsignedWordElement(0x15C0, batteryCell193Voltage = new ModbusReadLongChannel("Cell193Voltage", this).unit("mV")), //
new UnsignedWordElement(0x15C1, batteryCell194Voltage = new ModbusReadLongChannel("Cell194Voltage", this).unit("mV")), //
new UnsignedWordElement(0x15C2, batteryCell195Voltage = new ModbusReadLongChannel("Cell195Voltage", this).unit("mV")), //
new UnsignedWordElement(0x15C3, batteryCell196Voltage = new ModbusReadLongChannel("Cell196Voltage", this).unit("mV")), //
new UnsignedWordElement(0x15C4, batteryCell197Voltage = new ModbusReadLongChannel("Cell197Voltage", this).unit("mV")), //
new UnsignedWordElement(0x15C5, batteryCell198Voltage = new ModbusReadLongChannel("Cell198Voltage", this).unit("mV")), //
new UnsignedWordElement(0x15C6, batteryCell199Voltage = new ModbusReadLongChannel("Cell199Voltage", this).unit("mV")), //
new UnsignedWordElement(0x15C7, batteryCell200Voltage = new ModbusReadLongChannel("Cell200Voltage", this).unit("mV")), //
new UnsignedWordElement(0x15C8, batteryCell201Voltage = new ModbusReadLongChannel("Cell201Voltage", this).unit("mV")), //
new UnsignedWordElement(0x15C9, batteryCell202Voltage = new ModbusReadLongChannel("Cell202Voltage", this).unit("mV")), //
new UnsignedWordElement(0x15CA, batteryCell203Voltage = new ModbusReadLongChannel("Cell203Voltage", this).unit("mV")), //
new UnsignedWordElement(0x15CB, batteryCell204Voltage = new ModbusReadLongChannel("Cell204Voltage", this).unit("mV")), //
new UnsignedWordElement(0x15CC, batteryCell205Voltage = new ModbusReadLongChannel("Cell205Voltage", this).unit("mV")), //
new UnsignedWordElement(0x15CD, batteryCell206Voltage = new ModbusReadLongChannel("Cell206Voltage", this).unit("mV")), //
new UnsignedWordElement(0x15CE, batteryCell207Voltage = new ModbusReadLongChannel("Cell207Voltage", this).unit("mV")), //
new UnsignedWordElement(0x15CF, batteryCell208Voltage = new ModbusReadLongChannel("Cell208Voltage", this).unit("mV")), //
new UnsignedWordElement(0x15D0, batteryCell209Voltage = new ModbusReadLongChannel("Cell209Voltage", this).unit("mV")), //
new UnsignedWordElement(0x15D1, batteryCell210Voltage = new ModbusReadLongChannel("Cell210Voltage", this).unit("mV")), //
new UnsignedWordElement(0x15D2, batteryCell211Voltage = new ModbusReadLongChannel("Cell211Voltage", this).unit("mV")), //
new UnsignedWordElement(0x15D3, batteryCell212Voltage = new ModbusReadLongChannel("Cell212Voltage", this).unit("mV")), //
new UnsignedWordElement(0x15D4, batteryCell213Voltage = new ModbusReadLongChannel("Cell213Voltage", this).unit("mV")), //
new UnsignedWordElement(0x15D5, batteryCell214Voltage = new ModbusReadLongChannel("Cell214Voltage", this).unit("mV")), //
new UnsignedWordElement(0x15D6, batteryCell215Voltage = new ModbusReadLongChannel("Cell215Voltage", this).unit("mV")), //
new UnsignedWordElement(0x15D7, batteryCell216Voltage = new ModbusReadLongChannel("Cell216Voltage", this).unit("mV")), //
new UnsignedWordElement(0x15D8, batteryCell217Voltage = new ModbusReadLongChannel("Cell217Voltage", this).unit("mV")), //
new UnsignedWordElement(0x15D9, batteryCell218Voltage = new ModbusReadLongChannel("Cell218Voltage", this).unit("mV")), //
new UnsignedWordElement(0x15DA, batteryCell219Voltage = new ModbusReadLongChannel("Cell219Voltage", this).unit("mV")), //
new UnsignedWordElement(0x15DB, batteryCell220Voltage = new ModbusReadLongChannel("Cell220Voltage", this).unit("mV")), //
new UnsignedWordElement(0x15DC, batteryCell221Voltage = new ModbusReadLongChannel("Cell221Voltage", this).unit("mV")), //
new UnsignedWordElement(0x15DD, batteryCell222Voltage = new ModbusReadLongChannel("Cell222Voltage", this).unit("mV")), //
new UnsignedWordElement(0x15DE, batteryCell223Voltage = new ModbusReadLongChannel("Cell223Voltage", this).unit("mV")), //
new UnsignedWordElement(0x15DF, batteryCell224Voltage = new ModbusReadLongChannel("Cell224Voltage", this).unit("mV"))));
this.power = new SymmetricPowerImpl(40000, setActivePower, setReactivePower, getParent().getBridge());
this.qMinLimit = new QGreaterEqualLimitation(power);
this.qMinLimit.setQ(-10000L);
this.power.addStaticLimitation(qMinLimit);
this.qMaxLimit = new QSmallerEqualLimitation(power);
this.qMaxLimit.setQ(10000L);
this.power.addStaticLimitation(qMaxLimit);
this.allowedApparentLimit = new SMaxLimitation(power);
this.allowedApparentLimit.setSMax(allowedApparent.valueOptional().orElse(0L), 0L, 0L);
this.allowedApparent.addChangeListener(new ChannelChangeListener() {
@Override
public void channelChanged(Channel channel, Optional<?> newValue, Optional<?> oldValue) {
allowedApparentLimit.setSMax(allowedApparent.valueOptional().orElse(0L), 0L, 0L);
}
});
this.power.addStaticLimitation(this.allowedApparentLimit);
this.allowedChargeLimit = new PGreaterEqualLimitation(power);
this.allowedChargeLimit.setP(this.allowedCharge.valueOptional().orElse(0L));
this.allowedCharge.addChangeListener(new ChannelChangeListener() {
@Override
public void channelChanged(Channel channel, Optional<?> newValue, Optional<?> oldValue) {
allowedChargeLimit.setP(allowedCharge.valueOptional().orElse(0L));
}
});
this.power.addStaticLimitation(this.allowedChargeLimit);
this.allowedDischargeLimit = new PSmallerEqualLimitation(power);
this.allowedDischargeLimit.setP(this.allowedDischarge.valueOptional().orElse(0L));
this.allowedDischarge.addChangeListener(new ChannelChangeListener() {
@Override
public void channelChanged(Channel channel, Optional<?> newValue, Optional<?> oldValue) {
allowedDischargeLimit.setP(allowedDischarge.valueOptional().orElse(0L));
}
});
return protocol;
}
use of io.openems.impl.protocol.modbus.internal.SignedWordElement in project openems by OpenEMS.
the class FeneconMiniEss method defineModbusProtocol.
/*
* Methods
*/
@Override
protected ModbusProtocol defineModbusProtocol() throws ConfigException {
ModbusProtocol protokol = new ModbusProtocol(new //
ModbusRegisterRange(//
100, new //
UnsignedWordElement(//
100, systemState = //
new ModbusReadLongChannel("SystemState", this).label(0, //
STANDBY).label(1, //
"Start Off-Grid").label(2, //
START).label(3, //
FAULT).label(4, "Off-grid PV")), new //
UnsignedWordElement(//
101, controlMode = //
new ModbusReadLongChannel("ControlMode", this).label(1, //
"Remote").label(2, //
"Local")), //
new DummyElement(102, 103), new //
UnsignedDoublewordElement(//
104, totalBatteryChargeEnergy = new ModbusReadLongChannel("TotalBatteryChargeEnergy", this).unit(//
"Wh")), new //
UnsignedDoublewordElement(//
106, totalBatteryDischargeEnergy = new ModbusReadLongChannel("TotalBatteryDischargeEnergy", this).unit(//
"Wh")), new //
UnsignedWordElement(//
108, batteryGroupState = //
new ModbusReadLongChannel("BatteryGroupState", this).label(0, //
"Initial").label(1, //
"Stop").label(2, //
"Starting").label(3, //
"Running").label(4, //
"Stopping").label(5, "Fail")), new //
UnsignedWordElement(//
109, soc = new ModbusReadLongChannel("Soc", this).unit("%").interval(0, 100)), new //
UnsignedWordElement(//
110, batteryVoltage = new ModbusReadLongChannel("BatteryVoltage", this).unit("mV").multiplier(2)), new //
SignedWordElement(//
111, batteryCurrent = new ModbusReadLongChannel("BatteryCurrent", this).unit("mA").multiplier(2)), new //
SignedWordElement(//
112, batteryPower = new ModbusReadLongChannel("BatteryPower", this).unit("W")), new //
UnsignedWordElement(//
113, //
new ModbusBitWrappingChannel("BatteryGroupAlarm", this, this.thingState).warningBit(0, //
WarningEss.FailTheSystemShouldBeStopped).warningBit(1, //
WarningEss.CommonLowVoltageAlarm).warningBit(2, //
WarningEss.CommonHighVoltageAlarm).warningBit(3, //
WarningEss.ChargingOverCurrentAlarm).warningBit(4, //
WarningEss.DischargingOverCurrentAlarm).warningBit(5, //
WarningEss.OverTemperatureAlarm).warningBit(6, //
WarningEss.InteralCommunicationAbnormal)), new //
UnsignedWordElement(//
114, pcsOperationState = new ModbusReadLongChannel("PcsOperationState", this).label(0, //
"Self-checking").label(1, //
"Standby").label(2, //
"Off grid PV").label(3, //
"Off grid").label(4, //
ON_GRID).label(5, //
"Fail").label(6, //
"bypass 1").label(7, "bypass 2")), //
new DummyElement(115, 117), new //
SignedWordElement(//
118, current = new ModbusReadLongChannel("Current", this).unit("mA").multiplier(2)), new DummyElement(119, 120), new //
UnsignedWordElement(//
121, voltage = new ModbusReadLongChannel("Voltage", this).unit("mV").multiplier(2)), new DummyElement(122, 123), new //
SignedWordElement(//
124, activePower = new ModbusReadLongChannel("ActivePower", this).unit("W")), new DummyElement(125, 126), new //
SignedWordElement(//
127, reactivePower = new ModbusReadLongChannel("ReactivePower", this).unit("var")), new DummyElement(128, 130), new //
UnsignedWordElement(//
131, frequency = new ModbusReadLongChannel("Frequency", this).unit("mHz").multiplier(1)), new DummyElement(132, 133), new //
UnsignedWordElement(//
134, phaseAllowedApparent = new ModbusReadLongChannel("PhaseAllowedApparentPower", this).unit("VA")), new DummyElement(135, 140), new //
UnsignedWordElement(//
141, allowedCharge = new ModbusReadLongChannel("AllowedCharge", this).unit("W").negate()), new //
UnsignedWordElement(//
142, allowedDischarge = new ModbusReadLongChannel("AllowedDischarge", this).unit("W")), new DummyElement(143, 149), new //
UnsignedWordElement(//
150, //
new ModbusBitWrappingChannel("PcsAlarm1", this, this.thingState).warningBit(0, //
WarningEss.GridUndervoltage).warningBit(1, //
WarningEss.GridOvervoltage).warningBit(2, //
WarningEss.GridUnderFrequency).warningBit(3, //
WarningEss.GridOverFrequency).warningBit(4, //
WarningEss.GridPowerSupplyOff).warningBit(5, //
WarningEss.GridConditionUnmeet).warningBit(6, //
WarningEss.DCUnderVoltage).warningBit(7, //
WarningEss.InputOverResistance).warningBit(8, //
WarningEss.CombinationError).warningBit(9, //
WarningEss.CommWithInverterError).warningBit(10, //
WarningEss.TmeError)), new UnsignedWordElement(151, //
new ModbusBitWrappingChannel("PcsAlarm2", this, this.thingState)), new UnsignedWordElement(152, //
new ModbusBitWrappingChannel("PcsFault1", this, this.thingState).faultBit(0, //
FaultEss.ControlCurrentOverload100Percent).faultBit(1, //
FaultEss.ControlCurrentOverload110Percent).faultBit(2, //
FaultEss.ControlCurrentOverload150Percent).faultBit(3, //
FaultEss.ControlCurrentOverload200Percent).faultBit(4, //
FaultEss.ControlCurrentOverload120Percent).faultBit(5, //
FaultEss.ControlCurrentOverload300Percent).faultBit(6, //
FaultEss.ControlTransientLoad300Percent).faultBit(7, //
FaultEss.GridOverCurrent).faultBit(8, //
FaultEss.LockingWaveformTooManyTimes).faultBit(9, //
FaultEss.InverterVoltageZeroDriftError).faultBit(10, //
FaultEss.GridVoltageZeroDriftError).faultBit(11, //
FaultEss.ControlCurrentZeroDriftError).faultBit(12, //
FaultEss.InverterCurrentZeroDriftError).faultBit(13, //
FaultEss.GridCurrentZeroDriftError).faultBit(14, //
FaultEss.PDPProtection).faultBit(15, //
FaultEss.HardwareControlCurrentProtection)), new //
UnsignedWordElement(//
153, //
new ModbusBitWrappingChannel("PcsFault2", this, this.thingState).faultBit(0, //
FaultEss.HardwareACVoltProtection).faultBit(1, //
FaultEss.HardwareDCCurrentProtection).faultBit(2, //
FaultEss.HardwareTemperatureProtection).faultBit(3, //
FaultEss.NoCapturingSignal).faultBit(4, //
FaultEss.DCOvervoltage).faultBit(5, //
FaultEss.DCDisconnected).faultBit(6, //
FaultEss.InverterUndervoltage).faultBit(7, //
FaultEss.InverterOvervoltage).faultBit(8, //
FaultEss.CurrentSensorFail).faultBit(9, //
FaultEss.VoltageSensorFail).faultBit(10, //
FaultEss.PowerUncontrollable).faultBit(11, //
FaultEss.CurrentUncontrollable).faultBit(12, //
FaultEss.FanError).faultBit(13, //
FaultEss.PhaseLack).faultBit(14, //
FaultEss.InverterRelayFault).faultBit(15, //
FaultEss.GridRelayFault)), new //
UnsignedWordElement(//
154, //
new ModbusBitWrappingChannel("PcsFault3", this, this.thingState).faultBit(0, //
FaultEss.ControlPanelOvertemp).faultBit(1, //
FaultEss.PowerPanelOvertemp).faultBit(2, //
FaultEss.DCInputOvercurrent).faultBit(3, //
FaultEss.CapacitorOvertemp).faultBit(4, //
FaultEss.RadiatorOvertemp).faultBit(5, //
FaultEss.TransformerOvertemp).faultBit(6, //
FaultEss.CombinationCommError).faultBit(7, //
FaultEss.EEPROMError).faultBit(8, //
FaultEss.LoadCurrentZeroDriftError).faultBit(9, //
FaultEss.CurrentLimitRError).faultBit(10, //
FaultEss.PhaseSyncError).faultBit(11, //
FaultEss.ExternalPVCurrentZeroDriftError).faultBit(12, //
FaultEss.ExternalGridCurrentZeroDriftError))), new //
WriteableModbusRegisterRange(//
200, new UnsignedWordElement(200, setWorkState = //
new ModbusWriteLongChannel("SetWorkState", this).label(0, //
"Local control").label(1, // "Remote control on grid starting"
START).label(2, //
"Remote control off grid starting").label(3, //
STOP).label(4, "Emergency Stop"))), new //
WriteableModbusRegisterRange(//
201, new SignedWordElement(201, //
setActivePower = new ModbusWriteLongChannel("SetActivePower", this).unit("W")), new SignedWordElement(202, //
setReactivePower = new ModbusWriteLongChannel("SetReactivePower", this).unit("Var"))), new //
WriteableModbusRegisterRange(//
9014, new UnsignedWordElement(9014, rtcYear = new ModbusWriteLongChannel("Year", this)), new UnsignedWordElement(9015, rtcMonth = new ModbusWriteLongChannel("Month", this)), new UnsignedWordElement(9016, rtcDay = new ModbusWriteLongChannel("Day", this)), new UnsignedWordElement(9017, rtcHour = new ModbusWriteLongChannel("Hour", this)), new UnsignedWordElement(9018, rtcMinute = new ModbusWriteLongChannel("Minute", this)), new UnsignedWordElement(9019, rtcSecond = new ModbusWriteLongChannel("Second", this))), new WriteableModbusRegisterRange(30558, new UnsignedWordElement(30558, setSetupMode = new ModbusWriteLongChannel("SetSetupMode", this).label(0, EssNature.OFF).label(1, EssNature.ON))), new WriteableModbusRegisterRange(30559, new UnsignedWordElement(30559, setPcsMode = //
new ModbusWriteLongChannel("SetPcsMode", this).label(0, //
"Emergency").label(1, //
"ConsumersPeakPattern").label(2, //
"Economic").label(3, //
"Eco").label(4, //
"Debug").label(5, //
"SmoothPv").label(6, "Remote"))), new ModbusRegisterRange(30157, new UnsignedWordElement(30157, setupMode = //
new ModbusReadLongChannel("SetupMode", this).label(0, //
EssNature.OFF).label(1, EssNature.ON)), new UnsignedWordElement(30158, pcsMode = //
new ModbusReadLongChannel("PcsMode", this).label(0, //
"Emergency").label(1, //
"ConsumersPeakPattern").label(2, //
"Economic").label(3, //
"Eco").label(4, //
"Debug").label(5, //
"SmoothPv").label(6, "Remote"))));
gridMode = new FunctionalReadChannel<Long>("GridMode", this, (channels) -> {
ReadChannel<Long> state = channels[0];
try {
if (state.value() == 1L) {
return 0L;
} else {
return 1L;
}
} catch (InvalidValueException e) {
return null;
}
}, systemState).label(0L, OFF_GRID).label(1L, ON_GRID);
apparentPower = new FunctionalReadChannel<Long>("ApparentPower", this, (channels) -> {
ReadChannel<Long> activePower = channels[0];
ReadChannel<Long> reactivePower = channels[1];
try {
return ControllerUtils.calculateApparentPower(activePower.value(), reactivePower.value());
} catch (InvalidValueException e) {
log.error("failed to calculate apparentPower. some value is missing.", e);
}
return 0l;
}, activePower, reactivePower);
this.power = new SymmetricPowerImpl(3000, setActivePower, setReactivePower, getParent().getBridge());
this.allowedApparentLimit = new SMaxLimitation(power);
this.allowedApparentLimit.setSMax(phaseAllowedApparent.valueOptional().orElse(0L) * 3, 0L, 0L);
this.phaseAllowedApparent.addChangeListener(new ChannelChangeListener() {
@Override
public void channelChanged(Channel channel, Optional<?> newValue, Optional<?> oldValue) {
allowedApparentLimit.setSMax(phaseAllowedApparent.valueOptional().orElse(0L) * 3, 0L, 0L);
}
});
this.power.addStaticLimitation(this.allowedApparentLimit);
this.allowedChargeLimit = new PGreaterEqualLimitation(power);
this.allowedChargeLimit.setP(this.allowedCharge.valueOptional().orElse(0L));
this.allowedCharge.addChangeListener(new ChannelChangeListener() {
@Override
public void channelChanged(Channel channel, Optional<?> newValue, Optional<?> oldValue) {
allowedChargeLimit.setP(allowedCharge.valueOptional().orElse(0L));
}
});
this.power.addStaticLimitation(this.allowedChargeLimit);
this.allowedDischargeLimit = new PSmallerEqualLimitation(power);
this.allowedDischargeLimit.setP(this.allowedDischarge.valueOptional().orElse(0L));
this.allowedDischarge.addChangeListener(new ChannelChangeListener() {
@Override
public void channelChanged(Channel channel, Optional<?> newValue, Optional<?> oldValue) {
allowedDischargeLimit.setP(allowedDischarge.valueOptional().orElse(0L));
}
});
return protokol;
}
Aggregations