How to Zero/Reset the NEO Encoder in LabVIEW?

Does anyone know how to zero/reset the NEO encoder in LabVIEW?

I haven’t been able to find it in the API. This post talks about it, but doesn’t say what it’s called or where it is.

In Java/C++ the way to do it is setPosition(0) on the CANEncoder object; it really is a bit confusing. I assume that a parallel SetPosition VI (or whatever the terminology is) exists.

2 Likes

Ah! That’s probably it. There is a Set Sensor Position VI (Spark MAX Set Sensor Position.vi):

image

I was looking for a reset VI similar to the WPI_EncoderReset.vi. I’ll circle back to confirm after I test it.

Thanks!

2 Likes

Our test bed isn’t complete yet, so I haven’t had a chance to confirm and circle back. However, a post in another thread inadvertently addressed my question. @Johnynho’s image below shows the Set Sensor Position VI set to zero with a good way of using a Boolean global variable to reset the encoders.

1 Like

Circling back. Setting sensor position to 0 is the way to do it.

Although, I’m still unclear how to tell which CAN ID is which Motor reference (Motors[][0], [1], [2], …) Is there a convention? Because right now with our code, it seems the “leader” controllers are [0] and [1], regardless of CAN ID.

That’s the convention for the Drive vi’s: left,right,left,right with the first motors on a side being the leader.
MotorOrderComment

1 Like

Hah, love a call-back!

That’s good to know. Thanks Mark!