etisserant@0: (* Following taken directly from the IEC 61131.3 draft standard *) etisserant@0: etisserant@0: (* etisserant@0: * An IEC 61131-3 IL and ST compiler. etisserant@0: * etisserant@0: * Based on the etisserant@0: * FINAL DRAFT - IEC 61131-3, 2nd Ed. (2001-12-10) etisserant@0: * etisserant@0: *) etisserant@0: etisserant@0: etisserant@0: (* etisserant@0: * This is part of the library conatining the functions etisserant@0: * and function blocks defined in the standard. etisserant@0: * etisserant@0: * Edge detection function blocks etisserant@0: * ------------------------------ etisserant@0: *) etisserant@0: etisserant@0: FUNCTION_BLOCK R_TRIG etisserant@0: VAR_INPUT CLK: BOOL; END_VAR etisserant@0: VAR_OUTPUT Q: BOOL; END_VAR etisserant@0: VAR RETAIN M: BOOL; END_VAR etisserant@0: Q := CLK AND NOT M; etisserant@0: M := CLK; etisserant@0: END_FUNCTION_BLOCK etisserant@0: etisserant@0: FUNCTION_BLOCK F_TRIG etisserant@0: VAR_INPUT CLK: BOOL; END_VAR etisserant@0: VAR_OUTPUT Q: BOOL; END_VAR etisserant@0: VAR RETAIN M: BOOL; END_VAR etisserant@0: Q := NOT CLK AND NOT M; etisserant@0: M := NOT CLK; etisserant@0: END_FUNCTION_BLOCK etisserant@0: