# How do counters function in CODESYS?

**URL:** <https://forumautomation.com/t/how-do-counters-function-in-codesys/11879>\
**Category:** Field Instrumentation\
**Tags:** plc\
**Created:** [March 18, 2024, 1:31pm UTC](https://forumautomation.com/t/how-do-counters-function-in-codesys/11879 "2024-03-18T13:31:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rabert](https://forumautomation.com/user_avatar/forumautomation.com/rabert/32/6784_2.png) [@Rabert](https://forumautomation.com/u/Rabert)\
**Post date:** [March 18, 2024, 1:31pm UTC](https://forumautomation.com/t/how-do-counters-function-in-codesys/11879/1 "2024-03-18T13:31:34Z")

</div>

Counter instructions are utilized in PLC programming to record the number of times an event happens. The following is a brief description of how a **CODESYS** counter instruction functions:

The CU input turns True & the Counter Value increase by 1 at **t0.**

At time **t1,** the output of the counter **Q becomes True** and the Counter Value equals the Preset Value.

 ![1](https://cdn.forumautomation.com/original/2X/a/a9cc8ba6ddba3d33baaa550d738939e17647bfbd.jpeg)

At time **t2,** the output **Q becomes False** and the Counter Value is reset to 0 as a result of the RESET input becoming True.
