06-20-2011 12:15 PM
Hello,
I have a NI BNC-2090 board that I use to interface with a multimeter (which I get my data from) and an ion gauge (which needs to have its filament current regulated and held constant). I have a VI which I've written that performs both the data acquisition and current regulation, but it can only do one of these tasks at a time, which is undesirable because the filament current drifts when the data is being gathered.
In order to prevent the filament current from drifting, I want to create two standalone programs that I can run in parallel, so that the filament current can be regulated continuously and so that data can be acquired on demand. I've attached two programs which I've made to do this.
Each of the attached programs does its job very well. The problem I have arises when I try to run them both simultaneously. The error I get is Error -50103, which tells me the specified resource (my board, if I understand this correctly) is reserved.
I tried to be a little more explicit in my task creation and I also tried defining global virtual channels in MAX to no avail.
Any help would be greatly appreciated.
Regards,
Ali
Solved! Go to Solution.
06-20-2011 12:56 PM
Did you try doing a search for that error code. The answer to this common mistake is that you have to have a single VI that acquires all of the channels in a single task with a single sample rate.
06-20-2011 03:03 PM
I had searched for Error -50103 on google, but not in the NI forums. Having looked at some of the search results, and having read your answer, I don't see how to implement a fix.
You say I need a "single VI that acquires all of the channels in a single task with a single sample rate," but that ignores my goal of having these two VIs running separately with the capability of running simultaneously. If I interpret that differently, I could read that as creating a subVI in which I create my tasks with all the necessary channels and using that subVI in my two VIs and only reading/writing from/to the necessary channels. Would that work?
Or am I misunderstanding your advice/the problems I saw resolved in the search?
06-21-2011 02:43 PM
Ali,
From reading this Knowledgbase Article, especially case 6, the most important thing is to combine all of your data aquisition into the same task, that way you are not calling into a device that has already been reserved. Also it is probably not a good idea to continously start and stop your task in a loop. This is another thing that can throw this error but I believe the error you are getting is because you are trying to access the device with multiple devices at the same time. You could time it so you release the device by one VI so the other VI can then access it, but not at the same time.
I hope that helps,
Brian P.
06-21-2011 03:06 PM
Brian,
Having all my reads in one task and all my writes in another makes sense, especially after I learned that the board has only one A/D converter.
What I'm struggling with now is how to restructure my set up. Is there a way to share tasks between VIs and keep the VIs distinct like I want so that I can run them individually or together as I need? Or will that requirement force me to incorporate the VIs I posted as subVIs of another VI which passes the same read and write tasks to both subVIs? (If this is unclear, see attached png; the case structures are so I can choose which subVIs run and the while loop is there so I can turn them on and off).
Thanks.
06-22-2011 11:41 AM
Ali,
I would suggest aquiring all of your data first, and then passing the data of each channel into the processing subVI's which you can then turn those on and off. This would be a cleaner approach so you wouldn't be aquiring data for the channels twice and to avoid missing samples.
I hope this helps.
Brian P.
06-22-2011 01:08 PM
@Ali H. wrote:
Brian,
Having all my reads in one task and all my writes in another makes sense, especially after I learned that the board has only one A/D converter.
What I'm struggling with now is how to restructure my set up. Is there a way to share tasks between VIs and keep the VIs distinct like I want so that I can run them individually or together as I need? Or will that requirement force me to incorporate the VIs I posted as subVIs of another VI which passes the same read and write tasks to both subVIs? (If this is unclear, see attached png; the case structures are so I can choose which subVIs run and the while loop is there so I can turn them on and off).
Thanks.
Yes, By adding in a Special type of Action Engine I've dubbed a "Resource Module" as a hardware access layer for yor task. Since the Module is not re-enterant any vi can call the Resource Module without fear of causing DAQmx errors but, the second caller will wait for the first call to finish. Here is an example notice that it keeps the resorurce discriptor (in this case a DAQmx Digital Out Task) on a Shift register to avoid the need for the caller to know what is going on with the resource (saves wires too).
06-22-2011 03:08 PM - edited 06-22-2011 03:09 PM
After further discussing this with my PI and evaluating our needs for our ion gauge filament regulation (fast response to avoid drift in the current), we've come to the decision that it's incompatible with our DAQ needs (1 second snapshots of pressure data from an ion gauge or quadrapole).
We can't satisfy both needs using a single task, which the board requires of us, so we're going to put this on the back burner and focus on other aspects of the experiment.
Thanks for all your input.