Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Generate pulse train from encoder angular position measurament.

I am trying to generate a pulse train from the angular position of the encoder.  Every time the encoder increments, I would like to get a pulse out.  Is there a way to do this?
0 Kudos
Message 1 of 4
(3,965 Views)
Gene,

A similar question was asked in this forum. Here is what I responded with:

I just thought of something... You could wire the same signals into your M Series' digital lines and run a change detection task. You could then route the change detection event to your AI sample clock. This should give you the behavior you desire. Please post back if you need help implementing this.

This would not use your counters, but it is the only way I know how to obtain a digital pulse on both the rising and falling edges of multiple signals. It does require that you have an M Series board. Would this work for you?

Regards,

Ryan Verret
Product Marketing Engineer
Signal Generators
National Instruments
0 Kudos
Message 2 of 4
(3,950 Views)
I don't know how to make my incremental count into a signal that I can route.  I do have an M series card.
0 Kudos
Message 3 of 4
(3,945 Views)
Gene,

Attached is an example which does what you desire. For a better explanation, please refer to the above thread. Basically, this example performs a buffered counter position measurement. It also detects changes (with the digital input task) on either P0.0 or P0.1 (you will have to wire your quadrature encoder outputs to both the digital lines (P0) and the counter SRC and AUX). On each of these changes, you should get a pulse on PFI0. This same pulse is used to buffer the current position of the counter, which is displayed in a while loop. Please let me know if you have any questions.

Hope this helps,
Ryan Verret
Product Marketing Engineer
Signal Generators
National Instruments
Message 4 of 4
(3,936 Views)