08-12-2011 09:55 AM - edited 08-12-2011 09:58 AM
Hello,
I'm using a cDAQ 9172 with the following modules:
9237 to measure force
9205 to measure another analog in
9263 to output an analog voltage
9472 to control a few relays.
I've started with simple program to setup the channels and run but I get the message that one or more resources is in use.
Attached are two pictures. One is of the main VI where I get the error. The second is the subvi that sets up the channels.
I only want to have access to one or more of the channels for single point reads/writes in the main loop.
Any ideas what I'm doing wrong?
Thanks
Solved! Go to Solution.
08-12-2011 10:12 AM - edited 08-12-2011 10:15 AM
Hi Jeff,
The cDAQ-9172 only has one timing engine per subsystem. You are trying to use the 9237 and 9205 at the same time in separate tasks which causes the reservation error. The work around is to add both sets of channels to the same task. Just wire the task output of one create channel into the task input of the other. Read will return data from both channels. It sounds like you don't want that but you can always ignore the data you don't care about.
Case 6 of this KB describes the issue.
08-12-2011 10:18 AM
Thanks for the response Mark! I think I understand what you mean. If I wire two create channels together I will get one task, am I correct to assume that when I read the data, it will be an array of those channels?
So I won't need two reads, just one? Does this work the same for output? Can I mix input with output channels into one task?
08-12-2011 10:25 AM
You are correct. You'll have one task and reads will return an array of channel data. You don't need to call read twice. You will need to use one of the multi channel reads like Analog 2D DBL (N Chan N Samp) if you aren't already.
The same idea works for output. You can call create channel on multiple analog output channels all in the same task and use an N Channel Write.
Tasks have to contain the channels of the same type. So a task must be all analog input, analog output, digital input, or digital output channels. You can't mix and match.
08-12-2011 10:27 AM
Excellent Mark thanks you got me on the right track!