Run Hours
medium
Totals a machine's run time as hours, minutes, and seconds, retaining the total through stops, with a manual reset.
What it teaches
The real hour meter: run one retentive timer continuously and bank a second each time its accumulator passes a moving 1000 ms target, then cascade the rollovers — seconds into minutes, minutes into hours. Self-resetting timers lose a little time at every rollover on real controllers; the free-running meter with a moving target is the drift-free production pattern.
Inputs and outputs
| Tag | Type | Default | Description |
|---|---|---|---|
| In_Run | BOOL | — | Signal to track run time |
| In_Reset | BOOL | — | Clears the accumulated total |
| Out_Seconds | DINT | — | Seconds portion of the total, 0-59 |
| Out_Minutes | DINT | — | Minutes portion of the total, 0-59 |
| Out_Hours | DINT | — | Whole hours of accumulated run time |
Required behavior
- Accumulates run time while In_Run is 1 and holds the total — including any partial second — while In_Run is 0.
- Every full 1000 ms of accumulated run time advances the display by exactly one second — the meter never drifts.
- Out_Seconds and Out_Minutes roll over at 60.
- In_Reset clears the total to 0:00:00, including any partial second.