03-16-2009 07:59 AM - edited 03-16-2009 08:02 AM
Hi to all! I am a beginner in Labview and I encounted a problem. I want to find out how long the push button is depressed, but I have no idea how to go about doing it. I know how to find the total run time of the program by using Flat Sequence and getting final frame time to subtract away the initial frame time. But I have no idea how to add in the checking of whether the push button is depressed and acquiring the time. My main aim is to find the time the push button is depressed (from push button depressed till push button released) and the total program run time.
Please help me!! Thanks to all in advance! 🙂
Solved! Go to Solution.
03-16-2009 08:03 AM
Hi 8212349829,
you can use an event structure. In every event case is a time output which shows when the event occurs.
Mike
03-16-2009 08:26 AM
hi mike! thanks for the prompt reply! I looked at the event structure but I am quite confused over the how to use it, as in what inputs/outputs to feed it with. Do u mind guiding me along?
anyways, i attach my attempt.didn't know what things to connect... 😕
03-16-2009 08:59 AM
Hi 8212349829,
see the attached example.
Mike
03-16-2009 09:20 AM
Hi mike!
I looked at it, and there are some doubts which i hope you can clarify for me! 0_o
1. What is the rational behind using a shift register?
2. The event Structure has a small hourglass icon at the left hand corner (event timeout), let's say I want the program to end after 100000 ms i just connect 100000 to it?
3. Under event case [0] why is there a 'Type" and "Time" there? any significance?
thanks for the great help!
😄
03-16-2009 09:51 AM
Hi 8212349829,
you can store values in a shiftregister from iteration to iteration.
You shouldn't use such a big timeout. Bear in mind that the timeout starts with every other event from 0 again.
Time is the time when the event occurs (it should be the internal counter which starts with starting the pc). Type contains information about the event type, right click on the output and select create constant, control or indicator to see the possible values.
Mike
03-16-2009 07:25 PM