02-27-2015 09:46 AM
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!
Solved! Go to Solution.
02-27-2015 10:10 AM
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.
02-27-2015 10:29 AM - edited 02-27-2015 10:38 AM
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?
02-27-2015 10:49 AM
@JosephQ wrote:
Can I read from a linear and angular encoder simultaneously within the same task?
Yes.
02-27-2015 10:51 AM
Thank you. So now the question would be: How?
02-27-2015 11:30 AM
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
02-27-2015 11:44 AM - edited 02-27-2015 11:45 AM
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!
02-27-2015 12:31 PM
02-27-2015 01:54 PM - edited 02-27-2015 02:00 PM
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.
03-02-2015 08:41 AM
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