LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Getting the "time" for which in LED is turned on of off.

Hi, everyone. I'm doing an experiment where I connected a photogate to an ni usb-6008 and then to labView.

 

What I did:

Added a "DAQ" assist to the front panel (digital acquisition "line") and then a boolean expression on the block diagram (round LED).

 

When I run the VI, each time I block the laser from the photogate, the LED in labview get turned off. And when I unblock the laser, the LED get turned on..

 

My question is, when I block the laser, is there a way to calculate the exact time the laser is blocker (LED is turned off)???

 

Anything will help, thanks!

0 Kudos
Message 1 of 3
(1,933 Views)

Hi,

 

the USB-6008 has no hardware timed digital input and the counters can „only“ count edges (to my best knowledge). Alternative approach: Wire your signal to an analog input, acquire it as an analog signal (with or without additional trigger conditions) and then post-process the data to get the time between the rising /falling edges (=time when laser is blocked).

 

Otherwise there are more capable DAQ devices from NI that supports Semi-Period measurements with counters (http://zone.ni.com/reference/en-XX/help/371361R-01/lvmeasapps/measperiod/). This would give you the same result but less programming effort is needed.

 

Hope that helps!

Sascha
0 Kudos
Message 2 of 3
(1,907 Views)

If you had attached your VI (not a picture of it, but the "real thing"), we could see what you are doing and suggest ways you could accomplish this task (consistent with other code you are running in your VI).

 

As Cheggers mentioned, the USB-6008 does not have a Counter/Timer, so you need to get your Time signal from either its Analog clock (a little messy) or from LabVIEW's Time Functions (also a little messy, and potentially not as accurate or precise).  

 

Attach your code, please.  A good Rule of Thumb if you are serious about learning LabVIEW and using it for Data Acqusition and Process Control is to Avoid Express VIs, particularly the Dreaded DAQ Assistant and its Evil Twin, the Dynamic Data Wire.  DAQmx is much more capable (and hidden inside the DAQ Assistant) and easy to learn (search the Web for "Learn 10 Functions in NI-DAQmx and Solve 80 Percent of your Data Acquisition Applications").

 

Bob Schor

0 Kudos
Message 3 of 3
(1,896 Views)