LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

time between edge triggers with ni 6008

This is my first post so bear with me.

 

I'm trying to setup my NI-6008 data logger to do edge triggering and I'm having difficulties.  What I'm trying to do is monitor the time intervals between edge triggers.  My input is coming from a seed planter's seed sensor, which outputs a high edge of +5V every time a seed passes by the sensor.  My current setup is reading a digital pulse and outputs a timestamp to an excel file everytime a seed passes through.  The problem is that I'm getting timestamps in my excel file when a seed doesn't pass through. 

 

Here is an example.  Lets say I pass 5 seeds by the sensor about once a second.  And my output in the excel file will prove that i did this, however I'm getting 6 or so timestamps for 5 seed passages.  I'll get like a 3ms interval between timestamps when I should only be getting 1 second intervals. 

 

I had my instructor create a circuit that cleaned up the bouncing between seed passages.  We thought that might have been causing it to count for two seed passages instead of one, but it didn't help us.  We decided we need to setup our labview program to count the time between high edges. 

 

If someone could edit my program, link a tutorial, or offer me any help I would greatly appreciate it.

0 Kudos
Message 1 of 2
(2,416 Views)
You aren't doing any edge triggering.  You are just constantly polling the digital input and looking for when the voltage is high.  Is it possible that one given seed makes the sensor go high long enough that the loop goes around twice?  The only thing controlling the pacing of your loop is how long it takes to write the time value to the file.
0 Kudos
Message 2 of 2
(2,400 Views)