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.
In addition, use "Extract Single Tone Information" in Signal Processing palette for frequency and period measurements.
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.
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?
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.