Files
BasicComponents/BasicComponents/Components/Utilities/FB_Blinker.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

35 lines
770 B
XML

<?xml version="1.0" encoding="utf-8"?>
<TcPlcObject Version="1.1.0.1">
<POU Name="FB_Blinker" Id="{84dea953-e299-4743-83b2-332727c2009e}" SpecialFunc="None">
<Declaration><![CDATA[{attribute 'analysis' := '-56, -37'}
FUNCTION_BLOCK FINAL FB_Blinker
VAR_INPUT
rFrequency : REAL;
END_VAR
VAR_OUTPUT
xOut : BOOL;
END_VAR
VAR
_fbTON1 : TON;
_fbTON2 : TON;
_timTime : TIME;
END_VAR
]]></Declaration>
<Implementation>
<ST><![CDATA[// Calculate wait time
IF rFrequency = 0.0 THEN
rFrequency := 1.0;
END_IF
_timTime := REAL_TO_TIME((1.0/rFrequency)*0.5*1000.0);
// Blinker base
_fbTON1(IN := NOT _fbTON2.Q, PT := _timTime);
_fbTON2(IN := _fbTON1.Q, PT := _timTime);
// Output
xOut := _fbTON1.Q;]]></ST>
</Implementation>
</POU>
</TcPlcObject>