From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx Timing ( Sample clock ) error 200077

Hi,

I continue to get this error when trying to setup a counter.  I'm using the USB 6000 board.  I'm trying to count the time between edges using the counter on channel 0.  I have a finite number of samples I'd like to collect.  I keep getting this error no matter why typ of clock setting I try here.  Any help woudl be apprecitated.  Sample snip of my code is here below too.

Rudy_01_0-1651201168485.png

Rudy_01_1-1651201370922.png

 

0 Kudos
Message 1 of 4
(1,021 Views)

While the spec sheet isn't utterly clear on this point, I'll bet that a low-cost device like the USB-6000 doesn't support counter tasks that need a hardware sample clock and a buffer.  (And most other NI devices can't derive their own sample clock *directly* for counter measurements, they tend to need to use some externally-supplied signal as a sample clock.)

 

But all is not lost, hopefully.  Many edge counting tasks can be run just fine without a sample clock or buffer by removing the call to DAQmx Timing.  This is known as "on-demand " or "software-timed" sampling.  The count stays accurate because it happens in the device hardware.  Sampling just controls exactly when and how often your app gets to query that count value.  Often, software-timed sampling (looping over the call to DAQmx Read) can be sufficient.

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 2 of 4
(999 Views)

Hi Kevin,

Thanks for responding.  This is essentially the sample code or example code in the labview software for their daq boards.  It seems odd that NI would give example code that their boards cannon support.  do you know which board would support this hardware sample clock?

 

0 Kudos
Message 3 of 4
(924 Views)

Most NI DAQ boards introduced in the last 15-ish years that have counters would likely support edge counting with a hardware sample clock.  However, like I mentioned in the earlier reply, they would also mostly require that sample clock to be supplied from some external source.

 

The USB-600x devices are among the relatively few I know of that don't support this capability.  Anything in the M-series or X-series family would support it.  The cDAQ family would as well.

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 4 of 4
(916 Views)