LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Compare timing of digital signals

Hello,

 

I have a setup that involves two IR detectors whcih produce a logic high output when something passes in front of them. Basically I want to record a 'count' if and only if sensor 2 (S2) is triggered within T seconds of sensor 1 (S1). The purpose is to only record a count when something passes the sensors forwards, and ignore backwards counts (or, if not ignore, store in a seperate place).

 

This work will be carried out in a situation where I won't have access to digital I/O so I'm looking to do this in software, where input voltage is converted into boolean values immediately after they are recorded.

 

It seems to me that the best abstract approach to this would be to start a timer (0<t<T) when S1 is triggered, and to look for a signal from S2 that happens within the allowed time - if no signal comes before t=T, everything resets. But I can't figure out how to implement this in labview at the moment. Any help would be much appreciated.

 

I have attached the VI (LV2010) that handles the sensor inputs, with a bit of blank space and then a final "Condition Met?" boolean - what should i put in the blank space?

 

Kind regards,

Dominic.

0 Kudos
Message 1 of 4
(2,489 Views)

Do you know about the Event Structure?  You can use it to "wake up" when Sensor 1 or Sensor 2 changes, and if the change is to "go on" (as opposed to "go off"), you could either use one of the Time routines to take down the time it occurs, or use the Time Input Node which is simply a free-running millisecond clock.  This would, in principle, give you the times that the sensors turned on, and it would be simple to ask for the difference in the times.

0 Kudos
Message 2 of 4
(2,481 Views)

Thanks for the reply, I used a strategy I found here to latch the first indicator (sensor 1) for a specified time, so I have the timing part down now.

I am still trying to figure out a way to preserve it's directionality though, i.e. differentiate between S1 before S2, and vice versa. Any thoughts?

I'll attach the VI when I next have it to hand.

0 Kudos
Message 3 of 4
(2,466 Views)

I don't know about the event structure, so I'll read up on that.

0 Kudos
Message 4 of 4
(2,464 Views)