Files
Adeco_20220119-01/TC3_CNCPLCBase/OEM/FB_Druckluftueberwachung.TcPOU
Matthias Heisig 51d6e7e5c4 Initial commit
2024-10-22 14:22:54 +02:00

105 lines
2.8 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4024.6">
<POU Name="FB_Druckluftueberwachung" Id="{4ec61056-d0c8-4903-a1aa-fd76f3b805f6}" SpecialFunc="None">
<Declaration><![CDATA[FUNCTION_BLOCK FB_Druckluftueberwachung
VAR_INPUT
nErrorId : UINT := 1;
bSpindleStopped : BOOL;
bDruckluftOk : BOOL;
END_VAR
VAR_OUTPUT
bStopSpindle : BOOL;
END_VAR
VAR
tofDruckluftOk : TOF;
ftDruckluftOk : F_TRIG;
nState : INT := 0;
bDummy : BOOL;
fbAlarm : FB_Alarm;
END_VAR
]]></Declaration>
<Implementation>
<ST><![CDATA[tofDruckluftOk(IN := bDruckluftOk, PT := T#1S);
// Abschalten bei fallender Flanke von Druckluft OK
ftDruckluftOk(CLK:= tofDruckluftOk.Q);
// Alarmbehandlung
fbAlarm(Event := TC_EVENTS.Alarms.Druckluft);
CASE nState OF
0: // IDLE
IF ftDruckluftOk.Q THEN
// MSG_ALARM_List[nErrorId] := TRUE;
fbAlarm.Raise := TRUE;
nState := 10;
END_IF
10: // Druck unter Wert gefallen -> Maschine anhalten und Freigabe wegnehmen
IF CNCSystem.Channel[0].ActState = HLI_IMCM_PROCESS_ACTIVE THEN
PLCMachineMode[0].Stop := TRUE;
nState := 20;
ELSE
bStopSpindle := TRUE;
PLCAxisEnable := FALSE;
nState := 30;
END_IF
20: // Warten auf Hold
IF CNCSystem.Channel[0].ActState = HLI_IMCM_PROCESS_HOLD THEN
bStopSpindle := TRUE;
nState := 30;
END_IF
30: // Warten auf Spindel stopp
IF bSpindleStopped THEN
nState := 60;
END_IF
60: // Warten auf Druckluft ok
IF bDruckluftOk THEN
fbAlarm.Raise := FALSE;
bStopSpindle := FALSE;
nState := 0;
END_IF
END_CASE]]></ST>
</Implementation>
<LineIds Name="FB_Druckluftueberwachung">
<LineId Id="98" Count="1" />
<LineId Id="14" Count="0" />
<LineId Id="9" Count="0" />
<LineId Id="140" Count="0" />
<LineId Id="139" Count="0" />
<LineId Id="141" Count="0" />
<LineId Id="16" Count="0" />
<LineId Id="15" Count="0" />
<LineId Id="17" Count="0" />
<LineId Id="19" Count="0" />
<LineId Id="114" Count="0" />
<LineId Id="137" Count="0" />
<LineId Id="20" Count="3" />
<LineId Id="90" Count="0" />
<LineId Id="24" Count="0" />
<LineId Id="47" Count="0" />
<LineId Id="92" Count="0" />
<LineId Id="95" Count="0" />
<LineId Id="94" Count="0" />
<LineId Id="93" Count="0" />
<LineId Id="91" Count="0" />
<LineId Id="38" Count="1" />
<LineId Id="49" Count="0" />
<LineId Id="61" Count="0" />
<LineId Id="65" Count="0" />
<LineId Id="62" Count="2" />
<LineId Id="66" Count="2" />
<LineId Id="81" Count="2" />
<LineId Id="116" Count="0" />
<LineId Id="86" Count="0" />
<LineId Id="84" Count="1" />
<LineId Id="72" Count="0" />
<LineId Id="18" Count="0" />
</LineIds>
</POU>
</TcPlcObject>