LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Pulse Measurement VI problem

In using the Pulse Measurement (built-in) VI more I see it cannot measure pulse periods when the frequency is below about 15 hz .. at least on my system. I am simply bringing in a simulated sine waveform and leaving all the defaults on the pulse measurement VI.. is there a way to extend the range of the pulse measurement vi for slower waveforms? (I'm guessing the VI somehow times out?)
0 Kudos
Message 1 of 7
(3,808 Views)
You have not mentioned the hardware that you are using to generate and measure pulse. If the hardware you are using is FP-CTR-500/502, I have a suggestion. The terminal count value that is being used has a direct effect on the value of the frequency generated. If the value is set in the range 30 to 4 you can generate a frequency in range 500Hz to 3KHz. You can vary the terminal count value and try for your program.
0 Kudos
Message 2 of 7
(3,808 Views)
actually the hardware is unimportant, I am currently testing and using a square wave function generator (0-5v signal) .. although I use the built-in waveform synthesis to generate either square or sine waves and get the same problem.. The problem seems tied to all the timing measurement VI's .. they all seem to give errors when input wave frequency drops below about 15 hz .. Dave
0 Kudos
Message 3 of 7
(3,808 Views)
I think what it happening is that you are not giving the Pulse Measurement VI enough of the cycle. It needs to have at least one complete cycle of the waveform. If you wire the error output to an indicator, it may be returning an error that is something like this:

-20308
"ma_ptmFetch.vi" when called from "Pulse Measurements 1 chan.vi"

If you right click on this error cluster, you can select explain error which should give you some more information. On the one that I tried, the explanation was this:
__________________________________________
Error -20308 occurred at "ma_ptmFetch.vi" when called from "Pulse Measurements 1 chan.vi"

Possible reason(s):

Analysis: The waveform did not cross the mid reference level enough times t
o perform this measurement. Check the signal length, reference levels, and ref level units.
_________________________________

You can test lower frequencies if you have longer samples. You just need to have enough crosses of the reference level.
0 Kudos
Message 4 of 7
(3,808 Views)
Yes, that is the error that is occuring .. I do not know how to get "longer sample" .. how do I get the measurement VI to wait and gather more samples?... it seems to be timing out if it doesn't get a complete cycle in a certain length of time .. so I can't measure slow waveforms.

dave
0 Kudos
Message 5 of 7
(3,808 Views)
I see your problem. You are getting data in through something like a DAQ or VISA call and you just aren't getting enough points to make the measurements with this VI. You can either collect several of these together and then make the pulse measurement, you can tell the input to take longer (which sounds out of the question), or you can make the measurement some other way.

Which of the pulse measurements are you trying to make? Period is 1/frequency. If you know the frequency through other means, you can just invert for period. To measure period you need at least one complete cycle. Pulse duration (pulse width) can be calculated by finding the rise to fall edge times. Duty Cycle is (pulse duration / period)* 100. The
*100 makes it a percentage.

I am not sure what else to tell you. Good luck.
0 Kudos
Message 6 of 7
(3,808 Views)
Thanks for your comments .. this appears to be a limitation of the Measurement VIs in LabVIEW. I don't see this limitation mentioned in the docs or on the website so I don't see a workaround. However, instead of using this VI, I input the signal into the counter input of the DAQ card, which works great and the way I should have done it in the first place .. just wondered about the 'built-in' measurement VIs..

Dave
0 Kudos
Message 7 of 7
(3,808 Views)