ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Counter Examples Specified Resource Is Reserved

Solved!
Go to solution

I have an NI USB-6251 and have counter 1 PFI13 wired to counter 0 PFI8

I can run the example I found in the help section: Counter - Count Edges.vi

and then start another example I found: Counter - Continuous Output.vi 

and it works

I can run the example I found in the help section: Counter - Count Edges.vi

and then start another example I found: Counter - Counter - Finite Output.vi

and it works ONLY if I have a value of 1 for the Number of Pulses

any value greater than 1 gives me an error: 

The specified resource is reserved. The operation could not be completed as specified. 

cwhw112_0-1708051448921.png

 

 

Any help or insight would be greatly appreciated.

 

 

0 Kudos
Message 1 of 18
(1,728 Views)

I just answered a similar question a few days ago in the Counter/Timer hardware forum.  Check it out.   Just like that poster, you're also using an M-series device that consumes both counters when one is generating a finite pulse train. 

 

(I *think* that behind the scenes when you request just 1 finite pulse, DAQmx actually adjusts your config to generate a single on-demand pulse.  The same as if you never made the call to DAQmx Timing at all.  Count this auto-adjustment as progress b/c back in the early days of DAQmx, requesting less than 2 finite pulses resulted in an error and a dead task.)

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 2 of 18
(1,699 Views)

Could you elaborate a bit more on your suggested solution in the other post - dummy analog / AI? with an example or sketch?

I tried combining them into a single VI but that didnt work.

I get the same error if I use NIMAX to create the pulses and VI to count (and vise versa)

0 Kudos
Message 3 of 18
(1,667 Views)

Im going through the LabVIEW for Everyone book and the end of chapter 11 Activity is to create a VI that generates N pulses and to use the VI created earlier which counts pulses (in that activity the pulses were generated manually by touching the counter's input to the 5V pin <the book said to tap it to the ground terminal but with my device it only worked using the 5V / high).

0 Kudos
Message 4 of 18
(1,663 Views)

Synchronizing Two Counter Tasks in NI-DAQmx

-------------------------------------------------------
Applications Engineer | TME Systems
https://tmesystems.net/
-------------------------------------------------------
https://github.com/ZhiYang-Ong
0 Kudos
Message 5 of 18
(1,661 Views)

That link is for continuous pulses whereas I am having the problem with finite (>1)

0 Kudos
Message 6 of 18
(1,594 Views)

You can check out the use of a "dummy" finite AI task by pairing up 2 shipping examples: 1 for finite AI, 1 for simple Edge Counting.  Just specify the "/Dev1/ai/SampleClock" internal signal as the input terminal for counting.  Like this:

Kevin_Price_0-1708222237796.png

It would work similarly with a finite AO task.

 

 

-Kevin P

 

 

[Edit: ZYOng's link also shows how to share an AI sample clock signal for use by counter tasks.]

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 7 of 18
(1,568 Views)

With the AI method, is the signal generation simulated and there is no actual output pin creating a physical pulse?

0 Kudos
Message 8 of 18
(1,517 Views)

Whether you use AI or AO, it'll be a real task involving real signals not a simulation.

 

With AI, you'll be acquiring samples that you can simply choose to ignore.

With AO, you'll be generating a real signal, but you're always free to define it as a sequence of nothing but 0 Volt values which you don't have to wire to anything.

 

 

-Kevin P

 

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 9 of 18
(1,513 Views)

When I use these settings for the counter i get the same error for 2 pulses

cwhw112_0-1708307251884.png

 

and when i do a single pulse, i dont get the error but it doenst count

0 Kudos
Message 10 of 18
(1,503 Views)