04-16-2013 12:44 PM
Hello,
I am currently working on a Senior Design Project where I have to measure torque, RPM, pressure and temperature. I am using strain gages, a Hall Effect Sensor, pressure sensor and thermocouples to obtain these readings. A myDAQ collects the RPM and pressure readings while a cDAQ collects the torque and temperature readings with the NI 9237 and NI 9211 modules. I created LabVIEW VIs for each sensor and they work. The problem I am having is when I try create a VI with DAQmx that reads all these sensor values simultaneously. The VI that I have attached randomly displays one of the measurements while all the other measurements remain blank. How should I edit my VI so I can display all my readings at once?
Solved! Go to Solution.
04-16-2013 12:57 PM - edited 04-16-2013 12:58 PM
You can form all of your cDAQ readings into a single DAQmx task. Do the same for the myDAQ channels. On the read side, you just read multiple channels. You can then use the Array Index to separate your channel data and do whatever calculations you need.
04-16-2013 08:07 PM
Okay, I did exactly as you said and formed all my myDAQ and cDAQ readings into a single task. I used index array to separate my channel data. However, when I run it I still do not see any data displayed. Did I forget something in my VI or can I only do one task at a time with the 30 day version of LabVIEW? Thanks.
04-16-2013 10:25 PM
Any errors on the error wire coming out of the DAQmx Read?
04-17-2013 12:12 PM
No, I do not get any reported errors when I run my VI. On the front panel time across the graphs runs, but there are no measurements displayed. The numerical indicators on the front panel also show NaN. When I ran another VI that just took one thermocouple measurement, I noticed the same thing happened if I forgot to select the module type in the DAQmx physical channel on the front panel. However, for this VI I selected all the modules for my DAQmx physicals channels, yet I still have the same problem. Is there a specific way I have to order the measurements in the VI? For instance, do I have wire all the measurements taken by the cDAQ before my myDAQ measurements? Or could it be that I need to change the sampling rate on the Sample clock?
04-17-2013 05:32 PM
I will add a general error handler to my VI and reconnect my modules and see what errors I get.
04-18-2013 03:05 PM
The error I got when I used the simple error handler was Error 200558. So I read up on that error and it says one task cannot contain multiple independent devices. Thus, I have to create a task for each independent device. How am I supposed to set up another task? Do I just link all my DAQmx Creates for the cDAQ to my DAQmx Read and then link all my myDAQ DAQmx Creates to another DAQmx Read and run them in parallel or is there another way to go about this?
04-18-2013 03:22 PM
Yes. Create multiple tasks where all of the channels that are common for a particular device are grouped into the same task. Then go and run those tasks in parallel. Do you need precise synchronization between channels in the different devices? If not, then the described method should work just fine. If you need precise synchronization, then things would get more complicated, but might not be impossible.
04-18-2013 06:54 PM
Thanks for all the help. It worked like a charm. The synchronization looks good enough for my Senior Design project.
04-18-2013 06:57 PM
Oh yeah, this is how I set it up in order to get it to run.