01-27-2017 07:14 AM
Hi all,
I have an NI 9211 on a cDAQ 9172 to read-out 4 thermocouples: 1x K-type and 3x J-type.
When I try to read out multiple thermocouples simultaneously, I get an Error -200022, "Resource requested by this task has already been reserved by a different task.". No other VI's are running, double-checked that I did not select double channels, PC rebooted etc.
The minimal working example added already produces this error for me. I even tried switching the channels to the three J-type thermocouples, same error.
In a previous version of the VI I was able to monitor all four thermocouples simoultaneously using the DAQ Assistent. Now that I rebuilt it with single DAQmx components, I get this error. Any ideas what I'm missing here?
Solved! Go to Solution.
01-29-2017 08:08 PM
Hello,
You cannot run multiple tasks on certain modules, I believe some digital modules may work with counter tasks. What you should do to achieve your needs is channel expansion which I have linked below:
http://digital.ni.com/public.nsf/allkb/B7E7C6A92467E5438625792E0067ED80
Then modify your DAQmx read for multiple channel and multiple samples. The next issue you would find after this is that you haven't configured sampling, after 1000 samples I would think it would error that the task has completed.
I have modified the VI to have one singular task and set for hardware timed sampling to the specified rate for continuous acquisition.
Best regards,
Ed
01-30-2017 02:13 AM
Thanks for the reply, Ed. Very interesting this.
I understand the Channel Expansion mode, but how would this cope with two types of thermocouples?
The strange thing is, in my example VI it can read out 2 of the 3 thermocouples simultaneously. The K-type is on "a0" and the rest is J-type. It can read out "a0" and "a2" simultaneously no problem, but not "a0" and "a1". I assume this has something to do with a division in the circuitry of the 9211, but this is not mentioned in the datasheet. And interestingly, the read out of all four thermocouples of mixed types does work via the DAQ Assistent.
I'm very curious what the cause of this behaviour is. This would also mean either getting a different TC board, or swapping out the thermocouples.
01-30-2017 03:23 AM
Hello,
I've had a similar query in the past, you can use Create Channel twice for the same task and configure for two thermocouples this way. drop down another Create Channel and wire the task wire between the first Create Channel and the Timing VI, then configure for your second thermocouple.
This should work, let me know if you have any issues.
Best regards,
Ed
01-30-2017 08:44 AM
Thanks again Ed.
I followed your link and suggestion, and I don't get any errors. Unfortunately, I also only see one channel in the output monitor with a strongly fluctuating signal. It fluctuates between 23-25 *C, so it's not just digital noise.
It should work like this, right? NChannels, 1 Sample per channel per timepoint. See attached the VI as it is now.
01-30-2017 10:32 PM
Hello,
I'm not sure why you changed my modifications so extensively, you followed the instructions for task channel setup correctly except needed to specify still continuous sampling, additionally to this please look into data flow as I have the wire in of resetting the graph history prior to start task so that the user is always seeing fresh data each acquisition, you have not enforced it sufficiently to do so when wiring it into the end case.
Additionally to this it is prudent to call Start Task and gather NChannel and NSamples so as to not incur a buffer overflow. Then performing Tranpose 2D array as the Graph will otherwise see the data in the wrong way as in 3 samples, 1 channel rather than 1 sample, three channels (if this is indeed the case that we are receiving NSamples > 1).
Attached find the changes which I have tested with a simulated 9211.
Best regards,
Ed
01-31-2017 02:31 AM
My apologies, I overlooked the VI in your first reply. Unfortunately I cannot open your VI's; it's in LV 2014 and I am still on 2013.
Can you maybe save it for 2013 and re-upload it? Thanks for the help, much appreciated!
02-01-2017 03:11 PM
Hello,
Please find attached, saved for LabVIEW 2012 to ensure that it will work with 2013.
Best regards,
Ed
02-02-2017 04:51 AM
Thanks Ed. It worked right away. It's a nice "trick", taught me some more about multichannel tasks.
By the way, is it always necessary to use the "Start task"? I never do this actually and it works fine for single tasks.
02-02-2017 04:54 AM - edited 02-02-2017 04:55 AM
Hi,
Brilliant, I'm glad I could be of help and it's good to learn new things.
Yes Start Task is not necessary for any form of task as far as I am aware in DAQmx.
Best regards,
Ed