Fixed automatic string restart after battery full or empty
- If battery was full or empty, the requested power has to be the opposite - Copied power setpoint from auto remote to auto local field so that it shows up in grafana
This commit is contained in:
@@ -743,6 +743,7 @@ GVL_MODBUS.stModbusEMSComm.stModbusReg11.rSetpointCosPhiMirror := GVL_MODBUS.stM
|
||||
CASE _eBMSControlMode OF
|
||||
E_BMS_CONTROL_MODE.AUTO_REMOTE:
|
||||
_eStringOpMode := E_STRING_OPERATING_MODE.AUTOMATIC;
|
||||
GVL_SCADA.stAutomaticModeHMI.diSetpointAutomatic := GVL_MODBUS.stModbusEMSComm.stModbusReg12.diSetpointActivePower;
|
||||
_xAllComponentsToManualMode := FALSE;
|
||||
_xInSafetyCheckMode := FALSE;
|
||||
_xReleaseManualMode := FALSE;
|
||||
@@ -1210,7 +1211,15 @@ _fbTowerLight(
|
||||
|
||||
// Restart if possible
|
||||
IF (ABS(_rAutoPowerRequest) > DINT_TO_REAL(GVL_CONFIG.diMinimumAbsPowerForEnable)) AND (NOT _xStringsErrorActive) AND _xStringsAllInAutomaticMode THEN
|
||||
_iState := 5;
|
||||
IF _rAutoPowerRequest < 0 AND GVL_MODBUS.stModbusEMSComm.stModbusReg11.eChargeStatus <> E_CHARGE_STATUS.FULL THEN
|
||||
_iState := 0;
|
||||
// TODO: Meldung ausgeben, dass Batterie schon voll ist
|
||||
END_IF
|
||||
|
||||
IF _rAutoPowerRequest > 0 AND GVL_MODBUS.stModbusEMSComm.stModbusReg11.eChargeStatus <> E_CHARGE_STATUS.EMPTY THEN
|
||||
_iState := 0;
|
||||
// TODO: Meldung ausgeben, dass Batterie schon leer ist.
|
||||
END_IF
|
||||
END_IF
|
||||
|
||||
45: // Wait for shutdown of string to be done
|
||||
@@ -1224,7 +1233,15 @@ _fbTowerLight(
|
||||
// Restart if possible
|
||||
IF (ABS(_rAutoPowerRequest) > DINT_TO_REAL(GVL_CONFIG.diMinimumAbsPowerForEnable)) AND (NOT _xStringsErrorActive) AND _xStringsAllInAutomaticMode THEN
|
||||
_xCanChangeMode := FALSE;
|
||||
_iState := 5;
|
||||
IF _rAutoPowerRequest < 0 AND GVL_MODBUS.stModbusEMSComm.stModbusReg11.eChargeStatus <> E_CHARGE_STATUS.FULL THEN
|
||||
_iState := 0;
|
||||
// TODO: Meldung ausgeben, dass Batterie schon voll ist
|
||||
END_IF
|
||||
|
||||
IF _rAutoPowerRequest > 0 AND GVL_MODBUS.stModbusEMSComm.stModbusReg11.eChargeStatus <> E_CHARGE_STATUS.EMPTY THEN
|
||||
_iState := 0;
|
||||
// TODO: Meldung ausgeben, dass Batterie schon leer ist.
|
||||
END_IF
|
||||
END_IF
|
||||
|
||||
// Check for errors
|
||||
|
||||
Reference in New Issue
Block a user