Implemented fixes and improvements during comissioning
- New Balancing mode - HMI Interface for Inverterdata implemented - Adjusted GVL_CONFIG values - Read inverter data even when inverter is off - Added OPC UA settings to inverter data hmi interface - Added multisettings to safety project for strings
This commit is contained in:
@@ -6,9 +6,15 @@ VAR_INPUT
|
||||
// Enable
|
||||
xEnable : BOOL;
|
||||
|
||||
// Start in balancing mode
|
||||
xStartBalancing : BOOL;
|
||||
|
||||
// String in safety check mode
|
||||
xInSafetyCheckMode : BOOL;
|
||||
|
||||
// Requested inverter power
|
||||
rPowerInverter : REAL;
|
||||
|
||||
// Components shortage workaround
|
||||
stStringModuleVoltageConfig : ST_STRING_VOLT_CONFIG;
|
||||
|
||||
@@ -21,6 +27,9 @@ VAR_INPUT
|
||||
// Reset Safety
|
||||
xResetSafety : BOOL;
|
||||
|
||||
// All safetyinterlocks from safety plc are ok
|
||||
xSafetyIntlksOk AT %I* : BOOL;
|
||||
|
||||
// Release alarms
|
||||
xReleaseErrors : BOOL;
|
||||
|
||||
@@ -32,6 +41,13 @@ VAR_INPUT
|
||||
|
||||
// Input to confirm all errors
|
||||
xConfirmAlarms : BOOL;
|
||||
|
||||
// Repair switch closed
|
||||
xRepairSwitchOk AT %I* : BOOL;
|
||||
|
||||
// String inverter ip
|
||||
sInverterIP : STRING;
|
||||
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
// Current string voltage
|
||||
@@ -58,9 +74,6 @@ VAR_OUTPUT
|
||||
// Reset signal for safety dc circuit breaker
|
||||
xResetSafetyDCCB AT %Q* : BOOL;
|
||||
|
||||
// All safetyinterlocks are ok
|
||||
xSafetyIntlksOk : BOOL;
|
||||
|
||||
// All modules in automatic mode
|
||||
xAllModulesInAutoMode : BOOL;
|
||||
|
||||
@@ -68,6 +81,12 @@ VAR_OUTPUT
|
||||
xWarning : BOOL;
|
||||
|
||||
eStatus : E_COMPONENT_STATUS;
|
||||
|
||||
// Inverter status data
|
||||
stInverterData : ST_SUNSPEC_CURRENT_VALUES;
|
||||
|
||||
// Balancing done
|
||||
xBalancingDone : BOOL;
|
||||
END_VAR
|
||||
VAR
|
||||
_fbModule1 : FB_Module(CONCAT(Name,' - Module 1'));
|
||||
@@ -89,6 +108,16 @@ VAR
|
||||
// Safetyinterlocks pending alarm
|
||||
_fbSafetyInterlocksNotOkAlarm : FB_TcAlarm;
|
||||
|
||||
// Inverter startup error
|
||||
_fbInverterStartupTimeoutAlarm : FB_TcAlarm;
|
||||
|
||||
// DC Main switch not closed
|
||||
_fbDCMainSwitchNotClosed : FB_TcAlarm;
|
||||
|
||||
// Shutdown discharge stopped messages
|
||||
_fbSDDCLevel : FB_TcMessage;
|
||||
_fbSDUnitThreshold : FB_TcMessage;
|
||||
|
||||
// State for start and stop
|
||||
_iState : INT := 0;
|
||||
|
||||
@@ -103,6 +132,49 @@ VAR
|
||||
|
||||
// String name
|
||||
_sName : STRING;
|
||||
|
||||
// String inverter
|
||||
_fbInverter : FB_PowerSupplySunspec(Name);
|
||||
|
||||
// Internal inverter power command
|
||||
_rPowerInverterInternal : REAL;
|
||||
|
||||
// Enable inverter flag
|
||||
_xEnableInverter : BOOL;
|
||||
|
||||
// Fault timer for inverter startup
|
||||
_tonInverterStartupTimeout : TON := (PT := T#2M);
|
||||
|
||||
// Deabug delay timer for inverter shutdown
|
||||
_tonInverterShutdownDelay : TON := (PT := T#10S);
|
||||
|
||||
// Timer for Safety ok timeout
|
||||
_tonSafetyOkTimeout : TON := (PT := T#2M);
|
||||
|
||||
// Analog input for string current measurement
|
||||
_fbStringCurrent : FB_AnalogInput(CONCAT(Name,' - Current'));
|
||||
|
||||
xErrorInverter : BOOL;
|
||||
|
||||
_xReleaseLimitErrorsInternal : BOOL;
|
||||
|
||||
// Smallest segment voltage
|
||||
_rSmallestSegmentVoltage : REAL;
|
||||
|
||||
// Balancing done
|
||||
_xBalancingDone : BOOL;
|
||||
|
||||
// Enable modules internal signal
|
||||
_xEnable : BOOL;
|
||||
|
||||
// Start balancing internal signal
|
||||
_xStartBalancing : BOOL;
|
||||
|
||||
END_VAR
|
||||
|
||||
VAR PERSISTENT
|
||||
rCapacityWH : REAL;
|
||||
rCapacityAH : REAL;
|
||||
END_VAR
|
||||
]]></Declaration>
|
||||
<Implementation>
|
||||
@@ -113,24 +185,61 @@ xError := FALSE;
|
||||
xAllModulesInAutoMode := TRUE;
|
||||
|
||||
// Reset safety interlocks flag
|
||||
xSafetyIntlksOk := TRUE;
|
||||
//xSafetyIntlksOk := TRUE;
|
||||
|
||||
// Reset Safety
|
||||
xResetSafetyDCCB := xResetSafety;
|
||||
|
||||
// ===============================
|
||||
// DC Main switch error handling
|
||||
// ===============================
|
||||
IF (NOT xRepairSwitchOk) AND (NOT _fbDCMainSwitchNotClosed.bRaised) THEN
|
||||
_fbDCMainSwitchNotClosed.Raise(0);
|
||||
END_IF
|
||||
|
||||
IF xRepairSwitchOk AND _fbDCMainSwitchNotClosed.bRaised THEN
|
||||
_fbDCMainSwitchNotClosed.Clear(0, FALSE);
|
||||
END_IF
|
||||
|
||||
|
||||
// ===============================
|
||||
// DC current measurement
|
||||
// ===============================
|
||||
_fbStringCurrent(
|
||||
stScalingConfig:= GVL_CONFIG.stConfigSCSCurrent,
|
||||
stEWConfig:= GVL_CONFIG.stEWLSCSCurrent,
|
||||
stEWDelayConfig:= GVL_CONFIG.stEWDSCSCurrent,
|
||||
xReleaseErrors:= xReleaseErrors,
|
||||
xReleaseLimitErrors:= FALSE,
|
||||
xReleaseHardwareErrors:= xReleaseErrors,
|
||||
xConfirmAlarms:= xConfirmAlarms,
|
||||
xError=> ,
|
||||
xWarning=> ,
|
||||
rScaledValue=> ,
|
||||
xErrorLow=> ,
|
||||
xWarningLow=> ,
|
||||
xWarningHigh=> ,
|
||||
xErrorHigh=> ,
|
||||
stHMIInterface=> stHMIInterface.stStringCurrent);
|
||||
|
||||
|
||||
|
||||
// ===============================
|
||||
// Module 1
|
||||
// ===============================
|
||||
_fbModule1(
|
||||
xEnable := xEnable,
|
||||
xEnable := _xEnable,
|
||||
xStartBalancing := _xStartBalancing,
|
||||
xInverterEnabled := _fbInverter.xActive,
|
||||
stModuleVoltageConfig := stStringModuleVoltageConfig.stModule1VoltConfig,
|
||||
xInSafetyCheckMode := xInSafetyCheckMode,
|
||||
xEmergencyStopOk:= xEmergencyStopOk,
|
||||
stHMIInterface:= stHMIInterface.stHMIInterfaceModule1,
|
||||
xReleaseErrors:= xReleaseErrors,
|
||||
xReleaseLimitErrors:= xReleaseLimitErrors,
|
||||
xReleaseLimitErrors:= xReleaseLimitErrors AND _xReleaseLimitErrorsInternal,
|
||||
xReleaseManualMode := xReleaseManualMode,
|
||||
xConfirmAlarms:= xConfirmAlarms);
|
||||
xConfirmAlarms:= xConfirmAlarms,
|
||||
rBalancingTargetVoltage := _rSmallestSegmentVoltage);
|
||||
|
||||
IF _fbModule1.xWarning THEN
|
||||
xWarning := TRUE;
|
||||
@@ -140,10 +249,6 @@ IF _fbModule1.xError THEN
|
||||
xError := TRUE;
|
||||
END_IF
|
||||
|
||||
IF NOT _fbModule1.xSafetyIntlksOk THEN
|
||||
xSafetyIntlksOk := FALSE;
|
||||
END_IF
|
||||
|
||||
IF NOT _fbModule1.xAllUnitsInAutomatic THEN
|
||||
xAllModulesInAutoMode := FALSE;
|
||||
END_IF
|
||||
@@ -154,15 +259,18 @@ END_IF
|
||||
// ===============================
|
||||
|
||||
_fbModule2(
|
||||
xEnable := xEnable,
|
||||
xEnable := _xEnable,
|
||||
xStartBalancing := _xStartBalancing,
|
||||
xInverterEnabled := _fbInverter.xActive,
|
||||
stModuleVoltageConfig := stStringModuleVoltageConfig.stModule2VoltConfig,
|
||||
xInSafetyCheckMode := xInSafetyCheckMode,
|
||||
xEmergencyStopOk:= xEmergencyStopOk,
|
||||
stHMIInterface:= stHMIInterface.stHMIInterfaceModule2,
|
||||
xReleaseErrors:= xReleaseErrors,
|
||||
xReleaseLimitErrors:= xReleaseLimitErrors,
|
||||
xReleaseLimitErrors:= xReleaseLimitErrors AND _xReleaseLimitErrorsInternal,
|
||||
xReleaseManualMode := xReleaseManualMode,
|
||||
xConfirmAlarms:= xConfirmAlarms);
|
||||
xConfirmAlarms:= xConfirmAlarms,
|
||||
rBalancingTargetVoltage := _rSmallestSegmentVoltage);
|
||||
|
||||
IF _fbModule2.xWarning THEN
|
||||
xWarning := TRUE;
|
||||
@@ -172,10 +280,6 @@ IF _fbModule2.xError THEN
|
||||
xError := TRUE;
|
||||
END_IF
|
||||
|
||||
IF NOT _fbModule2.xSafetyIntlksOk THEN
|
||||
xSafetyIntlksOk := FALSE;
|
||||
END_IF
|
||||
|
||||
IF NOT _fbModule2.xAllUnitsInAutomatic THEN
|
||||
xAllModulesInAutoMode := FALSE;
|
||||
END_IF
|
||||
@@ -185,15 +289,18 @@ END_IF
|
||||
// Module 3
|
||||
// ===============================
|
||||
_fbModule3(
|
||||
xEnable := xEnable,
|
||||
xEnable := _xEnable,
|
||||
xStartBalancing := _xStartBalancing,
|
||||
xInverterEnabled := _fbInverter.xActive,
|
||||
stModuleVoltageConfig := stStringModuleVoltageConfig.stModule3VoltConfig,
|
||||
xInSafetyCheckMode := xInSafetyCheckMode,
|
||||
xEmergencyStopOk:= xEmergencyStopOk,
|
||||
stHMIInterface:= stHMIInterface.stHMIInterfaceModule3,
|
||||
xReleaseErrors:= xReleaseErrors,
|
||||
xReleaseLimitErrors:= xReleaseLimitErrors,
|
||||
xReleaseLimitErrors:= xReleaseLimitErrors AND _xReleaseLimitErrorsInternal,
|
||||
xReleaseManualMode := xReleaseManualMode,
|
||||
xConfirmAlarms:= xConfirmAlarms);
|
||||
xConfirmAlarms:= xConfirmAlarms,
|
||||
rBalancingTargetVoltage := _rSmallestSegmentVoltage);
|
||||
|
||||
IF _fbModule3.xWarning THEN
|
||||
xWarning := TRUE;
|
||||
@@ -203,15 +310,17 @@ IF _fbModule3.xError THEN
|
||||
xError := TRUE;
|
||||
END_IF
|
||||
|
||||
IF NOT _fbModule3.xSafetyIntlksOk THEN
|
||||
xSafetyIntlksOk := FALSE;
|
||||
END_IF
|
||||
|
||||
IF NOT _fbModule3.xAllUnitsInAutomatic THEN
|
||||
xAllModulesInAutoMode := FALSE;
|
||||
END_IF
|
||||
|
||||
|
||||
// ===============================
|
||||
// Handle shutdown discharge mode
|
||||
// ===============================
|
||||
_xAllModulesInShutdownDischargeMode := _fbModule1.xInShutdownDischargeMode AND _fbModule2.xInShutdownDischargeMode AND _fbModule3.xInShutdownDischargeMode;
|
||||
|
||||
|
||||
// ===============================
|
||||
// Handle safety interlock alarm
|
||||
// ===============================
|
||||
@@ -230,6 +339,12 @@ END_IF
|
||||
_xAllModulesReady := _fbModule1.xReady AND _fbModule2.xReady AND _fbModule3.xReady;
|
||||
|
||||
|
||||
// ===============================
|
||||
// Balancing done check
|
||||
// ===============================
|
||||
_xBalancingDone := _fbModule1.xBalancingDone AND _fbModule2.xBalancingDone AND _fbModule3.xBalancingDone;
|
||||
|
||||
|
||||
// ===============================
|
||||
// Modules in shutdown discharge mode
|
||||
// ===============================
|
||||
@@ -241,7 +356,6 @@ xInShutdownDischargeMode := _fbModule1.xInShutdownDischargeMode AND _fbModule2.x
|
||||
// ===============================
|
||||
xShutdownDischargeAllowed := _fbModule1.xShutdownDischargeAllowed AND _fbModule2.xShutdownDischargeAllowed AND _fbModule3.xShutdownDischargeAllowed;
|
||||
|
||||
|
||||
// ===============================
|
||||
// All modules off
|
||||
// ===============================
|
||||
@@ -276,24 +390,24 @@ END_IF
|
||||
|
||||
// Release signal for balance not ok
|
||||
_fbBalanceNotOkSignal(
|
||||
xSignal:= _xBalanceOk OR (NOT xEnable),
|
||||
xRelease:= TRUE,
|
||||
timOnDelay:= T#5S,
|
||||
timOffDelay:= T#60S,
|
||||
xSignal:= NOT _xBalanceOk,
|
||||
xRelease:= xEnable AND _xAllModulesReady,
|
||||
timOnDelay:= T#10S,
|
||||
timOffDelay:= T#10S,
|
||||
xReleaseSignal=> );
|
||||
|
||||
// Signal an error if all units are ready and module is out of balance
|
||||
IF _xAllModulesReady AND (NOT _fbBalanceNotOkSignal.xReleaseSignal) THEN
|
||||
IF _fbBalanceNotOkSignal.xReleaseSignal THEN
|
||||
xError := TRUE;
|
||||
END_IF
|
||||
|
||||
// Raise error
|
||||
IF (NOT _fbBalanceNotOkSignal.xReleaseSignal) AND (NOT _fbModulesOutOfBalanceAlarm.bRaised) THEN
|
||||
IF _fbBalanceNotOkSignal.xReleaseSignal AND (NOT _fbModulesOutOfBalanceAlarm.bRaised) THEN
|
||||
_fbModulesOutOfBalanceAlarm.Raise(0);
|
||||
END_IF
|
||||
|
||||
// Clear error
|
||||
IF _fbBalanceNotOkSignal.xReleaseSignal AND _fbModulesOutOfBalanceAlarm.bRaised THEN
|
||||
IF (NOT _fbBalanceNotOkSignal.xReleaseSignal) AND _fbModulesOutOfBalanceAlarm.bRaised AND xConfirmAlarms THEN
|
||||
_fbModulesOutOfBalanceAlarm.Clear(0, FALSE);
|
||||
END_IF
|
||||
|
||||
@@ -307,28 +421,117 @@ END_IF
|
||||
// ===============================
|
||||
_tonResetPulseLength();
|
||||
_tonErrorDCCBNotClosed();
|
||||
_tonSafetyOkTimeout();
|
||||
|
||||
|
||||
// ===============================
|
||||
// Get smalles segment voltage
|
||||
// of all units
|
||||
// ===============================
|
||||
_rSmallestSegmentVoltage := MIN(_fbModule1.rSmallestSegmentVoltage, _fbModule2.rSmallestSegmentVoltage, _fbModule3.rSmallestSegmentVoltage);
|
||||
|
||||
|
||||
// Call inverter
|
||||
_fbInverter(
|
||||
sInverterIPAddr:= sInverterIP,
|
||||
xEnable:= _xEnableInverter AND xEmergencyStopOk,
|
||||
rPower:= _rPowerInverterInternal,
|
||||
xReset:= xConfirmAlarms,
|
||||
rMaxBattPower:= DINT_TO_REAL(GVL_CONFIG.diMaxStringDischargePower),
|
||||
stCurrentValues => stInverterData);
|
||||
|
||||
IF (_iState >= 30) AND (_iState < 40) THEN
|
||||
rCapacityAH := rCapacityAH + ((stInverterData.rActDCCurrent * 0.01) / 3600);
|
||||
rCapacityWH := rCapacityWH + ((stInverterData.rActACPower * 0.01) / 3600);
|
||||
END_IF
|
||||
|
||||
CASE _iState OF
|
||||
0: // Idle
|
||||
IF _xAllModulesReady AND _xBalanceOk AND xAllModulesInAutoMode AND xEnable THEN
|
||||
xCloseDCCB := TRUE;
|
||||
// Start in normal mode
|
||||
IF xEnable AND (NOT xStartBalancing) AND xAllModulesInAutoMode AND xRepairSwitchOk THEN
|
||||
_xEnable := TRUE;
|
||||
_iState := 5;
|
||||
END_IF
|
||||
|
||||
// Start in balancing mode
|
||||
IF (NOT xEnable) AND xStartBalancing AND xAllModulesInAutoMode THEN
|
||||
_xStartBalancing := TRUE;
|
||||
_xReleaseLimitErrorsInternal := FALSE;
|
||||
_iState := 7;
|
||||
END_IF
|
||||
|
||||
5: // Wait for all modules to be ready in normal mode
|
||||
IF _xAllModulesReady AND _xBalanceOk THEN
|
||||
xResetSafetyDCCB := TRUE;
|
||||
IF (NOT xInSafetyCheckMode) THEN
|
||||
_xReleaseLimitErrorsInternal := TRUE;
|
||||
END_IF
|
||||
_tonResetPulseLength.IN := TRUE;
|
||||
_iState := 10;
|
||||
END_IF
|
||||
|
||||
IF (NOT xEnable) THEN
|
||||
_xEnable := FALSE;
|
||||
_iState := 0;
|
||||
END_IF
|
||||
|
||||
IF xError THEN
|
||||
_xEnable := FALSE;
|
||||
_iState := 1000;
|
||||
END_IF
|
||||
|
||||
7: // Wait for all modules to be ready in balancing mode
|
||||
IF _xAllModulesReady THEN
|
||||
_iState := 50;
|
||||
END_IF
|
||||
|
||||
IF (NOT xStartBalancing) THEN
|
||||
_xStartBalancing := FALSE;
|
||||
_iState := 0;
|
||||
END_IF
|
||||
|
||||
IF xError THEN
|
||||
_xEnable := FALSE;
|
||||
_iState := 1000;
|
||||
END_IF
|
||||
|
||||
|
||||
10: // Reset safety from sensors
|
||||
IF _tonResetPulseLength.Q THEN
|
||||
_tonResetPulseLength.IN := FALSE;
|
||||
xResetSafetyDCCB := FALSE;
|
||||
_tonSafetyOkTimeout.IN := TRUE;
|
||||
_iState := 15;
|
||||
END_IF
|
||||
|
||||
15: // Wait for Safety to be ok
|
||||
IF xSafetyIntlksOk THEN
|
||||
_tonSafetyOkTimeout.IN := FALSE;
|
||||
xCloseDCCB := TRUE;
|
||||
_tonErrorDCCBNotClosed.IN := TRUE;
|
||||
_iState := 20;
|
||||
END_IF
|
||||
|
||||
IF NOT xEnable THEN
|
||||
_tonSafetyOkTimeout.IN := FALSE;
|
||||
_xEnable := FALSE;
|
||||
_iState := 40;
|
||||
END_IF
|
||||
|
||||
IF _tonSafetyOkTimeout.Q THEN
|
||||
_tonSafetyOkTimeout.IN := FALSE;
|
||||
xCloseDCCB := TRUE;
|
||||
xError := TRUE;
|
||||
xReady := FALSE;
|
||||
_iState := 1000;
|
||||
END_IF
|
||||
|
||||
20: // Check if DC relais closed
|
||||
20: // Check if DC relais closed and safety is ok
|
||||
IF NOT xDCCBOpen THEN
|
||||
xReady := TRUE;
|
||||
_iState := 30;
|
||||
_xEnableInverter := TRUE;
|
||||
_rPowerInverterInternal := rPowerInverter;
|
||||
//_rPowerInverterInternal := 0.0;
|
||||
_iState := 21;
|
||||
END_IF
|
||||
IF _tonErrorDCCBNotClosed.Q THEN
|
||||
_tonErrorDCCBNotClosed.IN := FALSE;
|
||||
@@ -336,21 +539,127 @@ CASE _iState OF
|
||||
xReady := FALSE;
|
||||
_iState := 1000;
|
||||
END_IF
|
||||
|
||||
IF NOT xEnable THEN
|
||||
_tonSafetyOkTimeout.IN := FALSE;
|
||||
_xEnable := FALSE;
|
||||
_iState := 40;
|
||||
END_IF
|
||||
|
||||
21: // Wait for inverter to be ready
|
||||
_tonInverterStartupTimeout(IN := TRUE);
|
||||
IF _fbInverter.xActive AND (NOT _fbInverter.xError) THEN
|
||||
_iState := 30;
|
||||
xReady := TRUE;
|
||||
_tonInverterStartupTimeout(IN := FALSE);
|
||||
END_IF
|
||||
|
||||
IF (NOT xEnable) OR (NOT _xAllModulesReady) THEN
|
||||
_xEnableInverter := FALSE;
|
||||
_rPowerInverterInternal := 0.0;
|
||||
_xEnable := FALSE;
|
||||
_iState := 31;
|
||||
END_IF
|
||||
|
||||
// Inverter error or ttimeout for startup
|
||||
IF _fbInverter.xError OR (NOT xRepairSwitchOk) THEN // _tonInverterStartupTimeout.Q
|
||||
IF _tonInverterStartupTimeout.Q AND (NOT _fbInverterStartupTimeoutAlarm.bRaised) THEN
|
||||
_fbInverterStartupTimeoutAlarm.Raise(0);
|
||||
END_IF
|
||||
_iState := 1000;
|
||||
_xEnableInverter := FALSE;
|
||||
xError := TRUE;
|
||||
xErrorInverter := TRUE;
|
||||
_tonInverterStartupTimeout(IN := FALSE);
|
||||
END_IF
|
||||
|
||||
30: // All modules ready
|
||||
// !!! ATTENTION !!!
|
||||
// BMS HAS TO SHUT DOWN THE INVERTER BEFORE DISSABLING THE STRING
|
||||
// OTHERWISE THE DC CIRCUIT BREAKERS WILL OPEN WHILE THE INVERTER IS STILL ACTIVE
|
||||
// THIS CAN DAMAGE THE INVERTER
|
||||
IF rPowerInverter > DINT_TO_REAL(GVL_CONFIG.diMaxStringDischargePower) THEN
|
||||
// Limit discharge power (> because discharging is a positive number)
|
||||
_rPowerInverterInternal := DINT_TO_REAL(GVL_CONFIG.diMaxStringDischargePower);
|
||||
ELSIF rPowerInverter < DINT_TO_REAL(GVL_CONFIG.diMaxStringChargingPower) THEN
|
||||
// Limit charging power (< because charging is a negative number)
|
||||
_rPowerInverterInternal := DINT_TO_REAL(GVL_CONFIG.diMaxStringChargingPower);
|
||||
ELSE
|
||||
// Power command within range
|
||||
_rPowerInverterInternal := rPowerInverter;
|
||||
END_IF
|
||||
|
||||
IF NOT xEnable THEN
|
||||
// xCloseDCCB := FALSE;
|
||||
_iState := 0;
|
||||
ELSIF NOT _xAllModulesReady OR NOT _xBalanceOk THEN
|
||||
// _rPowerInverterInternal := 0.0;
|
||||
// _xEnableInverter := FALSE;
|
||||
_xEnable := FALSE;
|
||||
_xReleaseLimitErrorsInternal := FALSE;
|
||||
IF GVL_CONFIG.xShutdownDischargeWithInverter THEN
|
||||
_rPowerInverterInternal := GVL_CONFIG.rAbsShutdownDischargePower;
|
||||
_iState := 31;
|
||||
ELSE
|
||||
_rPowerInverterInternal := 0.0;
|
||||
_xEnableInverter := FALSE;
|
||||
_iState := 40;
|
||||
END_IF
|
||||
|
||||
ELSIF (NOT _xAllModulesReady) OR (NOT _xBalanceOk) OR (NOT xSafetyIntlksOk) OR (NOT xRepairSwitchOk) THEN
|
||||
xError := TRUE;
|
||||
// xCloseDCCB := FALSE;
|
||||
_xReleaseLimitErrorsInternal := FALSE;
|
||||
_xEnable := FALSE;
|
||||
_rPowerInverterInternal := 0.0;
|
||||
_xEnableInverter := FALSE;
|
||||
_iState := 1000;
|
||||
END_IF
|
||||
|
||||
31: // Wait for String to be in in shutdown discharge mode
|
||||
IF _xAllModulesInShutdownDischargeMode THEN
|
||||
_iState := 32;
|
||||
END_IF
|
||||
|
||||
32: // Shutdown discharge mode
|
||||
IF xShutdownDischargeAllowed AND GVL_CONFIG.xShutdownDischargeWithInverter AND xSafetyIntlksOk AND (stInverterData.rActDCVoltage > 620.0) THEN
|
||||
_rPowerInverterInternal := GVL_CONFIG.rAbsShutdownDischargePower;
|
||||
ELSE
|
||||
// Send shutdown message
|
||||
IF NOT xShutdownDischargeAllowed THEN
|
||||
_fbSDUnitThreshold.Send(0);
|
||||
END_IF
|
||||
|
||||
IF (stInverterData.rActDCVoltage < 620.0) THEN
|
||||
_fbSDDCLevel.Send(0);
|
||||
END_IF
|
||||
|
||||
_rPowerInverterInternal := 0.0;
|
||||
_xEnableInverter := FALSE;
|
||||
_iState := 40;
|
||||
END_IF
|
||||
|
||||
40: // Wait for inverter to shut down
|
||||
IF NOT _fbInverter.xActive THEN
|
||||
_iState := 41;
|
||||
END_IF
|
||||
|
||||
41: // Debug delay time for inverter shutdown
|
||||
_tonInverterShutdownDelay(IN := TRUE);
|
||||
|
||||
IF _tonInverterShutdownDelay.Q THEN
|
||||
_tonInverterShutdownDelay(IN := FALSE);
|
||||
xCloseDCCB := FALSE;
|
||||
_iState := 0;
|
||||
END_IF
|
||||
|
||||
50: // Wait for balancing of all units to be done
|
||||
IF _xBalancingDone THEN
|
||||
_xStartBalancing := FALSE;
|
||||
_iState := 51;
|
||||
END_IF
|
||||
|
||||
51: // Check if start balancing has been releases to avoid a restart
|
||||
IF (NOT xStartBalancing) THEN
|
||||
_iState := 0;
|
||||
END_IF
|
||||
|
||||
1000: // Error state
|
||||
// Leave error state only if modules are deactivated
|
||||
IF NOT xEnable THEN
|
||||
@@ -360,6 +669,8 @@ CASE _iState OF
|
||||
END_IF
|
||||
END_CASE
|
||||
|
||||
// Copy inverter data to SCADA interface
|
||||
stHMIInterface.stInverterData := stInverterData;
|
||||
|
||||
IF _xAllModulesReady AND _xBalanceOk AND (_iState = 30) THEN
|
||||
xReady := TRUE;
|
||||
@@ -367,6 +678,11 @@ ELSE
|
||||
xReady := FALSE;
|
||||
END_IF
|
||||
|
||||
// Reset inverter startup timeout alarm
|
||||
IF _fbInverterStartupTimeoutAlarm.bRaised AND xConfirmAlarms THEN
|
||||
_fbInverterStartupTimeoutAlarm.Clear(0, TRUE);
|
||||
END_IF
|
||||
|
||||
// ===============================
|
||||
// String status sum
|
||||
// ===============================
|
||||
@@ -405,7 +721,22 @@ _fbModulesOutOfBalanceAlarm.ipArguments.Clear().AddString(_sName);
|
||||
|
||||
// Create safetyinterlocks active alarm
|
||||
_fbSafetyInterlocksNotOkAlarm.CreateEx(stEventEntry := TC_EVENTS.BMSEvents.SafetyIntlksActive, bWithConfirmation := FALSE, 0);
|
||||
_fbSafetyInterlocksNotOkAlarm.ipArguments.Clear().AddString(_sName);]]></ST>
|
||||
_fbSafetyInterlocksNotOkAlarm.ipArguments.Clear().AddString(_sName);
|
||||
|
||||
// Create inverter startup timeout alarm
|
||||
_fbInverterStartupTimeoutAlarm.CreateEx(stEventEntry := TC_EVENTS.BMSEvents.InverterStartupTimeout, bWithConfirmation := TRUE, 0);
|
||||
_fbInverterStartupTimeoutAlarm.ipArguments.Clear().AddString(_sName);
|
||||
|
||||
// Create DC Main Switch not closed alarm
|
||||
_fbDCMainSwitchNotClosed.CreateEx(stEventEntry := TC_EVENTS.General.DCMainSwitchNotClosed, bWithConfirmation := FALSE, 0);
|
||||
_fbDCMainSwitchNotClosed.ipArguments.Clear().AddString(_sName);
|
||||
|
||||
// Shutdown discharge messages
|
||||
_fbSDDCLevel.CreateEx(TC_EVENTS.BMSEvents.SDDCVoltage, 0);
|
||||
_fbSDDCLevel.ipArguments.Clear().AddString(_sName);
|
||||
|
||||
_fbSDUnitThreshold.CreateEx(TC_EVENTS.BMSEvents.SDUnitThreshhold, 0);
|
||||
_fbSDUnitThreshold.ipArguments.Clear().AddString(_sName);]]></ST>
|
||||
</Implementation>
|
||||
</Method>
|
||||
<Property Name="Name" Id="{19fcb6d4-fd4b-49f9-9791-1e4c931b9e69}">
|
||||
@@ -437,155 +768,69 @@ _fbSafetyInterlocksNotOkAlarm.ipArguments.Clear().AddString(_sName);]]></ST>
|
||||
</Set>
|
||||
</Property>
|
||||
<LineIds Name="FB_String">
|
||||
<LineId Id="266" Count="0" />
|
||||
<LineId Id="268" Count="0" />
|
||||
<LineId Id="758" Count="0" />
|
||||
<LineId Id="757" Count="0" />
|
||||
<LineId Id="759" Count="0" />
|
||||
<LineId Id="335" Count="0" />
|
||||
<LineId Id="334" Count="0" />
|
||||
<LineId Id="336" Count="0" />
|
||||
<LineId Id="867" Count="0" />
|
||||
<LineId Id="866" Count="0" />
|
||||
<LineId Id="870" Count="0" />
|
||||
<LineId Id="267" Count="0" />
|
||||
<LineId Id="69" Count="0" />
|
||||
<LineId Id="67" Count="1" />
|
||||
<LineId Id="47" Count="0" />
|
||||
<LineId Id="140" Count="0" />
|
||||
<LineId Id="978" Count="0" />
|
||||
<LineId Id="875" Count="0" />
|
||||
<LineId Id="48" Count="0" />
|
||||
<LineId Id="50" Count="2" />
|
||||
<LineId Id="600" Count="0" />
|
||||
<LineId Id="53" Count="0" />
|
||||
<LineId Id="58" Count="0" />
|
||||
<LineId Id="62" Count="0" />
|
||||
<LineId Id="64" Count="0" />
|
||||
<LineId Id="66" Count="0" />
|
||||
<LineId Id="63" Count="0" />
|
||||
<LineId Id="59" Count="2" />
|
||||
<LineId Id="338" Count="0" />
|
||||
<LineId Id="337" Count="0" />
|
||||
<LineId Id="339" Count="1" />
|
||||
<LineId Id="761" Count="0" />
|
||||
<LineId Id="760" Count="0" />
|
||||
<LineId Id="762" Count="1" />
|
||||
<LineId Id="71" Count="4" />
|
||||
<LineId Id="871" Count="0" />
|
||||
<LineId Id="76" Count="0" />
|
||||
<LineId Id="141" Count="0" />
|
||||
<LineId Id="979" Count="0" />
|
||||
<LineId Id="876" Count="0" />
|
||||
<LineId Id="77" Count="3" />
|
||||
<LineId Id="601" Count="0" />
|
||||
<LineId Id="81" Count="7" />
|
||||
<LineId Id="70" Count="0" />
|
||||
<LineId Id="342" Count="2" />
|
||||
<LineId Id="341" Count="0" />
|
||||
<LineId Id="765" Count="2" />
|
||||
<LineId Id="764" Count="0" />
|
||||
<LineId Id="90" Count="5" />
|
||||
<LineId Id="142" Count="0" />
|
||||
<LineId Id="980" Count="0" />
|
||||
<LineId Id="877" Count="0" />
|
||||
<LineId Id="96" Count="3" />
|
||||
<LineId Id="602" Count="0" />
|
||||
<LineId Id="100" Count="7" />
|
||||
<LineId Id="89" Count="0" />
|
||||
<LineId Id="346" Count="2" />
|
||||
<LineId Id="345" Count="0" />
|
||||
<LineId Id="769" Count="2" />
|
||||
<LineId Id="768" Count="0" />
|
||||
<LineId Id="433" Count="1" />
|
||||
<LineId Id="432" Count="0" />
|
||||
<LineId Id="435" Count="4" />
|
||||
<LineId Id="441" Count="2" />
|
||||
<LineId Id="440" Count="0" />
|
||||
<LineId Id="183" Count="5" />
|
||||
<LineId Id="245" Count="4" />
|
||||
<LineId Id="244" Count="0" />
|
||||
<LineId Id="261" Count="4" />
|
||||
<LineId Id="260" Count="0" />
|
||||
<LineId Id="270" Count="4" />
|
||||
<LineId Id="269" Count="0" />
|
||||
<LineId Id="190" Count="3" />
|
||||
<LineId Id="182" Count="0" />
|
||||
<LineId Id="199" Count="5" />
|
||||
<LineId Id="198" Count="0" />
|
||||
<LineId Id="209" Count="0" />
|
||||
<LineId Id="208" Count="0" />
|
||||
<LineId Id="230" Count="1" />
|
||||
<LineId Id="211" Count="0" />
|
||||
<LineId Id="232" Count="0" />
|
||||
<LineId Id="210" Count="0" />
|
||||
<LineId Id="234" Count="1" />
|
||||
<LineId Id="233" Count="0" />
|
||||
<LineId Id="213" Count="0" />
|
||||
<LineId Id="212" Count="0" />
|
||||
<LineId Id="237" Count="1" />
|
||||
<LineId Id="236" Count="0" />
|
||||
<LineId Id="1187" Count="6" />
|
||||
<LineId Id="215" Count="5" />
|
||||
<LineId Id="353" Count="13" />
|
||||
<LineId Id="352" Count="0" />
|
||||
<LineId Id="221" Count="3" />
|
||||
<LineId Id="704" Count="0" />
|
||||
<LineId Id="725" Count="1" />
|
||||
<LineId Id="690" Count="0" />
|
||||
<LineId Id="692" Count="0" />
|
||||
<LineId Id="694" Count="1" />
|
||||
<LineId Id="710" Count="0" />
|
||||
<LineId Id="703" Count="0" />
|
||||
<LineId Id="697" Count="0" />
|
||||
<LineId Id="696" Count="0" />
|
||||
<LineId Id="698" Count="2" />
|
||||
<LineId Id="705" Count="0" />
|
||||
<LineId Id="711" Count="0" />
|
||||
<LineId Id="735" Count="0" />
|
||||
<LineId Id="712" Count="0" />
|
||||
<LineId Id="706" Count="0" />
|
||||
<LineId Id="713" Count="0" />
|
||||
<LineId Id="719" Count="0" />
|
||||
<LineId Id="734" Count="0" />
|
||||
<LineId Id="745" Count="0" />
|
||||
<LineId Id="739" Count="1" />
|
||||
<LineId Id="720" Count="0" />
|
||||
<LineId Id="744" Count="0" />
|
||||
<LineId Id="1194" Count="0" />
|
||||
<LineId Id="746" Count="0" />
|
||||
<LineId Id="727" Count="1" />
|
||||
<LineId Id="718" Count="0" />
|
||||
<LineId Id="714" Count="0" />
|
||||
<LineId Id="750" Count="3" />
|
||||
<LineId Id="741" Count="0" />
|
||||
<LineId Id="749" Count="0" />
|
||||
<LineId Id="742" Count="1" />
|
||||
<LineId Id="716" Count="0" />
|
||||
<LineId Id="1082" Count="0" />
|
||||
<LineId Id="1081" Count="0" />
|
||||
<LineId Id="717" Count="0" />
|
||||
<LineId Id="729" Count="1" />
|
||||
<LineId Id="738" Count="0" />
|
||||
<LineId Id="731" Count="0" />
|
||||
<LineId Id="736" Count="1" />
|
||||
<LineId Id="732" Count="1" />
|
||||
<LineId Id="693" Count="0" />
|
||||
<LineId Id="691" Count="0" />
|
||||
<LineId Id="689" Count="0" />
|
||||
<LineId Id="225" Count="0" />
|
||||
<LineId Id="747" Count="0" />
|
||||
<LineId Id="239" Count="1" />
|
||||
<LineId Id="214" Count="0" />
|
||||
<LineId Id="512" Count="0" />
|
||||
<LineId Id="511" Count="0" />
|
||||
<LineId Id="513" Count="4" />
|
||||
<LineId Id="521" Count="0" />
|
||||
<LineId Id="520" Count="0" />
|
||||
<LineId Id="522" Count="1" />
|
||||
<LineId Id="525" Count="0" />
|
||||
<LineId Id="524" Count="0" />
|
||||
<LineId Id="526" Count="1" />
|
||||
<LineId Id="3089" Count="50" />
|
||||
<LineId Id="3540" Count="0" />
|
||||
<LineId Id="3784" Count="0" />
|
||||
<LineId Id="3140" Count="28" />
|
||||
<LineId Id="3541" Count="0" />
|
||||
<LineId Id="3785" Count="0" />
|
||||
<LineId Id="3169" Count="7" />
|
||||
<LineId Id="3532" Count="0" />
|
||||
<LineId Id="3177" Count="18" />
|
||||
<LineId Id="3542" Count="0" />
|
||||
<LineId Id="3786" Count="0" />
|
||||
<LineId Id="3196" Count="7" />
|
||||
<LineId Id="3533" Count="0" />
|
||||
<LineId Id="3204" Count="35" />
|
||||
<LineId Id="3552" Count="0" />
|
||||
<LineId Id="3545" Count="2" />
|
||||
<LineId Id="3544" Count="0" />
|
||||
<LineId Id="3548" Count="0" />
|
||||
<LineId Id="3240" Count="104" />
|
||||
<LineId Id="3536" Count="0" />
|
||||
<LineId Id="3584" Count="0" />
|
||||
<LineId Id="3348" Count="1" />
|
||||
<LineId Id="3534" Count="1" />
|
||||
<LineId Id="3537" Count="0" />
|
||||
<LineId Id="3562" Count="0" />
|
||||
<LineId Id="3538" Count="0" />
|
||||
<LineId Id="3543" Count="0" />
|
||||
<LineId Id="3539" Count="0" />
|
||||
<LineId Id="3573" Count="2" />
|
||||
<LineId Id="3606" Count="0" />
|
||||
<LineId Id="3787" Count="0" />
|
||||
<LineId Id="3607" Count="0" />
|
||||
<LineId Id="3788" Count="0" />
|
||||
<LineId Id="3605" Count="0" />
|
||||
<LineId Id="3576" Count="3" />
|
||||
<LineId Id="3585" Count="0" />
|
||||
<LineId Id="3580" Count="1" />
|
||||
<LineId Id="3586" Count="1" />
|
||||
<LineId Id="3590" Count="0" />
|
||||
<LineId Id="3588" Count="1" />
|
||||
<LineId Id="3582" Count="1" />
|
||||
<LineId Id="3593" Count="11" />
|
||||
<LineId Id="3592" Count="0" />
|
||||
<LineId Id="3591" Count="0" />
|
||||
<LineId Id="3350" Count="18" />
|
||||
<LineId Id="3791" Count="0" />
|
||||
<LineId Id="3369" Count="23" />
|
||||
<LineId Id="3792" Count="0" />
|
||||
<LineId Id="3794" Count="3" />
|
||||
<LineId Id="3793" Count="0" />
|
||||
<LineId Id="3393" Count="11" />
|
||||
<LineId Id="3798" Count="0" />
|
||||
<LineId Id="3405" Count="33" />
|
||||
<LineId Id="3608" Count="0" />
|
||||
<LineId Id="3439" Count="12" />
|
||||
<LineId Id="3790" Count="0" />
|
||||
<LineId Id="3452" Count="42" />
|
||||
<LineId Id="3553" Count="0" />
|
||||
<LineId Id="3569" Count="0" />
|
||||
<LineId Id="3554" Count="1" />
|
||||
<LineId Id="3564" Count="4" />
|
||||
<LineId Id="3495" Count="36" />
|
||||
<LineId Id="527" Count="0" />
|
||||
</LineIds>
|
||||
<LineIds Name="FB_String.FB_init">
|
||||
<LineId Id="7" Count="0" />
|
||||
@@ -599,6 +844,18 @@ _fbSafetyInterlocksNotOkAlarm.ipArguments.Clear().AddString(_sName);]]></ST>
|
||||
<LineId Id="31" Count="0" />
|
||||
<LineId Id="29" Count="1" />
|
||||
<LineId Id="28" Count="0" />
|
||||
<LineId Id="45" Count="0" />
|
||||
<LineId Id="44" Count="0" />
|
||||
<LineId Id="46" Count="1" />
|
||||
<LineId Id="56" Count="0" />
|
||||
<LineId Id="55" Count="0" />
|
||||
<LineId Id="57" Count="1" />
|
||||
<LineId Id="67" Count="0" />
|
||||
<LineId Id="66" Count="0" />
|
||||
<LineId Id="68" Count="1" />
|
||||
<LineId Id="71" Count="0" />
|
||||
<LineId Id="70" Count="0" />
|
||||
<LineId Id="72" Count="0" />
|
||||
</LineIds>
|
||||
<LineIds Name="FB_String.Name.Get">
|
||||
<LineId Id="2" Count="0" />
|
||||
|
||||
Reference in New Issue
Block a user