Type
| Function blockAvailable 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
Data type: | (SAFE)BOOL |
Description: | If TRUE, Q1 is set dominant. |
RESET
Data type: | BOOL |
Description: | If TRUE, Q1 is reset. |
Output
Q1
Data type: | (SAFE)BOOL |
Description: | Output value. |
|
Timing diagram
| SR timing diagram
0 | The inputs SET1 and RESET are FALSE. Q1 is also FALSE. |
1 | SET1 switches from FALSE to TRUE, Q1 is set to TRUE. |
2 | SET1 is reset to FALSE, Q1 remains TRUE. |
3 | RESET switches from FALSE to TRUE. Q1 is reset to FALSE. |
4 | SET1 switches from FALSE to TRUE while RESET remains TRUE. As SET1 has priority over RESET, Q1 is set to TRUE. |
5 | The inputs SET1 and RESET are reset to FALSE. Q1 remains TRUE. |
6 | RESET switches from FALSE to TRUE. Q1 is reset to FALSE. |
7 | The inputs SET1 and RESET are FALSE. Q1 is also FALSE. |
|