# Timer in Plecs State flow

**URL:** <https://forum.plexim.com/t/timer-in-plecs-state-flow/940>\
**Category:** PLECS\
**Tags:** c-script, plecs-coder, plecs-stateflow\
**Created:** [January 15, 2021, 10:47am UTC](https://forum.plexim.com/t/timer-in-plecs-state-flow/940 "2021-01-15T10:47:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Samk](https://avatars.discourse-cdn.com/v4/letter/s/b3f665/32.png) [@Samk](https://forum.plexim.com/u/Samk)\
**Post date:** [January 15, 2021, 10:47am UTC](https://forum.plexim.com/t/timer-in-plecs-state-flow/940/1 "2021-01-15T10:47:36Z")

</div>

Is there way to implement wait timer in stateflow.

---

<div class="post-metadata">

**Author:** ![Manu\_Parimi](https://dub1.discourse-cdn.com/flex006/user_avatar/forum.plexim.com/manu_parimi/32/6_2.png) [@Manu\_Parimi](https://forum.plexim.com/u/Manu_Parimi)\
**Post date:** [January 15, 2021, 12:41pm UTC](https://forum.plexim.com/t/timer-in-plecs-state-flow/940/2 "2021-01-15T12:41:09Z")

</div>

Hi Samk,

It is possible to implement a waiting state using the state machine block. For reference, please look at the application example [here](https://www.plexim.com/support/examples?field_demo_model_product_value=1&body_value=All&body_value_1=2), titled “PLECS: Buck Converter with Constant On-Time Control”. In this example, the current compensator is implemented using a state machine block, and it uses “timer” events and a “waiting” state. I attached the write-up of this application example to this post.

Regards,Manu

[buck\_converter\_with\_constant\_on\_time\_control.pdf](https://forum.plexim.com/uploads/short-url/m820vSs3gjjXkHYMTNd7fh01bY3.pdf) (143 KB)

---

<div class="post-metadata">

**Author:** ![Samk](https://avatars.discourse-cdn.com/v4/letter/s/b3f665/32.png) [@Samk](https://forum.plexim.com/u/Samk)\
**Post date:** [January 20, 2021, 10:24am UTC](https://forum.plexim.com/t/timer-in-plecs-state-flow/940/3 "2021-01-20T10:24:26Z")

</div>

Thanks Manu Parimi,
