Files
infineon_plc/PLC/01_Stationen/MediaStation/POUs/FB_Tank.TcPOU
m.heisig 0ea0887bb4 First version Tray Feeder ready for test
- Tray feeder implementation ready for first tests
- Some refactoring of packml function names
- Added .xtv file to project again because of linking issues
- Added hmi button for packml complete command
- Started media cabinet
2026-03-03 14:11:58 +01:00

92 lines
3.0 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<TcPlcObject Version="1.1.0.1">
<POU Name="FB_Tank" Id="{d029e65c-5c27-470b-8bee-fea9f0455669}" SpecialFunc="None">
<Declaration><![CDATA[FUNCTION_BLOCK FB_Tank
VAR_INPUT
xReleaseErrors : BOOL;
xReleaseManualMode : BOOL;
xConfirmAlarms : BOOL;
END_VAR
VAR_OUTPUT
xOverfull : BOOL;
xFull : BOOL;
xEmpty : BOOL;
xError : BOOL;
END_VAR
VAR_IN_OUT
stHMIInterface : ST_HMI_Tank;
END_VAR
VAR
i_xOverfull AT %I* : BOOL;
i_xFull AT %I* : BOOL;
i_xEmpty AT %I* : BOOL;
fbFillingValve : FB_Valve;
fbDrainValve : FB_Valve;
fbPumpValve : FB_Valve;
_stValveConfig : ST_ValveConfig;
_wFillingValveSafetyIntlkUsed : T_INTERLOCK;
_wFillingValveSafetyIntlk : T_INTERLOCK;
END_VAR
]]></Declaration>
<Implementation>
<ST><![CDATA[// Overfull is NC so true if ok
_wFillingValveSafetyIntlk.0 := i_xOverfull;
fbFillingValve(
xReleaseErrors:= xReleaseErrors,
stValveConfig:= _stValveConfig,
xReleaseManualMode:= xReleaseManualMode,
wSafetyINTLK:= _wFillingValveSafetyIntlk,
wSafetyINTLKUsed:= _wFillingValveSafetyIntlkUsed,
xConfirmAlarms:= xConfirmAlarms,
stHMIInterface:= stHMIInterface.stFillingValve);
fbDrainValve(
xReleaseErrors:= xReleaseErrors,
stValveConfig:= _stValveConfig,
xReleaseManualMode:= xReleaseManualMode,
xConfirmAlarms:= xConfirmAlarms,
stHMIInterface:= stHMIInterface.stDrainValve);
fbPumpValve(
xReleaseErrors:= xReleaseErrors,
stValveConfig:= _stValveConfig,
xReleaseManualMode:= xReleaseManualMode,
xConfirmAlarms:= xConfirmAlarms,
stHMIInterface:= stHMIInterface.stPumpValve);]]></ST>
</Implementation>
<Method Name="FB_Init" Id="{9c6d1842-9c2e-4437-b40f-941f77668ffe}">
<Declaration><![CDATA[//FB_Init is always available implicitly and it is used primarily for initialization.
//The return value is not evaluated. For a specific influence, you can also declare the
//methods explicitly and provide additional code there with the standard initialization
//code. You can evaluate the return value.
METHOD FB_Init: BOOL
VAR_INPUT
bInitRetains: BOOL; // TRUE: the retain variables are initialized (reset warm / reset cold)
bInCopyCode: BOOL; // TRUE: the instance will be copied to the copy code afterward (online change)
END_VAR
]]></Declaration>
<Implementation>
<ST><![CDATA[_stValveConfig.xHasOpenFeedback := FALSE;
_stValveConfig.xHasClosedFeedback := FALSE;
stHMIInterface.stFillingValve.stInterlock.asSafetyINTLKName[0] := 'Tank overfull';
_wFillingValveSafetyIntlkUsed.0 := 1;]]></ST>
</Implementation>
</Method>
<Method Name="M_HandleHMIOutput" Id="{8939e00b-3459-4b5e-a4b3-7b489eec260a}">
<Declaration><![CDATA[METHOD PRIVATE M_HandleHMIOutput : BOOL
VAR_INPUT
END_VAR
]]></Declaration>
<Implementation>
<ST><![CDATA[// Overfull sensor is NC
stHMIInterface.xOverfull := (NOT i_xOverfull);
stHMIInterface.xFull := i_xFull;
stHMIInterface.xEmpty := i_xEmpty;]]></ST>
</Implementation>
</Method>
</POU>
</TcPlcObject>