Run Hours
medium
Accumulate the run time of a BOOL input in seconds with a manual reset.
What it teaches
Use a timer to accumulate elapsed time, and an internal counter or DINT to roll TONR cycles into seconds (or use RTOR to retain ACC across enable drops). Teaches retentive timing, scan-time accumulation, and reset semantics.
Inputs and outputs
| Tag | Type | Default | Description |
|---|---|---|---|
| In_Run | BOOL | — | Signal to track run time |
| In_Reset | BOOL | — | Resets the accumulated time to 0 |
| Out_RunSeconds | DINT | — | Total accumulated run time in seconds |
Required behavior
- Accumulates elapsed time in seconds while In_Run is true.
- Retains the accumulated time when In_Run goes false.
- Resets the accumulated time to 0 when In_Reset is true.