LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

beginner timing program - triggering with photogates

Hello, 

  I am attempting to create a program in which I can time the sprint time of runners that break photogates, which are connected to channels on the measurement device. The idea is that once the photogate is broken, there is a voltage trigger that begins a timer, and the timer stops once the the next photogate trigger is broken (another voltage trigger). I have something very basic attached in which if a voltage threshold is surpassed (from one channel), a time is taken, and then potentially when the next threshold is surpassed, another time is taken, and perhaps the two times can be subtracted, but I can't seem to make this work out of the program, thus it is not quite exactly what I am looking for. I am very new to LabView and I think the solution might be simple, but I can't seem to work it out. Could you give me any suggestions?

Thanks for any help.

0 Kudos
Message 1 of 6
(2,827 Views)

For the program to do what you want you only have to have it remember all the times it triggered - in my example I used a shift register with an array for that.

 

There are a few things to be aware of (maybe more than I'll think of now):

1. Windows is not a real time OS - your measurement may be off by a couple of microseconds. If it has to be exact doing the timing in software will not suit you.

2. If you can live with that you still have to be careful with that timing VI. It counts to 2^32 - 1, and then it starts over. That might happen during the time you want to take.

 

Regards Florian

0 Kudos
Message 2 of 6
(2,822 Views)

Since you are talking about sprinters the total elapsed time will not be very long from the beginning of the race to the end.  I would use hardware timed acquisition.  Put both channels into one task.  Sample both channels at 1000 samples per second.  Either trigger the acquisition with the starting gun or manually start it before starting the runners. After the race ends, stop the acquisition.  Analyze the data in a for loop, creating, as Florian suggested, an array of the times between the gates.

 

I did this back in the LV 4 or 5 days.  We were no only timing the runner but also projecting an image which varied according to the runner's position.

 

Lynn

0 Kudos
Message 3 of 6
(2,815 Views)

Dear Florian,

  Could you save your program in the LabView 8.2 version for me? That is the version I'm actually using, I don't have version 2011. 

 

Thanks so much,

Patrick

0 Kudos
Message 4 of 6
(2,798 Views)
Or could anyone show me what Florian is talking about, using my program? Thanks again.
0 Kudos
Message 5 of 6
(2,778 Views)

You can use the Version Conversion thread to get VIs converted to your version.

 

Here is Florian's VI converted to LV 8.2.  I did not check it so there may be errors.

 

Lynn

0 Kudos
Message 6 of 6
(2,762 Views)