04-05-2008 11:32 AM

04-07-2008 05:34 PM
Hello AbangCorp,
The usual method for measuring frequency is to use a counter input and counter input: frequency task. If you're board has an onboard counter this would be the easiest method. If you need help locating an example program to do this then it would be helpful to know what data acquisition board you're using. If using a counter is not an option or if you just want to get the frequency in a post processing step then you could use some logic to calculate the number of rising edges of your signal and divide by the amount of time-data you counted from.
Since it sounds like you want to make a control loop using a counter would be the most efficient way to measure the frequency of your digital signal. Assuming you're using a card that can be programmed with NI-DAQmx you can find examples in the example finder. To access these examples open LabVIEW and go to Help>> Find Examples... Then for frequency measurement examples go to Hardware Input and Output>> DAQmx>> Counter Measurements>> Digital Frequency.
I hope this gets you started. If you need different examples or are still having trouble please include what hardware (DAQ card) you're using to collect this data when you post back.
Have a great day!
04-07-2008 11:44 PM
04-07-2008 11:45 PM
04-08-2008 01:07 PM
Hello AbangCorp,
I'm not familiar with the Advantech 1710, but if it doesn't have a counter input then you won't be able to make a frequency measurement in hardware. You'll need to take your data and develop a software algorithm to find rising edges in your data. Once you locate two adjacent rising edges just divide by the time between them to get the frequency. You can do this for each pair of adjacent rising edges and average the total for a more accurate measurement if you can assume your incoming frequency is constant.
As far as how you can locate rising edges this will depend on your signal. If it’s a digital signal you could compare adjacent elements in your waveform to see if the previous element is less than the current element. If this condition is met then you've located a rising edge and you can increment your count. If you're waveform is not digital then you'll need to account for noise to avoid accumulating extra counts.
Cheers,