LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Quick frequency measurment with an HP 53131A Universal Counter

Hello everybody,

 

I have some issues with the measurement of a frequency. When I have 0 Hz my HP 53131A show some randoms big values. Yes I want to measure in discontinue, I don't want some measurement time or time out. I already dig the whole programming guide of the counter, and he didn't help me. 

 

Sorry for my english btw I try my best. 

0 Kudos
Message 1 of 4
(2,529 Views)

Hmm, that VI isn't even displaying the reading just trying to fetch it.  So how are you seeing large numbers?  Are they on the instrument panel then?  Why not record the readings in code?  (i.e. wire the results to the while loop with a shift register and display the array or plot)

 

A comments about this VI.

- Fetch Measurement.VI cleary states that if no valid measurement exists then it returns Not a Number 9.91E+37 and throws error -230.  Is that what you get?  Then there's something wrong with how you configure the measurement.

- You should read the error in the While loop.

- An estimate of the Frequency to be measured is always a good idea, especially if your signal has some noise.  It gives the instrument a starting range and helps prevent it from looking at much faster signals.

- Does Abort disable the Auto triggering?  I'm not sure but if it does you need to re-enable on every loop.

- You might try changing the trigger conditions.  What is the input voltage?  Perhaps you are in the signal noise?

- You have a timeout of 70s. A 0Hz signal will take Inf time to acquire, not to mention be purely DC.   A frequecy counter is not going to like that sort of signal very much.  So what is your true frequency, what does the signal look like on a scope.  (What does scope say about frequency?)  If you are trying to measure 0.01Hz try giving the meter a few minutes to acquire the frequency.

 

It strikes me that maybe you are just trying to setup the code and though the meter should easily read 0Hz.  If that's the case, then perhaps you need to rethink your development test case.  Use a frequency generator or oscillator chip with a nice 1V signal at 1kHz and develop the code using that.  Better yet make your test case as similar to your measurement case as possible.  Then move to the real signal and apply filter and fine tune the triggering. 

 

 

0 Kudos
Message 2 of 4
(2,492 Views)

Im sorry my first post was a bit inacurate, So im trying to mesure a 0-24V square signal from an optic captor. My signal when my motor run is 170-250Hz. I just put an example of my programme, and I forgot to set the estimate frequence.

Same for the results.

Actualy you're right, when my motor stop and the frequence go down to 0 Hz, some time I get the -230 error and it shut down my GPIB connection. Anyway, Im trying to avoid that too.

But most of the time when I have 0 Hz it show some random values like 20M Hz or something that big.

Im especialy using this device because I classical multimetre isn't enough fast when it goes to measure the frequence for my application.

Hope it give you more information. I don't know if I can link my real VI because it's not actually for me, and I don't think the person want to find it on the web

0 Kudos
Message 3 of 4
(2,484 Views)

So all you really need to do then is trap that error case, and deal with the out of range numbers some how.  You can do this in code or maybe by using the instruments frequency filters. (You'll have to ready up and experiment with that, I haven't used them except for stats purposes.)

 

Anyway, here's a modified version of what you posted with an error query and way to deal with out of bound measurements. You should modify as you require since I don't really know what you want to do with data when it throws the -230 error.

hp5313x_measure_catch_errors.png

 

 

 

Hope this helps.

Craig

 

 

0 Kudos
Message 4 of 4
(2,477 Views)