Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem using single counter on NI9411

I'm trying desperaterly to get 3 Period measurements on a single 9411 module.  I'm measuring ranges from 0 - 5000 hz, I'm able to do this accurately using the high frequency, two counter period measurement method, for two inputs if I read just counters 0 and 2;    What i would really like to do is to get it to work with the low frequency single counter as it appears channel 1 and 3 are not available in this mode in the high speed mode.   What is the minimum period for the low frequency counter, nothing is defined in on line or in the manuals, as to the range of the low frequency?   Even in Measurement Explorer I can't get one low frequency channel to work, I keep getting an error "specified operation did not complete, because of specified timeout expired.

0 Kudos
Message 1 of 5
(5,215 Views)

Applieddesignaz, 

 

Have you seen the following example? 

 

Measure Digital Period - Low Frequency with One Counter - https://decibel.ni.com/content/docs/DOC-12160

 

What frequencies are you attempting to measure and in what channels? 

 

Will M.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 5
(5,196 Views)

I just tried the exact copy of the example you referenced, only updating the device to point to the 9411 device and it also did not work with the option selected of single frequency counter.   I changed the selection to 2 counters and it read exactly with out error.    Looks like there is something wrong with the Cdaq driver too me, as I also have a module 9437 that also exhibts the same symptons 

0 Kudos
Message 3 of 5
(5,185 Views)

I came across the following document that seems to provide some of the information you're requesting. 

 

Error -200474 With Digital Frequency Example VIs Modified for Continuous Acquisition:  http://digital.ni.com/public.nsf/allkb/4E017925BDF2DC2D862572E6007C9594

 

Have you tried this workaround? 

Will M.
Applications Engineer
National Instruments
0 Kudos
Message 4 of 5
(5,171 Views)

The default input terminals are different for the high frequency method (which uses the SOURCE terminal) or the other methods (which use the GATE).  If the low frequency method is consistently timing out, my first assumption would be that the input signal is not wired to the correct terminal (discarding the timeout error as previously mentioned wouldn't help this of course).  You can explicitly define the input terminals to use via a DAQmx Channel Property node. 

 

Anyway... taking a step back for a second, the high frequency method actually produces (by far) the most error of any available methods at the frequencies you are measuring.  You shouldn't be using this in the first place if you care about accuracy.

 

 

The most accurate method for the range of frequencies you are measuring is the sample clocked method, which only requires one counter anyway (plus a sample clock source).  In your case this will work well since you need 3 data channels and you can use the 4th counter for a clock source.

 

The caveat is that an input task will error if it doesn't receive a pulse during the period of the sample clock--it can't really measure "0" Hz.  The workaround is to detect the "0" case and restart the task (the fact that it is required to restart the task is rather annoying I must say).  

 

Try something like this:

 

LowFrequencyCounterRestart.png

 

The sample rate should be low enough so that low frequencies can be measured (and you have time to restart the task between errors), yet high enough so that the read calls return in a reasonable amount of time.  I'd start with 1 Hz.

 

 

Best Regards,

 

John Passiak
0 Kudos
Message 5 of 5
(5,165 Views)