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: 

how to measure the frequency of a pulse being generated by a counter

Hi,

I am using labview 8.6 to generate 5 evenly spaced pulses for every 1 revolution of my shaft. However, I would also want to know the frequency of these pulses so I can determine the shaft speed. Since I am already generating the pulses using one of my counters, can I still tap into that or task another counter to measure the pulse frequency? If so, how? I have attached my code for generating the pulses and I am using an Ni 9401 module and an NI 9172 chassis. If someone can helo me modify the code to measure and tell me the pulse frequency as well, that would be really appreciated

0 Kudos
Message 1 of 2
(2,713 Views)

You'd probably get a more coherent answer if you didn't bounce around from thread to thread so much...

 

How can I generate a pulse train from shaft encoder? (5/13)

 

pulse train from encoder (5/15)

 

how to measure rpm (5/20)

 

How to measure rpm using shaft encoder and labview (5/23)

 

This thread (also 5/23)

 

 

I see you ignored my suggestion from the other thread--Kevin's solution is good too but using an encoder task offers more noise immunity (I think this is probably the cause of the problem you reported on the other thread).  You can fix it with digital filtering if you want to keep using a counter output instead of an encoder task.  Noise during transitions is pretty common for a quadrature encoder.

 

A finite counter output task uses 2 counters on the 9172 (although you said 9174 earlier at one point--this wouldn't be the case on a 9174) so you wouldn't have one left to make your frequency measurement.  With the solution you have now, you can change to continuous to free up a counter if you don't care about outputing an exact number of rotation's worth of pulses (I'm not sure if you do or not--I didn't read through all of the various threads relating to this application to find out).

 

 

For your actual question in this thread...  Have you tried running one of the frequency measurement examples?  From the code here I can't tell what you have tried (it just looks like a mangled version of the code Kevin gave to you in your other thread).

 

 

Best Regards,

John Passiak
0 Kudos
Message 2 of 2
(2,701 Views)