Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

NI 9401 edge counter mulitple samples

Solved!
Go to solution

Trying to use edge counters in the NI 9401 module in cDAQ9174 chassis, LabVIEW 2016.  Want to read single channel, multiple samples from the module.  I get error -200284, which is "Some or all of the samples requested have not yet been acquired."  I am able to get single channel, single sample working, so I believe the hardware is functioning. Anybody see what I need to change to get it working?

0 Kudos
Message 1 of 4
(3,183 Views)
Solution
Accepted by topic author rsohaney

Sounds like a timeout error.  Let's break it down -- you're trying to read 25 samples at a time, using an AI Sample Clock signal from your chassis, with a timeout of 2 sec.  You show no AI task in the posted code.

 

1.  Do you run an AI task with a sample rate of 12.5 samples/sec or more?   If not, that would cause this error.

 

2. Do you start the posted program before starting a different program with the AI task?  If so, you'll get this error unless the other program has acquired at least 25 samples within 2 seconds of starting *this* program.  (Give or take, as there's a little unknown execution time from program start until sampling starts.)

 

3. Do you have an AI task already running before starting this task?   That should work.  Unless...

 

4. Do you stop the AI task while this program is still running?  That would produce this error too.

 

 

-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.
Message 2 of 4
(3,165 Views)

Thank you, Kevin.

You are correct, I do not have an AI task.  So, that explains why my posted code is not working.  I did try many other clocks (80 MHz, 20 MHz, Onboard clock) and all gave the same timeout error.  The list of available clocks is long.  Sorry, it is not obvious to me which clocks are available within the cDAQ 9174 and which ones need a task to get them started.  I do have an NI 9234 module that I will use for the AI task.  But, it would be helpful to my understanding if anyone can inform me if there is a clock to select that would allow my posted code to run without the timeout error.

 

- Rich S.

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

I have limited experience with cDAQ counters.  Over in the desktop world, many devices cannot derive their own sample clock to use for buffered, hw-timed counter input tasks.  On those devices, counter tasks must get their clock from somewhere else -- such as the sample clock from an AI task or from a counter pulse train output task.

 

However, kinda recently I was involved in a thread where it *appeared* that a cDAQ chassis internal 100 kHz timebase could be used as a sample clock for counter input tasks, but was only able to try it for a simulated device that was different from yours.  Read the thread and try out the shipping examples as suggested there to test the behavior on your real hardware.

 

 

-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 4 of 4
(3,145 Views)