equal
deleted
inserted
replaced
|
1 (* Following taken directly from the IEC 61131.3 draft standard *) |
|
2 |
|
3 (* |
|
4 * An IEC 61131-3 IL and ST compiler. |
|
5 * |
|
6 * Based on the |
|
7 * FINAL DRAFT - IEC 61131-3, 2nd Ed. (2001-12-10) |
|
8 * |
|
9 *) |
|
10 |
|
11 |
|
12 (* |
|
13 * This is part of the library conatining the functions |
|
14 * and function blocks defined in the standard. |
|
15 * |
|
16 * Edge detection function blocks |
|
17 * ------------------------------ |
|
18 *) |
|
19 |
|
20 FUNCTION_BLOCK R_TRIG |
|
21 VAR_INPUT CLK: BOOL; END_VAR |
|
22 VAR_OUTPUT Q: BOOL; END_VAR |
|
23 VAR RETAIN M: BOOL; END_VAR |
|
24 Q := CLK AND NOT M; |
|
25 M := CLK; |
|
26 END_FUNCTION_BLOCK |
|
27 |
|
28 FUNCTION_BLOCK F_TRIG |
|
29 VAR_INPUT CLK: BOOL; END_VAR |
|
30 VAR_OUTPUT Q: BOOL; END_VAR |
|
31 VAR RETAIN M: BOOL; END_VAR |
|
32 Q := NOT CLK AND NOT M; |
|
33 M := NOT CLK; |
|
34 END_FUNCTION_BLOCK |
|
35 |