LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

NI USB 6210: 2x Quadrature encoders angular position simultaneous acquisition

Dear all,

I am stuck with this programing problem and I can't seem to find my way out. I would really appreciate any help from I can get. So here it is.....

I need to simultaneously acquire angular position of two quadrature encoders using NI USB-6210 DAQ M series card. I need deterministic sampling where I know the exact sampling times, so I can calculate the velocity and acceleration out of the encoder position measurements. Therefore I use buffered (sample clock) position measurement, where samples are acquired using hardware timing. I use external triggering, since internal triggering is not supported.  As external triggering source I use the frequency generator of the counter on the card. I route it internaly to another counter terminal that i do not use (CTRn OUT). I run the frequency generator task with desired frequency, and the task for encoder position measurement, which is externally triggered.

This all works fine when I use CTR0, however when I try to run the same code on CTR1 I get this error message:

Error -89137 occurred at DAQmx Start Task.vi:1
Specified route cannot be satisfied, because it requires resources that are currently in use by another route.

Source Device: Dev1
Source Terminal: 80MHzTimebase
Destination Device: Dev1
Destination Terminal: Ctr1Source

Required Resources in Use by
Source Device: Dev1
Source Terminal: PFI6
Destination Device: Dev1
Destination Terminal: PFI4

Task Name: _unnamedTask<4BF>

I have no idea why I get this message, so please, help me out here!

Jernej




0 Kudos
Message 1 of 5
(3,634 Views)
Hey,
I have two quadratic encoders too, and I had a problem with noise, which was perturbating the hardware timing.
I solved my problem by using an internal clock with a high speed ( 4 time shannon), and then, I choosed the lines that I wanted by creating my own software trigger on the two signals of my quadratic coders.
I don't know if it's clear... Smiley Sad
Hope it helps you.
Best regards,
Vincent
V-F
0 Kudos
Message 2 of 5
(3,610 Views)
Hey!

I found the solution. Instead of routing frequency generator output terminal to one of the PFI terminals (for external triggering) using DAQmx Connect Terminals.vi, I used  Counter Output:Pulse:Output Terminal Property to route the generated triggering pulses to one of the PFI terminals. Now the code has no problems running with both encoders. I attach the new code bellow.

However, I am still interested why the previous case with DAQmx Connect Terminals.vi doesn't work. I would appreciate if someone can help explain why the error occurs.

Thank you all!

Jernej
0 Kudos
Message 3 of 5
(3,599 Views)
Hi JernejPerhavc,
 
The reason why you were unable to use counter 1 is because certain routes will reserve certain internal subsystems. In order to see which routes are available on your device, you will need to go into Measurements & Automation Explorer (MAX), click on your device and select the device routes tab. The meaning of the route colors is as follow:
  • Green routes are direct route that are wired on the device.
  • Yellow routes are indirect routes, which means that a subsystem will be used when this route is used.
  • White routes are not available on the device.

From this you can see that any PFI to PFI routes will reserve counter 1 and therefore, this is the reason why you were not able to run your counter application. Also, you will note that you can route the FrequencyOutput to any of the PFI lines without using any subsystem, which you have already done.

I hope this helps,

S_Hong

S_Hong
National Instruments
Applications Engineer
Message 4 of 5
(3,576 Views)
Thank you very much for the reply. I was looking at the colors in MAX but was not sure what they mean. Now it all makes sense.

Thanks again!

Jernej
0 Kudos
Message 5 of 5
(3,563 Views)