Added safety program pre comissioning and started implementing different modes

This commit is contained in:
Matthias Heisig
2024-03-20 18:08:57 +01:00
parent 57987cb19f
commit ef26159a4f
55 changed files with 10419 additions and 1663 deletions

View File

@@ -7,7 +7,7 @@ VAR_INPUT
xEnable : BOOL;
// Module 1 HMI interface
stHMIInterface : ST_STRING_HMI_INTERFACE;
stHMIInterface : REFERENCE TO ST_STRING_HMI_INTERFACE;
// Emergency stop ok
xEmergencyStopOk : BOOL;
@@ -18,6 +18,9 @@ VAR_INPUT
// Release analog io limit errors
xReleaseLimitErrors : BOOL;
// Release manual mode
xReleaseManualMode : BOOL;
// Input to confirm all errors
xConfirmAlarms : BOOL;
END_VAR
@@ -42,6 +45,8 @@ VAR_OUTPUT
xError : BOOL;
xWarning : BOOL;
eStatus : E_COMPONENT_STATUS;
END_VAR
VAR
_fbModule1 : FB_Module('Module 1');
@@ -82,7 +87,8 @@ _fbModule1(
xEmergencyStopOk:= xEmergencyStopOk,
stHMIInterface:= stHMIInterface.stHMIInterfaceModule1,
xReleaseErrors:= xReleaseErrors,
xReleaseLimitErrors:= xReleaseLimitErrors,
xReleaseLimitErrors:= xReleaseLimitErrors,
xReleaseManualMode := xReleaseManualMode,
xConfirmAlarms:= xConfirmAlarms);
IF _fbModule1.xWarning THEN
@@ -106,7 +112,8 @@ _fbModule2(
xEmergencyStopOk:= xEmergencyStopOk,
stHMIInterface:= stHMIInterface.stHMIInterfaceModule2,
xReleaseErrors:= xReleaseErrors,
xReleaseLimitErrors:= xReleaseLimitErrors,
xReleaseLimitErrors:= xReleaseLimitErrors,
xReleaseManualMode := xReleaseManualMode,
xConfirmAlarms:= xConfirmAlarms);
IF _fbModule2.xWarning THEN
@@ -130,7 +137,8 @@ _fbModule3(
xEmergencyStopOk:= xEmergencyStopOk,
stHMIInterface:= stHMIInterface.stHMIInterfaceModule3,
xReleaseErrors:= xReleaseErrors,
xReleaseLimitErrors:= xReleaseLimitErrors,
xReleaseLimitErrors:= xReleaseLimitErrors,
xReleaseManualMode := xReleaseManualMode,
xConfirmAlarms:= xConfirmAlarms);
IF _fbModule3.xWarning THEN
@@ -181,12 +189,11 @@ xShutdownDischargeAllowed := _fbModule1.xShutdownDischargeAllowed AND _fbModule2
// ===============================
xOff := _fbModule1.xOff AND _fbModule2.xOff AND _fbModule3.xOff;
// ===============================
// Calculate module voltage
// Calculate string voltage
// ===============================
rCurrentVoltage := _fbModule1.rCurrentVoltage + _fbModule2.rCurrentVoltage + _fbModule3.rCurrentVoltage;
stHMIInterface.rVoltage := rCurrentVoltage;
// ===============================
// String balance check
@@ -237,6 +244,21 @@ IF _xAllModulesReady AND _xBalanceOk THEN
xReady := TRUE;
ELSE
xReady := FALSE;
END_IF
// ===============================
// String status sum
// ===============================
IF xOff THEN
eStatus := E_COMPONENT_STATUS.OFF;
END_IF
IF xReady THEN
eStatus := E_COMPONENT_STATUS.ON;
END_IF
IF xError THEN
eStatus := E_COMPONENT_STATUS.ERROR;
END_IF]]></ST>
</Implementation>
<Method Name="FB_init" Id="{9e8494eb-1b40-4be9-91c8-810ecbdf7f0c}">
@@ -305,7 +327,9 @@ _fbSafetyInterlocksNotOkAlarm.ipArguments.Clear().AddString(_sName);]]></ST>
<LineId Id="47" Count="0" />
<LineId Id="140" Count="0" />
<LineId Id="48" Count="0" />
<LineId Id="50" Count="3" />
<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" />
@@ -317,13 +341,17 @@ _fbSafetyInterlocksNotOkAlarm.ipArguments.Clear().AddString(_sName);]]></ST>
<LineId Id="339" Count="1" />
<LineId Id="71" Count="5" />
<LineId Id="141" Count="0" />
<LineId Id="77" Count="11" />
<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="90" Count="5" />
<LineId Id="142" Count="0" />
<LineId Id="96" Count="11" />
<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" />
@@ -339,7 +367,6 @@ _fbSafetyInterlocksNotOkAlarm.ipArguments.Clear().AddString(_sName);]]></ST>
<LineId Id="260" Count="0" />
<LineId Id="270" Count="4" />
<LineId Id="269" Count="0" />
<LineId Id="197" Count="0" />
<LineId Id="190" Count="3" />
<LineId Id="182" Count="0" />
<LineId Id="199" Count="5" />
@@ -362,6 +389,15 @@ _fbSafetyInterlocksNotOkAlarm.ipArguments.Clear().AddString(_sName);]]></ST>
<LineId Id="221" Count="5" />
<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" />
</LineIds>
<LineIds Name="FB_String.FB_init">
<LineId Id="7" Count="0" />