Function Block - Reset dominant bistable.
SET :
BOOL Condition for forcing to TRUE
RESET1 : BOOL Condition for forcing to FALSE (highest priority
command)
Q1 : BOOL Output to be forced
SET |
RESET1 |
Q1 prev |
Q1 |
0 |
0 |
0 |
0 |
0 |
0 |
1 |
1 |
0 |
1 |
0 |
0 |
0 |
1 |
1 |
0 |
1 |
0 |
0 |
1 |
1 |
0 |
1 |
1 |
1 |
1 |
0 |
0 |
1 |
1 |
1 |
0 |
The output is unchanged when both inputs are FALSE. When both inputs are TRUE, the output is forced to FALSE (reset dominant).
(* MyRS is declared as an instance of RS
function block *)
MyRS (SET, RESET1);
Q1 := MyRS.Q1;
(* the SET command is the rung
- the rung is the output *)
(* MyRS is declared as an instance of RS
function block *)
Op1: CAL MyRS (SET, RESET1)
LD MyRS.Q1
ST Q1