Skip to content

Instantly share code, notes, and snippets.

@kdorsel
Created May 7, 2021 17:38
Show Gist options
  • Save kdorsel/7e7bf2effca713d6dc40ff925b380124 to your computer and use it in GitHub Desktop.
Save kdorsel/7e7bf2effca713d6dc40ff925b380124 to your computer and use it in GitHub Desktop.
custom f trig
<?xml version="1.0" encoding="utf-8"?>
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4024.6">
<POU Name="ftrig" Id="{08dbb7b6-d63f-42f2-a984-021281ab9bcb}" SpecialFunc="None">
<Declaration><![CDATA[FUNCTION_BLOCK ftrig
VAR_INPUT
clk: BOOL := TRUE;
END_VAR
VAR_OUTPUT
Q : BOOL;
END_VAR
VAR
washigh : BOOL := TRUE;
END_VAR
]]></Declaration>
<Implementation>
<ST><![CDATA[
Q := FALSE;
IF clk THEN
washigh := TRUE;
END_IF
IF NOT clk AND washigh THEN
washigh := FALSE;
Q := TRUE;
END_IF
]]></ST>
</Implementation>
</POU>
</TcPlcObject>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment