Motion Control and Motor Drives

cancel
Showing results for 
Search instead for 
Did you mean: 

7334 flex_reset_encoder() seems to have no effect on the encoder

I amusing a NI-7334.  I have two THK linear encoders connected to it.  I can read the encoders OK, but I cannot seem to reset them.  When I start my application I call:

status = flex_reset_encoder(BOARD_ID, NIMC_ENCODER3, 0, HOST);

status = flex_reset_encoder(BOARD_ID, NIMC_ENCODER2, 0, HOST);

I then read the encoder vale and it has some valeu other than 0.

I would expect this to set the encoder value to 0.  This does not seem to have any effect.  I tried reseting them to a value of 100 and still no effect.

Does anybody have any thoughts?

Thanks,

Chris

0 Kudos
Message 1 of 5
(3,777 Views)
Chris,

have you read this part of the documentation for flex_reset_encoder?

The Reset Encoder Position function resets the position of the selected encoder. You can reset position to zero or to any value in the 32-bit position range. Normally, this function is only used on independent encoders that are not mapped to axes. For encoders mapped to axes, you must use the Reset Position function instead.

Please let me know, if this doesn't help you to solve the problem.

Best regards,

Jochen Klier
National Instruments Germany
0 Kudos
Message 2 of 5
(3,776 Views)

Jochen,

Thanks for the response.

I did see that in the documentation.

I am running stepper motors in open loop mode.  The encoders are behaving as independant encoders.

 

Chris

0 Kudos
Message 3 of 5
(3,775 Views)
Chris,

even if you run the stepper in Open Loop mode this doesn't mean, that the encoder isn't mapped to the axis. In MAX you will have to set the Feedback Type explicitely to "None" to unmap the encoder from your axis. If the Feedback Type is set to "Encoder", the only way to reset the encoder is to use flex_reset_position().

Jochen
0 Kudos
Message 4 of 5
(3,770 Views)

That did it.

 

Thanks

0 Kudos
Message 5 of 5
(3,744 Views)