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
Best regards,
Csaba