LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Digital input counting - USB 6008

Hi there,
 
I have recently had the need to start using Labview again after a very long period of inactity and have found myself very rusty!
 
I have a NI USB 6008 running with Labview 7.1.  I have an experiment where I want to use a reed sensor to count the revolutions of a sprocket and use this to calculate the revs per minute.  I have setup the USB 6008 to read the digital input from the reed switch in the counter input and count the falling edges.  So i now have a nice counter and I also have a time elapsed function running but the problem is that I now cannot figure how to take readings of the count at only 60 seconds that i can use to calculate the rpm. 
 
Apologies for my lack of basic skills!  Any help would be appreciated.
 
Thanks
0 Kudos
Message 1 of 8
(3,838 Views)
if your counter is in a while loop, and you have the elapsed time, simply divide the iteration nb of the loop by the elapsed time * 60 sec = rpm.
if your elapsed time is only since the last count, then you need to keep track of the time, by using a millisecond timer before and in the loop ( substract the later by the first).
-----------------------------------------------------------------------------------------------------
... And here's where I keep assorted lengths of wires...
0 Kudos
Message 2 of 8
(3,824 Views)

Thanks for your reply.  I have now had to change my program slightly because the counter was counting 3-4 falling edges per revolution which meant that it wasn't accurate enough.

I have now connected the reed sensor up to a digital input so that it measures a high everytime the magnet passes the sensor.  This works fine but I don't know how to take this data and use it to calculate the revs per minute.  I have tried to use the Timing and Transisitoins VI to measure the frequency but it returns the error regarding the waveform having zero amplitude.

I would be grateful if anyone could offer some advice on the best way forward with this!

Thanks again.

0 Kudos
Message 3 of 8
(3,771 Views)
try one of the two options below, when you insert in the express vi that makes the count (put the timout to -1, meaning infinite):
the while loop will execute only when a count is recorded.
 
 
in the first option the RPM is calculated as function of the overall time elpased (more accurate solution).
in the second option, the time difference is recorded only between two iterations of the loop. the time of last iteration is kept in the shift register.

Message Edited by Gabi1 on 09-10-2007 10:54 PM

-----------------------------------------------------------------------------------------------------
... And here's where I keep assorted lengths of wires...
Message 4 of 8
(3,753 Views)

Gabi1,

Thanks for your input mate.   I now have a working VI.

Your help has been much appreciated! Smiley Happy

0 Kudos
Message 5 of 8
(3,740 Views)

Hi verisimilitude,

Would you post your vi or a screen shot of it working?  I have a USB6002 as a counter, but the timing loop is not working properly for me.

Thanks!

0 Kudos
Message 6 of 8
(3,057 Views)
Did you notice how old this thread is? Instead of asking for a VI from someone that hasn't posted anything in the last 8 years, try duplicating what has been posted ibn this thread and if that doors not work, start a new thread and attach the code you have written with an explanation of what does not work.
0 Kudos
Message 7 of 8
(3,036 Views)

Will do.  Thank you.

0 Kudos
Message 8 of 8
(3,024 Views)