SR (Functionblock) |
Top Previous Next |
SR is a function block that acts as a Set/Reset flip flop. On a leading edge on the "S1" input, the "q" output will stay active. On a leading edge on the "R" input, the "out" will stay inactive. If a leading edge is seen at the same time on both "S1" and "R", the set function "wins", and the "out" will stay active. Please see the RS function block for a "Reset" dominant flip-flop.
Input: S1 : BOOL (true/false) A leading edge on this signal will set the "out" to active.
R : BOOL (true/false) A leading edge on this signal will set the "out" to inactive.
Output: q : BOOL (true/false) This signal will be active if a leading edge is seen on "S1", and it will be inactive if a leading edge is seen on "R".
Declaration: FUNCTION_BLOCK SR;
Example: INCLUDE rtcu.inc |