LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Starting an array of DAQmx tasks throws error 50103 on start

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

0 Kudos
Message 1 of 6
(2,850 Views)

You are not clearing the DAQ tasks when you are done with them.

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 6
(2,844 Views)

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

0 Kudos
Message 3 of 6
(2,832 Views)

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...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 4 of 6
(2,817 Views)

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

0 Kudos
Message 5 of 6
(2,811 Views)

Duh... I just noticed that the first two cases are both trying to access the same channel (Dev2/Ai0).

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 6 of 6
(2,782 Views)