09-24-2011 12:06 PM
On a real time PXI target, I have been unable to access more than one channel at a time. The attached example shows the issue, when the second analog read occurs, I get a "resource is reserved error". This is my first real time challenge and not sure how to proceed. Ultimately I need to read three Analog Input channels and one Analog output channel in the real time loop. Thanks for any assistance.
Solved! Go to Solution.
09-24-2011 12:24 PM
Did you get error -50103?
Search the forums for error 50103 and you'd have your answer.
You need to put both analog input channels into a signal task.
09-24-2011 12:41 PM
Thanks for the quick answer, unfortunately I don't believe putting both analog input channels into the same task will do it... See attached. The ao0 channel is wired to the ai1 channel, but I am getting readings for ai0 which is not wired to anything. I suspect the issue is the 6259 does not do simultaneous reads. How do I deal with that?
09-24-2011 12:52 PM
Yes. You need to put both analog input channels into one task. There is only one clock for reading analog inputs. If you use it for one task, that clock is reserved and the other task can't use it.
What does having it connected to an analog output channel have to do with it? If the ai0 is not connected to anything, why are you trying to read it?
The reason you are seeing something on that channel is that you are seeing the residual value from reading the other analog input channel. When you have an open circuit, the amplifier can't charge or discharge to another value, so you are seeing a ghost of the other channel. Wire the unused analog input to ground and you will see the reading would be zero or very close.
09-24-2011 12:57 PM
"What does having it connected to an analog output channel have to do with it? If the ai0 is not connected to anything, why are you trying to read it?" Because I want to read multiple channels, and will have something connected to it. Just trying to do a simple demonstration of my understanding - or lack of it in this case.
Wiring the channel to ground worked exactly as you indicated taking the reading close to zero.
Thank you for your help and explanation!!
09-24-2011 01:47 PM
More frustrations.... When I used suggested approach in my application... I do not get any errors BUT I do not get any data at the NChan 1Samp read either..... Any suggestions?? Screen shot of appropriate portion of vi attached....
09-24-2011 02:13 PM
Found the problem in another part of the vi - the multiple read is working!! Thanks again.
09-24-2011 02:17 PM
Get rid of the shift register on the error wire. If you ever do have an error, then it will perpetuate forever and will keep the DAQmx Read from executing.
I have no idea why it would be working fine before and would not be working for you now.
Do you still have the analog output wired to analog input 1, and analog input 0 wired to ground? Right now your index array is getting the data from analog input 0. Are you actually reading nothing? Or are you reading zero?
09-24-2011 02:21 PM
Getting rid of the shift register on the error wire really helped!! The read is working correctly now. Thanks again for the timely and accurate assistance!