06-29-2017 09:50 AM
I'm trying to do something that should be fairly simple, read three AI channels each on three tasks. The task LBHamps is on a cDAQ 9219 module channels 0, 1 & 2. LBHPSIin is on channels 0,1, 2 on a 9201 module and LBHlpm is 3, 4, & 5 of the same module. The problem I'm having is I keep getting an error -50103 "specified resource is reserved" from the last control task.vi of the three to initialize. It doesn't matter what sequence I run them in it's always the last one. Without the control task.vi I get a different but similar error about the resource being reserved.
What am I doing wrong?
Solved! Go to Solution.
06-29-2017 10:44 AM
You can't have multiple channels running multiple tasks with multiplexed DAQ cards. The timing hardware is all in common (shares clocks, triggers, etc.) so all channels must run on the same task. Combine your channels in one physical channel control, set your read VI to read multiple channels and then index your channels out of the 2D array that comes out of the read VI.
See here for how to set up multiple physical channels:
http://digital.ni.com/public.nsf/allkb/A3A05920BF915F1486256D210069BE49
06-29-2017 12:03 PM
So you can't assign different tasks to the same module even if they use different channels? I've got a DIO module that I've got three tasks using it and it works. Of course that's using counters so that might be a different animal. OK I can assign one task to the module and index the data but each of these tasks have a different scale. How can you assign scales to the data if they're all on one task?
Thanks
06-29-2017 12:20 PM
@rtpumps wrote:
So you can't assign different tasks to the same module even if they use different channels.
Most analog input cards/modules use a multiplexer for the ADC. So all channels you want to read from that card have to be in the same task. You are getting the error because the ADC was already reserved.
@rtpumps wrote:
How can you assign scales to the data if they're all on one task?
You can define a scale in DAQmx by the channel. Just create a DAQmx scale and apply it to the channels that need it. Then you do not have to apply any scaling in your code since DAQmx did it all for you.
I also highly recommend using 1 task to read all of your data. It will just make life easier.
06-29-2017 12:47 PM
Ok I'll give that a try. I'm still not up to speed on some of the nuances of LV.
Thanks for the advice
06-29-2017 12:51 PM
There are 4 Counter timing engines and for some modules all counters must be in the same task
06-29-2017 01:19 PM
Thanks, that really clarifies things because I've got 4 counter tasks running on one 9401 module and it works. I didn't know there was a limit on tasks for each module.
06-30-2017 08:11 AM
Crossrulz,
Thanks for the tip. I knew you could assign scales to different channels but I didn't know you could put channels from several different modules in a task. I put all the AI channels on one task and it made the code so much simpler! I've still a lot to learn about LV.