I would like to measure the speed of a gear very accurately and quickly during a laboratory test.
For this I would like to measure the period of the sensor signal generated by the teeth of the gear wheel.
As long as the wheel turns, the measurement works very well. However, if the wheel comes to a halt from the rotation, then there is a problem. The timer waits for the next signal edge and the last valid speed value is constantly displayed - even though the wheel is already at a standstill.
Is there a way to define a time out for the period timer in U3? Or what options are there to solve the problem?
I would be glad if you could help me.
What most people do is a read & reset. From Section 2.9.1.3:
https://labjack.com/support/datasheets/u3/hardware-description/timers-co...
Writing a value of zero to the timer performs a reset. After reset, a read of the timer value will return zero until a new edge is detected. If a timer is reset and read in the same function call, the read returns the value just before the reset.
So in your software you always do a read & reset rather than just a read. If you get pack a 0, you know there has not been a new edge, and your software can decide how to handle it.
We have looked at adding a max period setting to the T-series devices, but as of this writing it is not implemented.