02-15-2024 08:46 PM
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.
Any help or insight would be greatly appreciated.
Solved! Go to Solution.
02-15-2024 09:50 PM
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
02-16-2024 04:38 PM
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)
02-16-2024 04:46 PM
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).
02-16-2024 04:54 PM
Synchronizing Two Counter Tasks in NI-DAQmx
02-17-2024 04:19 PM
That link is for continuous pulses whereas I am having the problem with finite (>1)
02-17-2024 08:12 PM - edited 02-17-2024 08:30 PM
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:
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.]
02-18-2024 07:01 PM
With the AI method, is the signal generation simulated and there is no actual output pin creating a physical pulse?
02-18-2024 07:11 PM
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
02-18-2024 07:47 PM
When I use these settings for the counter i get the same error for 2 pulses
and when i do a single pulse, i dont get the error but it doenst count