Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

Measure time between two pulse

Hi,

 

I have a rio kit (sbrio-9636) and i have to read the time between two pulses given by an optical sensor on a shaft to calculate the speed. I'm familar with microcontroller where i can do that with timer and interrupt but don't know how to do that in labview with an FPGA. Any help ?

0 Kudos
Message 1 of 2
(5,467 Views)

Interrupts would not make as much sense here since the FPGA doesn't execute code in the same way a regular CPU would, and doesn't need to "interrupt" execution whenever some event occurs.

 

Since FPGAs give you the ability to control how logic executes all the way down to a single tick of the FPGA's clock, you could easily just write some code that starts counting ticks of the FPGA clock in a Single-Cycle Timed Loop when the first pulse is read, and then stop counting when the second pulse is read. This count multiplied by the duration of each tick (25ns for a 40MHz clock) would give you the total duration between pulses.

 

FPGA does have interrupts, but these are more for synchronizing the FPGA with a Real-Time process. If you are interested, there are FPGA Intperrupt examples in the LabVIEW Example Finder.

 

I hope this helps.

 

Regards,

 

Ryan

Ryan P.
CLA
0 Kudos
Message 2 of 2
(5,446 Views)