12-18-2012 12:46 PM
Hello,
I am creating and starting a number of tasks from an enum array which will be subsequently used to read data from devices. The issue is that the second iteration of the starting loop throws error 50103 (specified resource reserved).
When I carried out some testing I discovered that the tasks are set up correctly and the error is thrown only on the start task.
I have attached the section of code for reference.
Thanks
Dave
12-18-2012 02:08 PM
You are not clearing the DAQ tasks when you are done with them.
Mike...
12-19-2012 02:14 AM
Hi Mike,
This is only the setup and configuration routine for a producer / consumer acquisition. My producer loop contains the DAQmx read which I plan to pass the list of tasks produced by this vi. I have a clear Task function within a FOR loop which gets called after all acquisitions have been completed.
As far as I know, the task setup routine shown in my previous only adds channels to the task, not moves it to the Reserved state.
I have also tested this without the Start.vi, and I got the same error, but this time within the acquisition loop at the DAQmx Read function.
Dave
12-19-2012 08:20 AM
The problem is that if you call this VI twice without closing the tasks you'll get exactly the error you specified. So the question might be, why are you trying to call this VI multiple times?
Regardless of your overall software architecture, the basic flow should be that you open your DAQ refernces once, uses them over and over, and then when you are all done - close them.
Mike...
12-19-2012 12:06 PM
I have to call the start vi more than once as the tasks are contained within an array. As I understand (but suspect I may be incorrect), that for each case corresponding to the input enum array, the task within that case is started (once) due to the auto indexing of the array.
This is a subVI which is only called once in the application. The output from this should be a list of started tasks which I use in subsequent read operations until the program is complete, where the tasks are then cleared down.
Apologies if I have repeated myself, but I am trying to understand how this works, since what I am seeing does not seem to make any sense to me.
Dave
12-20-2012 09:22 AM
Duh... I just noticed that the first two cases are both trying to access the same channel (Dev2/Ai0).
Mike...