LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can I (and if so, how would I) connect two encoders (one linear and one angular) to the same chassis (NI 9401) and get their respective NI MAX tasks to run as simultaneously as possible?

Solved!
Go to solution

Sorry, but I am still rather new to LabVIEW and NI MAX. I connected both devices (a linear probe and an angular encoder) to my NI 9401 chassis. I figured out how to create tasks for each and get continous samples readings from each. When trying to run both in LabVIEW, I get the error saying that I cannot run multiple tasks at once. It suggests the Control Task VI, but I did not see any help in that. Any advice?

Here is some general information, whatever it is worth: Both encoders are operating off of the same clock source, PFI4, which to my knowledge corresponds to CTR 1 A, where the angular encoder's A signal is wired in. The linear's physical channel is ctr0 and the angular's is ctr1.

Thank you very much for taking the time to look at this and help me out!

0 Kudos
Message 1 of 15
(4,039 Views)

1. Keep your subject line short:  making readings on CompactDAQ 9410

 

2. NI 9401 is not a "chassis". It is a NI CompactDAQ DIO module

 

3. There are examples that are installed when you install NI-DAQmx.

 

 

0 Kudos
Message 2 of 15
(4,026 Views)

Ohhh so the 9181 is the chassis, right? My bad. Sorry about the subject line. And there are examples that covered this?

Edit: I think I found the examples by searching through the folder... but I cannot figure out how to open the files (wow, what a n00b I am)!

 

I guess the question currently boils down to this? Can I read from a linear and angular encoder simultaneously within the same task?

0 Kudos
Message 3 of 15
(4,019 Views)

@JosephQ wrote:

Can I read from a linear and angular encoder simultaneously within the same task?


Yes.

0 Kudos
Message 4 of 15
(4,006 Views)

Thank you. So now the question would be: How?

0 Kudos
Message 5 of 15
(4,003 Views)

A more precise answer to your question would be YES and NO.

 

NO you can't have linear and angular position in the same Task. And you already saw that you can't have two task that use the same ressource at the same time.

YES a workaround is two create an Edge count Task and compute the linear and angular position from the count value but it is more work.

 

The ideal solution would be to have a second chassis and module and synchronize them.

 

Ben64

Message 6 of 15
(3,987 Views)

I think we were aiming to save money and use the same module for both the linear and angular... I created a task for the edge count (using the same configurations for samples/clock/ctr as the angular encoder). Do you have any more details on that idea, or other ideas for a solution? Thank you for your time and thoughts!

0 Kudos
Message 7 of 15
(3,978 Views)

Use Distance/Pulse and Angle/Pulse to convert the count to distance and angle. Note the everytime you start the Task the count resets to 0.

 

Ben64

Message 8 of 15
(3,967 Views)

So if I go the Edge Counter route, is there any way for the task to figure out direction of the encoders? It looks like my options are always counting up or always counting down whenever the encoder is read... For my application, I need it to read when the linear encoder goes in and when it goes out... Am I doing something incorrectly with it?

I am using a probe to measure the contour of a part, and using a motor to spin the part, with one encoder measuring the angle of the motor and the other measuring the displacement of the probe.

Also I am still not seeing a way to simultaneously read both devices in NI MAX... I cannot use two counter inputs from the same device at once in the same task it seems.

0 Kudos
Message 9 of 15
(3,952 Views)

Hey JosephQ,

 

In case you haven't seen it yet, here's a tutorial about how to take Encoder Measurements using the 9401:
http://www.ni.com/tutorial/7109/en/

Additionally, section 5-5 of the user manual goes in to detail on how to measure direction using a DIO module on the 9181.
http://www.ni.com/pdf/manuals/372780h.pdf

Tanner B.
Systems R&D Engineer - Aerospace, Defense, and Government
National Instruments
0 Kudos
Message 10 of 15
(3,915 Views)