Files
BasicComponents/BasicComponents/Components/Controller/POUs/FB_Limit.TcPOU
m.heisig cf9501ea01 Changed all components to use HAL structs as in and outs
- All components now use HAL structs as inputs and outputs
- Restructured library folders
- FB_Axis_PTP now implements the execute pattern with E_CmdResult
- Bumped version number to 2.0.0
2026-03-19 12:17:10 +01:00

32 lines
667 B
XML

<?xml version="1.0" encoding="utf-8"?>
<TcPlcObject Version="1.1.0.1">
<POU Name="FB_Limit" Id="{b96bc001-8221-07a5-2342-3de34e6faf1f}" SpecialFunc="None">
<Declaration><![CDATA[FUNCTION_BLOCK FB_Limit
VAR_INPUT
rIn : REAL;
rMin : REAL;
rMax : REAL;
END_VAR
VAR_OUTPUT
rOut : REAL;
xClampedUpper : BOOL;
xClampedLower : BOOL;
END_VAR
VAR
END_VAR
]]></Declaration>
<Implementation>
<ST><![CDATA[IF rIn > rMax THEN
rOut := rMax;
xClampedUpper := TRUE;
ELSIF rIn < rMin THEN
rOut := rMin;
xClampedLower := TRUE;
ELSE
rOut := rIn;
xClampedUpper := FALSE;
xClampedLower := FALSE;
END_IF]]></ST>
</Implementation>
</POU>
</TcPlcObject>