-

SR / SR_S

Type Function block

Available as standard (non-safety-related) and safety-related type (*_S). For the safety-related type, the safety-related data types (SAFE*) are expected at the formal parameters.
Description The SR function block realizes a latching relay with setting priority over resetting. A latching relay remains in its last state when power is switched off.

The Q1 output is set with a transition from FALSE to TRUE at the SET1 input. Q remains TRUE until the RESET input switches from FALSE to TRUE. If SET1 and RESET are TRUE, the SET1 input has priority.
If the input SET1 = TRUE, the output Q1 is set. Q1 remains set even if SET1 becomes FALSE. Q1 is reset, if RESET = TRUE. If both inputs are TRUE, Q1 is set by SET1 = TRUE.

If the function block is called for the first time, Q1 is FALSE.
Notes
  • All parameters can be negated.

    Note: The negation of formal parameters is not supported in safety-related code (SNOLD).

  • Function blocks have to be instantiated. An instance name of your choice must be declared in the variables worksheet of the POU where the FB is going to be used (declaration using VAR keyword). The instance name must be unique within the POU.
Parameters Inputs

SET1

RESET

Output

Q1
Timing diagram SR timing diagram