# Encoder\_get\_tick\_count() function not working

**URL:** <https://forum.universal-robots.com/t/encoder-get-tick-count-function-not-working/24538>\
**Category:** Technical Questions\
**Created:** [October 20, 2022, 2:34pm UTC](https://forum.universal-robots.com/t/encoder-get-tick-count-function-not-working/24538 "2022-10-20T14:34:23Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![csaba.mucsi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/csaba.mucsi/32/277_2.png) [@csaba.mucsi](https://forum.universal-robots.com/u/csaba.mucsi)\
**Post date:** [October 21, 2022, 10:15am UTC](https://forum.universal-robots.com/t/encoder-get-tick-count-function-not-working/24538/2 "2022-10-21T10:15:58Z")

</div>

Hi Pedro, have you initialized the encoder? You need to initialize it once before you can actually get the values from it.  
Example: decode hall encoder quadratic signals on digital input 8 and 9:  
encoder\_enable\_pulse\_decode(0,1,8,9)  
…  
var\_1=encoder\_get\_tick\_count(0)

You might get incorrect encoder values after emergency stop, see my previous topic here: [Pulse decoder function encoder\_get\_tick\_count is drifting away after emergency stop or robot arm poweroff](https://forum.universal-robots.com/t/pulse-decoder-function-encoder-get-tick-count-is-drifting-away-after-emergency-stop-or-robot-arm-poweroff/21030)

Best regards,  
Csaba

---

_[View the full topic](https://forum.universal-robots.com/t/encoder-get-tick-count-function-not-working/24538)._
