Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

obtaining encoder counts after 2ms

I need to obtain the velocity of the wheels which is attached to a rotary encoder. Currently i am using the DAQ6024e card.

i set my encoder to initial count of 1000000 and i want to read the counts after every 2ms.

I know how to obtain the counts from the encoder but how do i read the counts after every 2ms?

can someone advise me on how to program to read the encoder counts after every 2 ms?

By taking the difference in the counts every 2ms, i will be able to obtain the velocity by dividing the counts by 2ms.

can someone kindly advise?

regards,

Leroy
0 Kudos
Message 1 of 3
(3,261 Views)
Hello Leroy,

You can obtain the counts every 2 ms by using a buffered, counter operation. I would suggest to use the 'Measure Buffered Period (DAQ-STC) VI' which is a shipping example within LabVIEW. For this example, the count will be transferred on every edge of the signal connected to the counter's gate.

You could configure the other counter on the DAQCard to generate a pulse train that has a period of 2 ms and then use the output of that counter as the gate for the counter configured for buffered, period measurements. This should work for you.

I hope this helps.

Regards,

Todd D.
NI Applications Engineer
0 Kudos
Message 2 of 3
(3,261 Views)
what if i am using labwindow?

is there a sample program for labwindow to perform the above function?
0 Kudos
Message 3 of 3
(3,261 Views)