First string implemented
This commit is contained in:
@@ -9,6 +9,9 @@ VAR_INPUT
|
||||
// Enable
|
||||
xEnable : BOOL;
|
||||
|
||||
// Component shortage workaround
|
||||
stModuleVoltageConfig : ST_MODULE_VOLT_CONFIG;
|
||||
|
||||
// Module in safety check mode
|
||||
xInSafetyCheckMode : BOOL;
|
||||
|
||||
@@ -56,10 +59,10 @@ VAR_OUTPUT
|
||||
xAllUnitsInAutomatic : BOOL;
|
||||
END_VAR
|
||||
VAR
|
||||
_fbUnit1 : FB_Unit('Unit 1');
|
||||
_fbUnit2 : FB_Unit('Unit 2');
|
||||
_fbUnit3 : FB_Unit('Unit 3');
|
||||
_fbUnit4 : FB_Unit('Unit 4');
|
||||
_fbUnit1 : FB_Unit(CONCAT(Name, ' - Unit 1'));
|
||||
_fbUnit2 : FB_Unit(CONCAT(Name, ' - Unit 2'));
|
||||
_fbUnit3 : FB_Unit(CONCAT(Name, ' - Unit 3'));
|
||||
_fbUnit4 : FB_Unit(CONCAT(Name, ' - Unit 4'));
|
||||
|
||||
// Flag for unit balance checking
|
||||
_xBalanceOk : BOOL;
|
||||
@@ -70,8 +73,13 @@ VAR
|
||||
// Units out of balance alarm
|
||||
_fbUnitsOutOfBalanceAlarm : FB_TcAlarm;
|
||||
|
||||
// Enable balance check
|
||||
_xEnableBalanceCheck : BOOL;
|
||||
|
||||
// Module name
|
||||
_sName : STRING;
|
||||
|
||||
_fbBalanceNotOkSignal : FB_ReleaseSignal;
|
||||
END_VAR
|
||||
]]></Declaration>
|
||||
<Implementation>
|
||||
@@ -91,12 +99,11 @@ xSafetyIntlksOk := TRUE;
|
||||
// ===============================
|
||||
_fbUnit1(
|
||||
xEnable := xEnable,
|
||||
xVoltageSensorIs1500V := stModuleVoltageConfig.xUnit1Is1500V,
|
||||
xInSafetyCheckMode := xInSafetyCheckMode,
|
||||
stUnitConfig:= GVL_CONFIG.stUnitConfig,
|
||||
stHMIInterface:= stHMIInterface.stHMIInterfaceUnit1,
|
||||
xEmergencyStopOk:= xEmergencyStopOk,
|
||||
rSetpointPosolytPumpInlet:= GVL_CONFIG.rPumpPosolytOnPower,
|
||||
rSetpointNegolytPumpInlet:= GVL_CONFIG.rPumpNegolytOnPower,
|
||||
xReleaseErrors:= xReleaseErrors,
|
||||
xReleaseLimitErrors:= xReleaseLimitErrors,
|
||||
xConfirmAlarms:= xConfirmAlarms,
|
||||
@@ -125,12 +132,11 @@ END_IF
|
||||
// ===============================
|
||||
_fbUnit2(
|
||||
xEnable := xEnable,
|
||||
xVoltageSensorIs1500V := stModuleVoltageConfig.xUnit2Is1500V,
|
||||
xInSafetyCheckMode := xInSafetyCheckMode,
|
||||
stUnitConfig:= GVL_CONFIG.stUnitConfig,
|
||||
stHMIInterface:= stHMIInterface.stHMIInterfaceUnit2,
|
||||
xEmergencyStopOk:= xEmergencyStopOk,
|
||||
rSetpointPosolytPumpInlet:= GVL_CONFIG.rPumpPosolytOnPower,
|
||||
rSetpointNegolytPumpInlet:= GVL_CONFIG.rPumpNegolytOnPower,
|
||||
xReleaseErrors:= xReleaseErrors,
|
||||
xReleaseLimitErrors:= xReleaseLimitErrors,
|
||||
xConfirmAlarms:= xConfirmAlarms,
|
||||
@@ -159,12 +165,11 @@ END_IF
|
||||
// ===============================
|
||||
_fbUnit3(
|
||||
xEnable := xEnable,
|
||||
xVoltageSensorIs1500V := stModuleVoltageConfig.xUnit3Is1500V,
|
||||
xInSafetyCheckMode := xInSafetyCheckMode,
|
||||
stUnitConfig:= GVL_CONFIG.stUnitConfig,
|
||||
stHMIInterface:= stHMIInterface.stHMIInterfaceUnit3,
|
||||
xEmergencyStopOk:= xEmergencyStopOk,
|
||||
rSetpointPosolytPumpInlet:= GVL_CONFIG.rPumpPosolytOnPower,
|
||||
rSetpointNegolytPumpInlet:= GVL_CONFIG.rPumpNegolytOnPower,
|
||||
xReleaseErrors:= xReleaseErrors,
|
||||
xReleaseLimitErrors:= xReleaseLimitErrors,
|
||||
xConfirmAlarms:= xConfirmAlarms,
|
||||
@@ -193,12 +198,11 @@ END_IF
|
||||
// ===============================
|
||||
_fbUnit4(
|
||||
xEnable := xEnable,
|
||||
xVoltageSensorIs1500V := stModuleVoltageConfig.xUnit4Is1500V,
|
||||
xInSafetyCheckMode := xInSafetyCheckMode,
|
||||
stUnitConfig:= GVL_CONFIG.stUnitConfig,
|
||||
stHMIInterface:= stHMIInterface.stHMIInterfaceUnit4,
|
||||
xEmergencyStopOk:= xEmergencyStopOk,
|
||||
rSetpointPosolytPumpInlet:= GVL_CONFIG.rPumpPosolytOnPower,
|
||||
rSetpointNegolytPumpInlet:= GVL_CONFIG.rPumpNegolytOnPower,
|
||||
xReleaseErrors:= xReleaseErrors,
|
||||
xReleaseLimitErrors:= xReleaseLimitErrors,
|
||||
xConfirmAlarms:= xConfirmAlarms,
|
||||
@@ -288,8 +292,16 @@ IF ABS(_fbUnit3.rCurrentVoltage - _fbUnit4.rCurrentVoltage) > GVL_CONFIG.rMaxAbs
|
||||
_xBalanceOk := FALSE;
|
||||
END_IF
|
||||
|
||||
// Release signal for balance not ok
|
||||
_fbBalanceNotOkSignal(
|
||||
xSignal:= _xBalanceOk OR (NOT xEnable),
|
||||
xRelease:= TRUE,
|
||||
timOnDelay:= T#5S,
|
||||
timOffDelay:= T#60S,
|
||||
xReleaseSignal=> );
|
||||
|
||||
// Signal an error if all units are ready and module is out of balance
|
||||
IF _xAllUnitsReady AND (NOT _xBalanceOk) THEN
|
||||
IF _xAllUnitsReady AND (NOT _fbBalanceNotOkSignal.xReleaseSignal) THEN
|
||||
xError := TRUE;
|
||||
END_IF
|
||||
|
||||
@@ -387,14 +399,27 @@ _fbUnitsOutOfBalanceAlarm.ipArguments.Clear().AddString(_sName);]]></ST>
|
||||
</Property>
|
||||
<LineIds Name="FB_Module">
|
||||
<LineId Id="903" Count="15" />
|
||||
<LineId Id="1305" Count="0" />
|
||||
<LineId Id="1226" Count="0" />
|
||||
<LineId Id="919" Count="32" />
|
||||
<LineId Id="919" Count="2" />
|
||||
<LineId Id="924" Count="27" />
|
||||
<LineId Id="1306" Count="0" />
|
||||
<LineId Id="1227" Count="0" />
|
||||
<LineId Id="952" Count="32" />
|
||||
<LineId Id="952" Count="2" />
|
||||
<LineId Id="957" Count="27" />
|
||||
<LineId Id="1307" Count="0" />
|
||||
<LineId Id="1228" Count="0" />
|
||||
<LineId Id="985" Count="32" />
|
||||
<LineId Id="985" Count="2" />
|
||||
<LineId Id="990" Count="27" />
|
||||
<LineId Id="1308" Count="0" />
|
||||
<LineId Id="1229" Count="0" />
|
||||
<LineId Id="1018" Count="135" />
|
||||
<LineId Id="1018" Count="2" />
|
||||
<LineId Id="1023" Count="87" />
|
||||
<LineId Id="1387" Count="0" />
|
||||
<LineId Id="1386" Count="0" />
|
||||
<LineId Id="1389" Count="4" />
|
||||
<LineId Id="1388" Count="0" />
|
||||
<LineId Id="1111" Count="42" />
|
||||
<LineId Id="674" Count="0" />
|
||||
</LineIds>
|
||||
<LineIds Name="FB_Module.FB_init">
|
||||
|
||||
Reference in New Issue
Block a user