Files
infineon_legacy_plc/PLC/2 Spinner/POUs/ProblemTimer_FB.TcPOU
2026-01-08 11:08:17 +01:00

62 lines
1.3 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4026.12">
<POU Name="ProblemTimer_FB" Id="{9965a97d-e69b-4997-bc35-752a807c5131}" SpecialFunc="None">
<Declaration><![CDATA[FUNCTION_BLOCK ProblemTimer_FB
VAR_INPUT
iStation : INT;
Timeout : TIME;
MsgID : INT;
AvailableResponse : UINT;
Step : REFERENCE TO INT;
StepRetry : INT;
StepIgnore : INT;
END_VAR
VAR_OUTPUT
Error : BOOL;
END_VAR
VAR
Timer : TON;
ErrorIndex : INT;
END_VAR
]]></Declaration>
<Implementation>
<ST><![CDATA[IF StationsStatus[iStation].Soll.Stop THEN
Timer(IN := FALSE);
Error := FALSE;
END_IF
Timer(IN := Timeout <> T#0S, PT := Timeout);
IF Error THEN
CASE DialogRespons[ErrorIndex] OF
eErrorResponse.Abort,
eErrorResponse.Cancel:
StationsStatus[iStation].Soll.Stop := TRUE;
Error := FALSE;
Timer(IN := FALSE);
eErrorResponse.Retry:
Step := StepRetry;
Error := FALSE;
Timer(IN := FALSE);
eErrorResponse.Ignore:
Step := StepIgnore;
Error := FALSE;
Timer(IN := FALSE);
eErrorResponse.OK:
Step := StepIgnore;
Error := FALSE;
Timer(IN := FALSE);
END_CASE
ELSIF Timer.Q THEN
ErrorIndex := AlarmSend(iStation, MsgID, TRUE, eReportType.Error, AvailableResponse, FALSE);
Timeout := T#0S;
Error := TRUE;
END_IF]]></ST>
</Implementation>
</POU>
</TcPlcObject>