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

RES

Clears the accumulator and status bits of a TIMER or COUNTER tag back to zero.

Operands

NameType
structureTIMER | COUNTER

How It Works

  • Rung goes true → .ACC is cleared to 0 and every status bit on the structure (.EN, .TT, .DN, .CU, .CD, .OV, .UN as applicable) is cleared to 0.
  • .PRE is not touched — the preset survives a reset.
  • Rung goes false → RES does nothing.

Example — Clear a Counter

0

Button

CTU

Counter

PartsCount

(CU)

Preset

10

(DN)

Accum

0

1

ResetCount

PartsCount

RES

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 .ACC back 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. Calling RES on it is redundant.

Common Mistakes

  • Leaving the RES rung always-true — that holds the structure at zero forever and the timer or counter never runs.

On this page