Some bugfixes
- Config for max string power is now correctly calculated - Adjusted timing for string and inverter timeout
This commit is contained in:
@@ -19,6 +19,10 @@ VAR
|
||||
{attribute 'OPC.UA.DA' := '0'}
|
||||
_afbStrings : ARRAY[0..1] OF FB_String[('String 1'), ('String 2')];
|
||||
|
||||
// Calculate max and min power depending on number of active strings
|
||||
_rMinPower : REAL;
|
||||
_rMaxPower : REAL;
|
||||
|
||||
// Battery shutdown due to error
|
||||
_xErrorShutdown : BOOL := FALSE;
|
||||
|
||||
@@ -659,6 +663,12 @@ FOR _ui := 0 TO (GVL_CONFIG.uiNumberOfStrings-1) DO
|
||||
END_IF
|
||||
END_FOR
|
||||
|
||||
// ===============================
|
||||
// Calculate max and min power depending on number of active strings
|
||||
// ===============================
|
||||
_rMinPower := _uiNumberOfActiveStrings * DINT_TO_REAL(GVL_CONFIG.diMaxStringChargingPower);
|
||||
_rMaxPower := _uiNumberOfActiveStrings * DINT_TO_REAL(GVL_CONFIG.diMaxStringDischargePower);
|
||||
|
||||
// ===============================
|
||||
// Calculate sum power for string balancing
|
||||
// ===============================
|
||||
@@ -1048,8 +1058,8 @@ _fbTowerLight(
|
||||
END_IF
|
||||
|
||||
5: // Check if power command is within limits
|
||||
IF _rAutoPowerRequest <= DINT_TO_REAL(GVL_CONFIG.diMaxStringDischargePower)
|
||||
AND _rAutoPowerRequest >= DINT_TO_REAL(GVL_CONFIG.diMaxStringChargingPower) THEN
|
||||
IF _rAutoPowerRequest <= _rMaxPower
|
||||
AND _rAutoPowerRequest >= _rMinPower THEN
|
||||
_xEnableString := TRUE;
|
||||
_xStartBalancing := FALSE;
|
||||
_iState := 10;
|
||||
|
||||
Reference in New Issue
Block a user