Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Need higher sampling rate on counter, even with no new events

How can I get a >100Hz digital counter reading? If I use anything other than on-demand software sampling, readings are only taken *after* a new encoder count.
That is, even if no new events happen, I still need that same number of counts returned repeatedly, at the sampling rate, instead of the loop hanging until a new event happens. For example, I want the output to be 0 0 0 1 3 10 13 15 15 15 15 15 instead of the 0 1 3 10 13 15 that it is now. Thanks, this one really has me stuck!!

Just to clarify: I've tried external clocking, on-demand hw-timed, etc. But, then the data that comes out is not sync'd up with analog data that I'm taking. I need the encoder count to be displayed in a .lvm file right al
ongside several voltage readings that I'm taking at a fixed sampling rate.
0 Kudos
Message 1 of 2
(2,718 Views)
If you use DAQmx, you could just program the counter task to use the AI Sample Clock as its own
sample clock. Then each time you take an analog read, you can follow it with a counter read, knowing that the same # of samples will be ready. Attached is a screenshot to get you started. Note that the 'rate' input must be wired even if you don't know the correct value. In the case of edge counting, I don't think it matters what value you put in.

There are also ways to do this under traditional NI-DAQ, but it's not quite as simple.


-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 2 of 2
(2,718 Views)