Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Resource reserved error on adding 2 counter input channels from NI 9361 cDAQ module

Hi,

 

While working with NI counter input channels in the past, we have been advised to add channels to their own tasks. 2 counter input edge count channels thus require 2 tasks. However, while working with an NI 9361 module (on a cDAQ-9188 chassis), I notice the following error: 

 

DAQmx Error: The specified resource is reserved. The operation could not be completed as specified.
Task Name: _unnamedTask<1>

Status Code: -50103

 

I have attached my C code to reproduce the issue. Is this different from other devices? Should I be using a different approach in this case. Please let me know your thoughts.

 

Best,

Varun Hariharan.

MathWorks

0 Kudos
Message 1 of 4
(3,923 Views)

Hello vharihar, 

 

Yes you are correct. If you have 2 counter input channels you will need to have two separate tasks. This is the case for all devices using DAQmx functions. This error means that one of your counter input resources in being used by something else. A few possible reasons could be the following:

 

- Do you have a test panel open?

- Do you use the resource in another location without properly closing it?

- Is there other code that is running using the channel?

 

Here is an article that describes the error in a little more detail. 

 

Causes of NI-DAQmx Error -50103: "The Specified Resource is Reserved

http://digital.ni.com/public.nsf/allkb/485201B647950BF886257537006CEB89

 

Danielle

National Instruments

 

0 Kudos
Message 2 of 4
(3,873 Views)

Hi Danielle, 

 

Thanks for your reply. I do not have the resource reserved anywhere else. I went through the list of possible scenarios here and I do not think they apply. I run this code as soon as I start my computer. No other application is using this task. Since this is a edge counter operation, only 1 counter is used. Also, I notice this also if I update my code to use different counters (for example, ctr0 and ctr3).

 

Note that I observe this behavior on NI 9361 and not any other modules that support counter input operations. 

Please let me know your thoughts.

 

Thanks,

Varun Hariharan

MathWorks

0 Kudos
Message 3 of 4
(3,858 Views)

Varun, 

 

Please take a look at the article below. If you look at the counter input task on both the hardware and software timed tables, you can see that this device only supports a single task. If you need to use multiple counters you need to add all the required counters to the same task. 

 

How Many Different Tasks Can Concurrently Run on a CompactDAQ Chassis Gen II?

http://digital.ni.com/public.nsf/allkb/5E0B829E50ADE1BC86257AC50062B2D2

 

Danielle

National Instruments

Message 4 of 4
(3,826 Views)