7.1.2 RS
Function
RS is called reset priority standard bistable element, i.e. reset priority
LD graphics
Parameter description
| Interface variables | Declaration | Data type | Description |
|---|---|---|---|
| S | Var_Input | BOOL | Enable set |
| R1 | Var_Input | BOOL | Enable reset |
| Q1 | Var_Output | BOOL | Operand signal status |
Corresponding syntax
- Q1 = NOT R1 AND(Q1 OR S)
- When the S and R1 signals are both TRUE, the operand signal status is reset to "0";
- When the S signal is TRUE and the R1 signal is FALSE, the operand status is set to "1";
- When the S and R1 signals are both FALSE, the operand signal state remains unchanged.
- When the S signal is FALSE and the R1 signal is TRUE, the operand signal bit status is reset to "0"
warning
Function block usage requires global declaration of an instance
Example
- LD example is shown in the following animation:

- ST example is shown in the following code:
RS_1(S:=IN1,R1:=IN2,Q1=>OUT);
IF OUT THEN
iVar:=1;
ELSE
iVar:=0;
END_IF;