LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Creating code to monitor the change in an input

I am currently trying to measure the speed of a cog for a set period of time. I have wired a sensor back to an analog input. I am reading this single channel inside a while loop for five seconds and based on the number of pulses I multiply this value by 12 to get revs per minute. The problem is at the minute I can't seem to get it to run consistently giving out the same value each time. I know what I need to add but am unsure of what code to use.  Basically when the sensor senses the notch it drops to 0.2 volts and the rest of the time it sits at Volts. I want to monitor this input at five volts and only start counting the pulses when I see it going to 0.2 volts i.e.. Sensing the notch again. Would anyone be able to point me in the right direction with this one?

 

Thanks.

0 Kudos
Message 1 of 3
(2,368 Views)

I have added an attachment of what I have so far so if anyone else has any ideas feel free to reply.

 

Thanks again.

0 Kudos
Message 2 of 3
(2,354 Views)

One simple solution is to add an extra loop before your measuring, measuring until voltage >0.2, then starting the other loop.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 3 of 3
(2,336 Views)