First string implemented
This commit is contained in:
65
PLC/POUs/FB_Safety.TcPOU
Normal file
65
PLC/POUs/FB_Safety.TcPOU
Normal file
@@ -0,0 +1,65 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4024.12">
|
||||
<POU Name="FB_Safety" Id="{f74eb8e4-e878-485f-9706-8dd039061a6b}" SpecialFunc="None">
|
||||
<Declaration><![CDATA[FUNCTION_BLOCK FB_Safety
|
||||
VAR_INPUT
|
||||
xVoltagesInRange AT %I* : BOOL;
|
||||
xPressureInRange AT %I* : BOOL;
|
||||
xTemperaturesInRange AT %I* : BOOL;
|
||||
|
||||
xReset : BOOL;
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
END_VAR
|
||||
VAR
|
||||
_latchedVoltages : BOOL;
|
||||
_latchedPressures : BOOL;
|
||||
_latechedTemperatures : BOOL;
|
||||
|
||||
_xErrorLatched : BOOL;
|
||||
END_VAR
|
||||
]]></Declaration>
|
||||
<Implementation>
|
||||
<ST><![CDATA[IF xReset THEN
|
||||
xReset := FALSE;
|
||||
_latchedVoltages := FALSE;
|
||||
_latchedPressures := FALSE;
|
||||
_latechedTemperatures := FALSE;
|
||||
_xErrorLatched := FALSE;
|
||||
END_IF
|
||||
|
||||
IF (NOT xVoltagesInRange) AND NOT _xErrorLatched THEN
|
||||
_latchedVoltages := TRUE;
|
||||
_xErrorLatched := TRUE;
|
||||
END_IF
|
||||
|
||||
IF (NOT xPressureInRange) AND NOT _xErrorLatched THEN
|
||||
_latchedPressures := TRUE;
|
||||
_xErrorLatched := TRUE;
|
||||
END_IF
|
||||
|
||||
IF (NOT xTemperaturesInRange) AND NOT _xErrorLatched THEN
|
||||
_latechedTemperatures := TRUE;
|
||||
_xErrorLatched := TRUE;
|
||||
END_IF]]></ST>
|
||||
</Implementation>
|
||||
<LineIds Name="FB_Safety">
|
||||
<LineId Id="28" Count="0" />
|
||||
<LineId Id="30" Count="0" />
|
||||
<LineId Id="32" Count="2" />
|
||||
<LineId Id="40" Count="0" />
|
||||
<LineId Id="31" Count="0" />
|
||||
<LineId Id="29" Count="0" />
|
||||
<LineId Id="9" Count="0" />
|
||||
<LineId Id="18" Count="0" />
|
||||
<LineId Id="37" Count="0" />
|
||||
<LineId Id="19" Count="0" />
|
||||
<LineId Id="21" Count="2" />
|
||||
<LineId Id="38" Count="0" />
|
||||
<LineId Id="20" Count="0" />
|
||||
<LineId Id="25" Count="2" />
|
||||
<LineId Id="39" Count="0" />
|
||||
<LineId Id="24" Count="0" />
|
||||
</LineIds>
|
||||
</POU>
|
||||
</TcPlcObject>
|
||||
Reference in New Issue
Block a user