Fix: Calculate the AC current for 3 phase inverters correctly
This commit is contained in:
parent
abb37242e8
commit
e81a280b87
@ -57,7 +57,7 @@ static const byteAssign_t byteAssignment[] = {
|
||||
{ TYPE_AC, CH0, FLD_F, UNIT_HZ, 80, 2, 100, false, 2 },
|
||||
{ TYPE_AC, CH0, FLD_PAC, UNIT_W, 82, 2, 10, false, 1 },
|
||||
{ TYPE_AC, CH0, FLD_Q, UNIT_VAR, 84, 2, 10, true, 1 },
|
||||
{ TYPE_AC, CH0, FLD_IAC, UNIT_A, 86, 2, 100, false, 2 }, // dummy
|
||||
{ TYPE_AC, CH0, FLD_IAC, UNIT_A, CALC_TOTAL_IAC, 0, CMD_CALC, false, 2 },
|
||||
{ TYPE_AC, CH0, FLD_IAC_1, UNIT_A, 86, 2, 100, false, 2 },
|
||||
{ TYPE_AC, CH0, FLD_IAC_2, UNIT_A, 88, 2, 100, false, 2 },
|
||||
{ TYPE_AC, CH0, FLD_IAC_3, UNIT_A, 90, 2, 100, false, 2 },
|
||||
|
||||
@ -11,6 +11,7 @@ static float calcChUdc(StatisticsParser* iv, uint8_t arg0);
|
||||
static float calcTotalPowerDc(StatisticsParser* iv, uint8_t arg0);
|
||||
static float calcTotalEffiency(StatisticsParser* iv, uint8_t arg0);
|
||||
static float calcChIrradiation(StatisticsParser* iv, uint8_t arg0);
|
||||
static float calcTotalCurrentAc(StatisticsParser* iv, uint8_t arg0);
|
||||
|
||||
using func_t = float(StatisticsParser*, uint8_t);
|
||||
|
||||
@ -25,7 +26,8 @@ const calcFunc_t calcFunctions[] = {
|
||||
{ CALC_CH_UDC, &calcChUdc },
|
||||
{ CALC_TOTAL_PDC, &calcTotalPowerDc },
|
||||
{ CALC_TOTAL_EFF, &calcTotalEffiency },
|
||||
{ CALC_CH_IRR, &calcChIrradiation }
|
||||
{ CALC_CH_IRR, &calcChIrradiation },
|
||||
{ CALC_TOTAL_IAC, &calcTotalCurrentAc }
|
||||
};
|
||||
|
||||
const FieldId_t runtimeFields[] = {
|
||||
@ -446,3 +448,12 @@ static float calcChIrradiation(StatisticsParser* iv, uint8_t arg0)
|
||||
}
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
static float calcTotalCurrentAc(StatisticsParser* iv, uint8_t arg0)
|
||||
{
|
||||
float acCurrent = 0;
|
||||
acCurrent += iv->getChannelFieldValue(TYPE_AC, CH0, FLD_IAC_1);
|
||||
acCurrent += iv->getChannelFieldValue(TYPE_AC, CH0, FLD_IAC_2);
|
||||
acCurrent += iv->getChannelFieldValue(TYPE_AC, CH0, FLD_IAC_3);
|
||||
return acCurrent;
|
||||
}
|
||||
|
||||
@ -60,7 +60,8 @@ enum {
|
||||
CALC_CH_UDC,
|
||||
CALC_TOTAL_PDC,
|
||||
CALC_TOTAL_EFF,
|
||||
CALC_CH_IRR
|
||||
CALC_CH_IRR,
|
||||
CALC_TOTAL_IAC
|
||||
};
|
||||
enum { CMD_CALC = 0xffff };
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user