|
Re: LabView question
a button is a digital signal. It can either be on or off. The transition between the on and off states is called an edge. It is described as rising (off->on) or falling (on->off). You can either just use the state of the button (on or off) to drive your code, or you can use the edge to drive your code.
Consider a 'start' button, that causes a sequence of things to happen.
If you trigger it on the state of the on button, what happens when the button is "on" for more than one consecutive cycle?
If you trigger it on the rising edge, (ie. the button was off on the last cycle, and its on now), then it doesnt matter how long you hold the button.
Which method you choose depends on the action you want.
EDIT: In order to do this, you must store the state of the button from the previous iteration.
EDIT2: I just built a small VI to clock my mouse click. It takes me on average 40ms to quickly click and release the button on my mouse. I saw times as low as 8ms on a particularly fast cycle.
Last edited by Racer26 : 09-02-2010 at 17:23.
|