05-30-2022 08:33 AM
I am using cDAQ-9188 and NI9402 to count a TTL signal from a tachometer.
I tried to use an example in the labview: Counter - Count Edges (Continuous Clock).vi as shown below.
However, I got the error message 200284, so I adjusted the sample rate but it did work.
How can I fix this problem? any idea?
Solved! Go to Solution.
05-31-2022 05:42 AM
Counters are a little tricky when it comes to sample clocks. Most NI devices with counters (possibly all -- I don't know for sure of any exceptions), do not allow you to derive a sample clock internally. You have to "borrow" it from another task or an external signal.
(Note: there are also several counter task types that use "Implicit Timing" where the signal itself defines sample timing and no regular clock is needed.)
Since you're starting with the shipping examples, I'll suggest you open a 2nd example for using a counter to generate a continuous pulse train. Specify a different counter and start generating a pulse train at your desired sample rate of 1000 Hz. Then come back to the example you posted and identify the sample clock source to be the internal output of that other counter. You may first need to first right-click the control, choose "I/O Filtering" and check the box to "include advanced terminals".
There's a different error that may arise if your tach is slower than the sample clock (or there's no motion at all). Or maybe not -- DAQmx has improved some of its config defaults over the years to make such an error much less common. If you *do* get new errors, post back.
05-31-2022 07:23 AM - edited 05-31-2022 07:26 AM
I would suggest that you could "put your finger right on the problem " by putting your finger on the problem. Digitally stimulate your shaft. 😱
05-31-2022 07:27 AM
According to your comments, I add one more task to borrow the sample clock, and it works now!
Thanks a lot!!!