Initial
This commit is contained in:
71
PLC/2 Spinner/POUs/Peripherie/FlowCheck/FlowCheck_FB.TcPOU
Normal file
71
PLC/2 Spinner/POUs/Peripherie/FlowCheck/FlowCheck_FB.TcPOU
Normal file
@@ -0,0 +1,71 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4026.11">
|
||||
<POU Name="FlowCheck_FB" Id="{17b1d40e-e4e0-4b29-8651-216f03eb8211}" SpecialFunc="None">
|
||||
<Declaration><![CDATA[FUNCTION_BLOCK FlowCheck_FB
|
||||
VAR_INPUT
|
||||
iStation : INT;
|
||||
MediaIndex : INT;
|
||||
Config : REFERENCE TO sConfigFlowCheck;
|
||||
UnderLimitErrorIndex : INT;
|
||||
OverLimitErrorIndex : INT;
|
||||
NotInRangeErrorIndex : INT;
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
Warning : BOOL;
|
||||
FlowOk : BOOL;
|
||||
|
||||
|
||||
MediaName : T_MaxString;
|
||||
CurrentFlow : LREAL;
|
||||
END_VAR
|
||||
VAR
|
||||
Timer : TON;
|
||||
FlowStatus : (Off, Wait, InLimit, UnderLimit, OverLimit);
|
||||
TimerInLimit : TON;
|
||||
|
||||
Output : BOOL;
|
||||
END_VAR
|
||||
]]></Declaration>
|
||||
<Implementation>
|
||||
<ST><![CDATA[Output := MediaArray[iStation][MediaIndex].bReferenceControl;
|
||||
CurrentFlow := MediaArray[iStation][MediaIndex].rReferenceFlow;
|
||||
MediaName := MediaArray[iStation][MediaIndex].ServiceName[Language];
|
||||
Timer(IN := Output, PT := T#5S);
|
||||
|
||||
IF NOT Output THEN
|
||||
FlowStatus := Off;
|
||||
ELSE
|
||||
IF CurrentFlow >= Config.rMin AND
|
||||
CurrentFlow <= Config.rMax THEN
|
||||
Timer(IN := FALSE);
|
||||
FlowStatus := InLimit;
|
||||
ELSIF Timer.Q THEN
|
||||
IF CurrentFlow < Config.rMin THEN
|
||||
FlowStatus := UnderLimit;
|
||||
ELSIF CurrentFlow > Config.rMax THEN
|
||||
FlowStatus := OverLimit;
|
||||
END_IF
|
||||
ELSE
|
||||
FlowStatus := Wait;
|
||||
END_IF
|
||||
END_IF
|
||||
|
||||
TimerInLimit(IN := FlowStatus = InLimit, PT := T#3S, Q => FlowOk);
|
||||
|
||||
CASE FlowStatus OF
|
||||
Off, Wait, InLimit:
|
||||
AlarmSend(iStation, UnderLimitErrorIndex, FALSE, eReportType.Warning, sAvailableResponse.NoResponse, TRUE);
|
||||
AlarmSend(iStation, OverLimitErrorIndex, FALSE, eReportType.Warning, sAvailableResponse.NoResponse, TRUE);
|
||||
Warning := FALSE;
|
||||
UnderLimit:
|
||||
AlarmSend(iStation, UnderLimitErrorIndex, FALSE, eReportType.Warning, sAvailableResponse.NoResponse, FALSE);
|
||||
AlarmSend(iStation, OverLimitErrorIndex, FALSE, eReportType.Warning, sAvailableResponse.NoResponse, TRUE);
|
||||
Warning := TRUE;
|
||||
OverLimit:
|
||||
AlarmSend(iStation, UnderLimitErrorIndex, FALSE, eReportType.Warning, sAvailableResponse.NoResponse, TRUE);
|
||||
AlarmSend(iStation, OverLimitErrorIndex, FALSE, eReportType.Warning, sAvailableResponse.NoResponse, FALSE);
|
||||
Warning := TRUE;
|
||||
END_CASE]]></ST>
|
||||
</Implementation>
|
||||
</POU>
|
||||
</TcPlcObject>
|
||||
1213
PLC/2 Spinner/POUs/Peripherie/FlowCheck/VISU_FLOW_CONFIG.TcVIS
Normal file
1213
PLC/2 Spinner/POUs/Peripherie/FlowCheck/VISU_FLOW_CONFIG.TcVIS
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4026.12">
|
||||
<DUT Name="sConfigFlowCheck" Id="{ff7e35fc-ec2f-4900-9dc7-61f535f82af3}">
|
||||
<Declaration><![CDATA[TYPE sConfigFlowCheck :
|
||||
STRUCT
|
||||
rLimit : LREAL;
|
||||
rTol : LREAL;
|
||||
END_STRUCT
|
||||
END_TYPE
|
||||
]]></Declaration>
|
||||
</DUT>
|
||||
</TcPlcObject>
|
||||
Reference in New Issue
Block a user