LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

"The specified resource is reserved" in DAQ error

Dear all,

Earlier before I posted a thread on "stop error caused by device driver?". The problem was partially solved, however, new problems start to come up.

Basically the problem is that I have an PXI-6115 DAQ card, I used its two output channels to control my scan mirrors (by send two sawtooth waveform out). Everytime I finished one scan cycle, I need to put the mirror back to its originial position by using the same two output channels (sending two single voltage out). Since these two tasks are of different type, I created two different tasks: scanTask and parkTask. Then I do the following as suggeted by TheWoost:

1. create and configure task handles for scanTask
2. create and configure task handles for parkTask
3. start scanTask and stop after finished one scan cycle
4. start parkTask and stop after returning to orginial position

Then repeat 3 and 4. The problem comes in when I get to step 4: "Function DAQmxStartTask: (return value == -50103 [0xffff3c49]). The specified resource is reserved. The operation could not be completed as specified. Task Name: _unnamedTask<1>  Status Code: -50103"

I browsed through the knowledge base and realized that I cannot have two tasks using the same output channel, even though only one of them is active. If I clear scanTask after stopping it, then recreate it when I need it, that would be fine. However, that would be too much trouble. I was wondering if my understanding is right. If yes, is there anyway to get around it? I need to run scanTask and parkTask in a loop and it would be hard to recreate the task everytime.

Any input is highly appreciated. Thank you for your time.

Best Regards,
Dan
 
0 Kudos
Message 1 of 8
(15,874 Views)

Hi Dan,

Your understanding of the problem is correct, if the resource i.e. the channel is in use then another task cannot access the resource at the same time. Would it be possible to include your code on the forum and I can take a look at the current layout and exhaust all possabilities for running 2 tasks at the same time.

Thanks,

Regards,

Applications Engineer
0 Kudos
Message 2 of 8
(15,741 Views)
Dear Rob,

Thank you for offering your expertise on this problem. I would be happy to include my code here. Right now I take the alternative approach by  clearing each task after it's finished and then recreate them. It works fine but brings in complexity and inconvenience. If you can get away with this, that would be great.

The code is an except from the whole program. Since I changed it back and forth so many times, there might be some errors. The main part is focusButton and stopButton. When I hit focusButton, the two mirror outputTask are running. When I hit stopButton, I stop these tasks and call parkLaser function, which assign the outputTask to do single point output. Then I can do focus again. This is the part that gives problem.

If there is anything that is unclear, please let me know.

Best,
Dan
Download All
0 Kudos
Message 3 of 8
(15,735 Views)

Hi Dan,

I think the issue may be in the order in which these items are executing. It is imperative that the first task be stopped before the second task begins.  I have tried this setup in LabVIEW with success so I know that it is possible for the driver to perform this action. I encountered errors when one task was called before one of them was stopped. I am not certain but it sounds like this may be the case with your code. You may try to create a stop button and a park button to verify that the task has stopped and then begin the park process. I hope this helps.

JaceD
Signal Sources Product Support Engineer
National Instruments
0 Kudos
Message 4 of 8
(15,703 Views)

Hello,

I am getting the same error, but I can't follow what you did to fix it. I'm trying to output one of three signals on one channel of a USB6363, and output a constant 5V on another output channel. I attached my code if anyone can look at the organization and suggest fixes.

Thanks!

0 Kudos
Message 5 of 8
(12,921 Views)

I am getting the same error in my program. In this program I have a couple of timers that update information on the user interface. I have one task that reads a few channels (Reference Sample) and a second Task that reads a few other channels (Power Supply Status). Both use similar code and configuration. The first Task is called on a Timer Elapsed to update the current status of the system and succeeds every call (reads one point on all channels). The second Task succeeds sometimes but throws the "NI Platform Services:  The specified resource is reserved. The operation could not be completed as specified.\n\nTask Name: _unnamedTask<17>\n\nStatus Code: -50103" exception frequently as well. It is also called on a Timer Elapsed and by UI updates. How do I avoid this exception?

0 Kudos
Message 6 of 8
(12,126 Views)

I'm getting the same error but can't seem to figure out what's wrong with it. I only get this error when I put the 1channel VI in to the 4.21.15 VI. PLEASE HELP!

0 Kudos
Message 7 of 8
(10,501 Views)

@cakFSU wrote:

I'm getting the same error but can't seem to figure out what's wrong with it.


What's wrong:

- this thread is 7 years old... Smiley Indifferent

- this forum is about CVI, not LabVIEW Smiley Wink

 

So the suggested solution is to post your question in the LabVIEW forum Smiley Happy

0 Kudos
Message 8 of 8
(10,495 Views)