From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Count pulses in analog waveform

Hello everyone,

I need to count the pulses of a analog waveform. I have a motor with a encoder, the encoder output analog waveform. I need to count the pulses to calculate the position of the motor. I didn't find something useful in LabVIEW. Does anyone can tell me to use which function?
 
Thank you in advance for your time and help
Kevin
 
0 Kudos
Message 1 of 6
(3,360 Views)

Try "Waveform peak detection" in the "Waveform --> Analog Wfm --> Measurements --> Wfm monitoring" palette.

 

Set the "Threshold" to a reasonable value, then see the size of the output array to get a count.

0 Kudos
Message 2 of 6
(3,336 Views)

In addition, use "Extract Single Tone Information" in Signal Processing palette for frequency and period measurements.

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 3 of 6
(3,326 Views)

Or, additionally to the good suggestions by Kyle and aputman, depending on the actual hardware you have you could do the counting in hardware.

 

Is your motor's encoder really outputting an analog waveform? I only know of encoders that do square waveforms. If you read it with an NI cDAQ module that has a counter module, you don't have to do it in software.


Ingo – LabVIEW 2013, 2014, 2015, 2016, 2017, 2018, NXG 2.0, 2.1, 3.0
CLADMSD
0 Kudos
Message 4 of 6
(3,307 Views)

LabVIEW is a development environment, you will need some hardware to give data to your program. 

Do you have any board, or do you need a board? WIth NI it would be simpler, third party just for this task will be cheaper.

What are the pulses shape, width, amplitude, maximum rate? Just in case, what is the noise level? 

Message 5 of 6
(3,280 Views)

I have tried "Waveform peak detection" in the "Waveform --> Analog Wfm --> Measurements -->  Wfm monitoring" palette, but it does not do much.

With the code below it detects pulses only if the width is equal to 8. Why exactly eight- I do not know, the help doc did not give much reason.

With a real waveform from a DAQ it is much worse.

0 Kudos
Message 6 of 6
(2,412 Views)