RES — Reset
RES in rungs.dev clears the accumulator and status bits of a TIMER or COUNTER tag back to zero — typically paired with RTO, CTU, or CTD on the same tag.
structure
Clears the accumulator and status bits of a TIMER or COUNTER tag back to zero.
Operands
| Name | Type |
|---|---|
structure | TIMER | COUNTER |
How It Works
- Rung goes true →
.ACCis cleared to0and every status bit on the structure (.EN,.TT,.DN,.CU,.CD,.OV,.UNas applicable) is cleared to0. .PREis not touched — the preset survives a reset.- Rung goes false →
RESdoes nothing.
Example — Clear a Counter
0
Button
CTU
Counter
PartsCount
Preset
10
Accum
0
1
ResetCount
PartsCount
Each rising edge on Button increments PartsCount.ACC. Pressing ResetCount clears the accumulator and PartsCount.DN.
When to Use
- Clearing a retentive timer (
RTO) — it is the only way to drop.ACCback to zero. - Resetting a counter (
CTU,CTD) — counters are retentive across rung transitions.
When Not to Use
- A non-retentive timer (
TON,TOF) already resets when its rung drops. CallingRESon it is redundant.
Common Mistakes
- Leaving the
RESrung always-true — that holds the structure at zero forever and the timer or counter never runs.
Related
- Timers overview
- Counters overview
- RTO — retentive timer that requires
RES - CTU, CTD — retentive counters
CTD — Count Down
CTD (Count Down) in rungs.dev decrements .ACC by 1 on each rising edge of the rung. Typically paired with CTU on the same COUNTER tag for bidirectional counting.
MOVE / MVM — Copy a Value
MOVE copies a literal or tag into a destination tag every scan in rungs.dev, converting between DINT and REAL when the types differ. MVM is a masked move that copies only selected bits.