FB: Monitor 2-Position Physical Key (2 Non-Equivalent Channels) - v1.0
This function block monitors a two-position physical key with two non-equivalent channels (normally open + normally closed) and detects discrepancy errors between them.
Use Cases
Section titled “Use Cases”- Safety-rated key switches where both NO and NC contacts must be monitored.
- Detecting wiring faults or contact failures through discrepancy monitoring.
Dependencies
Section titled “Dependencies”None.
Parameters
Section titled “Parameters”Function
Section titled “Function”| Parameter | Declaration | Type | Init. value | Description |
|---|---|---|---|---|
DI_no | Input | Bool | — | IR: Normally open digital input channel |
DI_nc | Input | Bool | — | IR: Normally closed digital input channel |
discrepancyTime | Input | Time | T#500ms | IR: Maximum allowed time for channels to be in discrepancy state |
Q | Output | Bool | — | OR: 0= Off; 1= On |
changing | Output | Bool | — | OR: 1= Key is transitioning between positions |
error | Output | Bool | — | OR: 1= Discrepancy error detected |
status | Output | Int | — | OR: Current state code (see table below) |
Status Codes
Section titled “Status Codes”| Value | Description |
|---|---|
0 | Off — key in off position |
1 | On — key in on position |
2 | Changing — transition in progress |
0x8000 | Discrepancy error — channels disagree beyond discrepancyTime |