Skip to main content

7.1.2 RS

Function

RS is called reset priority standard bistable element, i.e. reset priority

LD graphics

Alt ​​text

Parameter description

Interface variablesDeclarationData typeDescription
SVar_InputBOOLEnable set
R1Var_InputBOOLEnable reset
Q1Var_OutputBOOLOperand 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:

alt text

  • 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;