Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

how to extract frequency data digital waveform i took from daq card

Dear LV Pro,

Im using LV for image processing. But today i would like to ask you guys how to easily get frequency from these, i get from channel 6 a digital pulse, constantly giving around 100Hz of waveform, duty cycle 50 %. I succeeded to show it on graphs.

I want to further on Motor Control circuit using PID so this frequency and rps is really important to my project, step function.

Thank
AbangCorp




0 Kudos
Message 1 of 5
(4,767 Views)

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!

Brooks
0 Kudos
Message 2 of 5
(4,738 Views)
sure,

im using advantech 1710

this model have both analog and digital in and digital out only
i can submit you the prog example as well, unfortunately i dont know how to attach .vi files

can you help me?
0 Kudos
Message 3 of 5
(4,728 Views)
sure,

im using advantech 1710

this model have both analog and digital in and digital out only
i can submit you the prog example as well, unfortunately i dont know how to attach .vi files

can you help me?
0 Kudos
Message 4 of 5
(4,727 Views)

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,

 

Brooks
0 Kudos
Message 5 of 5
(4,709 Views)