07-11-2021 07:40 AM
Hi,
I am trying to implement a very simple timing task, if I press a start button I will initiate a timer to start counting the time elapsed in milliseconds, once I press the stop button the timer stops and I can display the time elapsed between the two button press. Anyone able to give me a hint on what timing block I can use to code such performance?
Many thanks
07-11-2021 09:52 AM
Look in the timing palette. You need a simple state machine. Since you only have two states, you only need one button with switch mechanical action. Press it to start the time and press it again to stop.
Did you do the basic tutorials? Do you know about shift registers and feedback nodes?
The tick count gives you a relative millisecond value, so an elapsed time can be calculated from the difference between two readings. On START, place the current tick count into a shift register, then run the loop at 1ms period, reading a new tick count and subtract the start value to get elapsed time
Also search the forum....
See how far you get. (I recommend to stay away from express VIs.)