Files
Uniper_PLC/PLC/POUs/FB_Module.TcPOU
2024-01-04 15:15:26 +01:00

155 lines
4.1 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4024.12">
<POU Name="FB_Module" Id="{87be924f-018d-4c09-997b-f0c0054414cc}" SpecialFunc="None">
<Declaration><![CDATA[FUNCTION_BLOCK FB_Module
VAR_INPUT
// Emergency stop ok
xEmergencyStopOk : BOOL;
// HMI Interface
stHMIInterface : REFERENCE TO ST_MODULE_HMI_INTERFACE;
// Release alarms
xReleaseErrors : BOOL;
// Release analog io limit errors
xReleaseLimitErrors : BOOL;
// Input to confirm all errors
xConfirmAlarms : BOOL;
END_VAR
VAR_OUTPUT
// One unit has an error
xError : BOOL;
// One unit has a warning
xWarning : BOOL;
END_VAR
VAR
_fbUnit1 : FB_Unit(CONCAT(_sName, ' Unit 1'));
_fbUnit2 : FB_Unit(CONCAT(_sName, ' Unit 2'));
_fbUnit3 : FB_Unit(CONCAT(_sName, ' Unit 3'));
_fbUnit4 : FB_Unit(CONCAT(_sName, ' Unit 4'));
// Module name
_sName : STRING;
END_VAR
]]></Declaration>
<Implementation>
<ST><![CDATA[// Reset error and warning flag
xError := FALSE;
xWarning := FALSE;
// ===============================
// Unit 1
// ===============================
_fbUnit1(
stUnitConfig:= GVL_CONFIG.stUnitConfig,
stHMIInterface:= stHMIInterface.stHMIInterfaceUnit1,
xEmergencyStopOk:= xEmergencyStopOk,
rSetpointPosolytPumpInlet:= GVL_CONFIG.rPumpPosolytOnPower,
rSetpointNegolytPumpInlet:= GVL_CONFIG.rPumpNegolytOnPower,
xReleaseErrors:= xReleaseErrors,
xReleaseLimitErrors:= xReleaseLimitErrors,
xConfirmAlarms:= xConfirmAlarms,
_xWarningConfirmPending=> );
IF _fbUnit1.xWarning THEN
xWarning := TRUE;
END_IF
IF _fbUnit1.xError THEN
xError := TRUE;
END_IF
// ===============================
// Unit 2
// ===============================
_fbUnit2(
stUnitConfig:= GVL_CONFIG.stUnitConfig,
stHMIInterface:= stHMIInterface.stHMIInterfaceUnit2,
xEmergencyStopOk:= xEmergencyStopOk,
rSetpointPosolytPumpInlet:= GVL_CONFIG.rPumpPosolytOnPower,
rSetpointNegolytPumpInlet:= GVL_CONFIG.rPumpNegolytOnPower,
xReleaseErrors:= xReleaseErrors,
xReleaseLimitErrors:= xReleaseLimitErrors,
xConfirmAlarms:= xConfirmAlarms,
_xWarningConfirmPending=> );
IF _fbUnit2.xWarning THEN
xWarning := TRUE;
END_IF
IF _fbUnit2.xError THEN
xError := TRUE;
END_IF
// ===============================
// Unit 3
// ===============================
_fbUnit3(
stUnitConfig:= GVL_CONFIG.stUnitConfig,
stHMIInterface:= stHMIInterface.stHMIInterfaceUnit3,
xEmergencyStopOk:= xEmergencyStopOk,
rSetpointPosolytPumpInlet:= GVL_CONFIG.rPumpPosolytOnPower,
rSetpointNegolytPumpInlet:= GVL_CONFIG.rPumpNegolytOnPower,
xReleaseErrors:= xReleaseErrors,
xReleaseLimitErrors:= xReleaseLimitErrors,
xConfirmAlarms:= xConfirmAlarms,
_xWarningConfirmPending=> );
IF _fbUnit3.xWarning THEN
xWarning := TRUE;
END_IF
IF _fbUnit3.xError THEN
xError := TRUE;
END_IF
// ===============================
// Unit 4
// ===============================
_fbUnit4(
stUnitConfig:= GVL_CONFIG.stUnitConfig,
stHMIInterface:= stHMIInterface.stHMIInterfaceUnit4,
xEmergencyStopOk:= xEmergencyStopOk,
rSetpointPosolytPumpInlet:= GVL_CONFIG.rPumpPosolytOnPower,
rSetpointNegolytPumpInlet:= GVL_CONFIG.rPumpNegolytOnPower,
xReleaseErrors:= xReleaseErrors,
xReleaseLimitErrors:= xReleaseLimitErrors,
xConfirmAlarms:= xConfirmAlarms,
_xWarningConfirmPending=> );
IF _fbUnit4.xWarning THEN
xWarning := TRUE;
END_IF
IF _fbUnit4.xError THEN
xError := TRUE;
END_IF]]></ST>
</Implementation>
<Method Name="FB_init" Id="{369c1d27-76e4-45f8-9dbe-03524d3389df}">
<Declaration><![CDATA[METHOD FB_init : BOOL
VAR_INPUT
bInitRetains : BOOL; // if TRUE, the retain variables are initialized (warm start / cold start)
bInCopyCode : BOOL; // if TRUE, the instance afterwards gets moved into the copy code (online change)
sName : STRING;
END_VAR
]]></Declaration>
<Implementation>
<ST><![CDATA[_sName := sName;]]></ST>
</Implementation>
</Method>
<LineIds Name="FB_Module">
<LineId Id="248" Count="92" />
<LineId Id="188" Count="0" />
</LineIds>
<LineIds Name="FB_Module.FB_init">
<LineId Id="7" Count="0" />
</LineIds>
</POU>
</TcPlcObject>