Hobbyist Toolkit

Showing results for 
Search instead for 
Did you mean: 

encoder reset


I read an encoder with a custom command. Now I want to reset this counter, but I can't do it.


Can somone help me?




0 Kudos
Message 1 of 8

Hey Christian!


let me know a bit more about your problema.


would you like to reset the counter variable in LabVIEW or inside your code running customcommand?


Since i can't see wherelse your local varible is been used, i believe you could just send 0 to the variable given certain condition using select function in comparison pallete.
if you want to reset the counter value inside your arduino logic, then you can use custom command to send a value and use the function in your firmware to reset the value.

Jorge Augusto Pessatto Mondadori, PhD
Sistema Fiep
0 Kudos
Message 2 of 8

Hello Jorge,

Thank you for the feedback.

Info about my problem:


The costum command counts the interrupt inputs that are connected to an encoder (Stepps). After a reference run, the counter should start again at zero.

So far I have solved it in such a way that the program is stopped after the reference run, so the counter starts again at zero, but that is not so elegant.


Unfortunately I am not able to send a command to the costum command 

0 Kudos
Message 3 of 8

How can I reset the firmware via labview?

0 Kudos
Message 4 of 8

if you are using arduino, you could use a digital output to send a low signal to your reset pin in your board. remember to work around timeout serial connections, since during boot time it will be unreachable.

Jorge Augusto Pessatto Mondadori, PhD
Sistema Fiep
0 Kudos
Message 5 of 8

In the appendix is ​​the complete code ... Custom Command 4 should set die "counter" to 0 ... unfortunately that doesn't work ... can someone help?



0 Kudos
Message 6 of 8

Hey Christian! don't give up, i want to see all those motors running!


i checked out your code, but i can't see where you insert the lastencoderValueX in your enconder value. i can see a variable named last encoded x or encodervalue x, but you are not using the 0 sent from your code to lastencoderValueX or Y or Z.  am i wrong?

Jorge Augusto Pessatto Mondadori, PhD
Sistema Fiep
0 Kudos
Message 7 of 8

Yes, I hope it will work out the way I want... 🙂


During the initialization I set all values to 0 ... that works great ...
Now I want to use "CostuomCommand4" (CC4) to set all values to 0 at all times ... If I call CC4 via labview, the program stops ...

I was wondering if an additional reset loop is needed or if there is a specific reset command.

0 Kudos
Message 8 of 8