From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, 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: 

Calculating time interval between every 2 pulses

Hi,

 

I am using a NI USB-6212 to carry out the test.

 

1. I am trying to calculate RPM of a wind turbine by using a rpm sensor that will on/off a LED whenever something passes through it. When a signal of 2V and above is detected (something passes), a pulse is given out. The time interval is not always constant because of the variable wind speed. When i try to subtract the time, i get weird results. May i know  how do i get the time of the new pulse and the time of the previous pulse and then subtract it to get the time interval? My draft VI is as attached.

 

2. Another idea of mine is that i count the number of pulses in a period of time and then i divide by the period to get the RPM. However in this way, the pulses keeps increasing when the LED is turned off (wind blade is passing through) when i only want it to only increment by 1 when the blade is passing through. Hence, i introduced some delay of 300ms. But i dont think this way is accurate enough. Is there any way i can improve on this?

 

I would prefer if i can count the time interval using way no.1 as it will provide a more accurate results. Please advise me on this matter.

 

Thank you very much.

 

Regards,

Kristin

Download All
0 Kudos
Message 1 of 2
(2,199 Views)

Hi Kristin,

 

before you start programming you should learn the basics of the programming language!

 

Please do the basics courses offered by NI (for free on their website) and learn to use shift registers! You will need them to solve your problem(s)!

After that learn about the coercion dot and it's purpose/meaning. You have some in your VI and it will influence your program logic!

 

To get the idea:

check.png

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 2
(2,191 Views)