Added more components
This commit is contained in:
35
PLC/POUs/Components/Utilities/FB_Blinker.TcPOU
Normal file
35
PLC/POUs/Components/Utilities/FB_Blinker.TcPOU
Normal file
@@ -0,0 +1,35 @@
|
||||
<?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>
|
||||
Reference in New Issue
Block a user