Quantcast
Channel: LabVIEW topics
Viewing all articles
Browse latest Browse all 69585

Making pulse frequency measurements with NI USB-6356.

$
0
0

I'm back to previous problems with my rotary encoder and making good frequency measurements. Following this earlier thread (Connect Non-TTL rotary encoder to USB-6356) I have the encoder hooked up so that I can read it as a digital signal using a counter.

 

Today I tried making 'CI Pulse Freq' measurements. The graph produced was pretty nice and seemingly agreed with the frequency I expected and what I saw on an oscilloscope. A reasonable amount of variation was visible (which is good, since I'm trying to troubleshoot the variation - tricky if my frequency step size is enormous and/or no variation appears...) so I was fairly pleased.

 

However, I don't know that I have a good way to plot this as a function of time. The number of pulses that I received measurements for was much lower than the number of pulses, and so I suspect I'm accidentally making a single measurement over and over, and the loop time is too long. This is backed by seemingly my For loop always having one element (that I saw whilst building the VI).

 

How can I set this up to make the buffered measurements described in the X-Series manual? (Chapter 7 - Counters). Will doing that enable me to measure every pulse? If I can, then presumably the time becomes something I can work out (after, if need be) and plot against.

 

The pulses were occurring at about 13kHz, which I don't think should be too problematic for the USB-6356. In future pulses might occur at rates up to around 130kHz, but if this is too difficult we can consider replacing the rotary encoder with a lower-resolution model (who needs 0.1 deg anyway?)

 

I'm reasonably sure that currently my problem is bad programming, but I'm not certain that at some point it won't be hardware/connection limited.

 

Attached is a simple VI that hopefully reflects the VI I earlier used (simplePulseFrequency.vi). Unfortunately the actual VI was replaced by a more messy and not-so-good 'CI Freq' measurement version.


Viewing all articles
Browse latest Browse all 69585


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>