Fixed some bugs and added inverter status to modbus register

- Safety now has a tof of 0,5s for Temp, Voltage and Pressure
- Doppelhöcker now switches powercommand during second phase
This commit is contained in:
Matthias Heisig
2025-09-24 10:10:37 +02:00
parent d882effb35
commit dd82744356
12 changed files with 343 additions and 260 deletions

View File

@@ -129,6 +129,9 @@ VAR_OUTPUT
// Balancing done
xBalancingDone : BOOL;
// Inverter infos for EMS display
stInverterInfos : ST_KACO_INFOS;
END_VAR
VAR
_fbModule1 : FB_Module(CONCAT(Name,' - Module 1'));
@@ -390,7 +393,8 @@ _fbInverter(
rPower:= _rPowerInverterInternal,
xReset:= xConfirmAlarms,
rMaxBattPower:= DINT_TO_REAL(GVL_CONFIG.diMaxStringDischargePower),
stCurrentValues => stInverterData);
stCurrentValues => stInverterData,
stInverterInfos => stInverterInfos);
refuStringErrorsModbus.stBitmap.bInverterError := _fbInverter.xError;
@@ -679,7 +683,7 @@ CASE _iState OF
_iState := 40;
END_IF
ELSIF (NOT _xAllModulesReady) OR (NOT _xBalanceOk) OR (NOT xSafetyIntlksOk) OR (NOT xRepairSwitchOk) OR (_xErrorInternal) THEN
ELSIF (NOT _xAllModulesReady) OR (_fbBalanceNotOkSignal.xReleaseSignal) OR (NOT xSafetyIntlksOk) OR (NOT xRepairSwitchOk) OR (_xErrorInternal) THEN
xError := TRUE;
_xEnable := FALSE;
_rPowerInverterInternal := 0.0;
@@ -1079,8 +1083,8 @@ END_IF
_fbBalanceNotOkSignal(
xSignal:= NOT _xBalanceOk,
xRelease:= xEnable AND _xAllModulesReady,
timOnDelay:= T#10S,
timOffDelay:= T#10S,
timOnDelay:= T#5S,
timOffDelay:= T#5S,
xReleaseSignal=> );
// Signal an error if all units are ready and module is out of balance