Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I use daqmx to get encoder direction/count on M-series board?

I have an incremental dual channel  encoder from Rotalink. I want to take angular postion and angular speed from this encoder. My NI DAQ card is PCI 6221 which belongs to M series. First, soft-timing was used to get anuglar postion and sampling rate is set at 1Hz. The vi program works well. However, it does not produce  good results when the sampling frequency is increased to 100Hz. So I turned to hardware-timing. The example, "Find example>> Hardware Input and Output>>DAQmx>>Counter Measurements>>Position>>Meas Angular Pos-buff ext Clk.vi" gets the readings. A function generator which can produce pulses at the frequency rang from 1Hz-1Mhz was wired to PFI9 in accordance with "

You need to find your PFI pin numbers to know what to wire A,B and Z to on your m-series board, to do this go into max right click NI-DAQmx Tasks click Create New DAQmx Task >> Counter Input >>Position>>Linear, and setup the task for your measurement. It will tell you what the PFI lines are. You then need to look at the wiring diagram and connect it to the correct pins.

" as an external clock. The channel A and B were wired to PFI8 and PFI10 respectively. However, it still gives errors like 200284. Comments are grealy appreciated!
0 Kudos
Message 1 of 2
(3,447 Views)

Hi Zibin

 

I have been trying to work out what is not working I need some more information

What frequency is your function generator actually generating?

What have you set your time out value to?

What exact errors are you getting and when do you get the error?

 

What would really be helpful is if you could send me your code because by the sound of it, it should just work the card is more then capable of doing what you want so chances are it is the code.

 

Regards

 

Tim M

NI UK

0 Kudos
Message 2 of 2
(3,433 Views)