FB: Monitor Physical Pulse Button (2 Outputs) - v1.0
This function block monitors a physical pulse button and generates two independent pulse outputs based on how long the button is held. A watchdog monitors for stuck-button conditions.
Use Cases
Section titled “Use Cases”- Short press = one action (e.g., step forward); long press = another action (e.g., jog continuous).
- Mode selection via button hold duration.
Dependencies
Section titled “Dependencies”| Type | Name | Version |
|---|---|---|
function | TP_TIME | Siemens FB |
function | TON_TIME | Siemens FB |
Parameters
Section titled “Parameters”Function
Section titled “Function”| Parameter | Declaration | Type | Init. value | Description |
|---|---|---|---|---|
button | Input | Bool | — | IW: 1= Button is pressed |
ACTION_1_TIME | Input | Time | T#2s | IR: Upper time limit for Q1. Must be less than ACTION_2_TIME |
ACTION_2_TIME | Input | Time | T#5s | IR: Lower time limit for Q2. Must be less than WATCHDOG_TIME |
WATCHDOG_TIME | Input Retain | Time | T#10s | IR: Watchdog time. 0= Disabled; >0= Maximum allowed press duration |
PULSE_TIME | Input Retain | Time | T#500ms | IR: Output pulse duration |
Q1 | Output | Bool | — | OR: Pulse on release — button held between 0s and ACTION_1_TIME |
Q2 | Output | Bool | — | OR: Pulse on release — button held between ACTION_2_TIME and WATCHDOG_TIME |
ET | Output | Time | — | OR: Elapsed time while button is pressed |
a2w_1_watchdog | Output | Bool | — | OR: 1= Alarm warning — button held longer than WATCHDOG_TIME |
Output Logic
Section titled “Output Logic”| Output | Condition |
|---|---|
Q1 | Button released with ET > 0s and ET < ACTION_1_TIME |
Q2 | Button released with ET > ACTION_2_TIME and ET < WATCHDOG_TIME |
a2w_1_watchdog | Button held longer than WATCHDOG_TIME |