Skip to main content

RES — Reset

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

XIC(Button)CTU(PartsCount);XIC(ResetCount)RES(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 .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.