LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Record the time the push button is depressed

Solved!
Go to solution

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!  🙂

Message Edited by 8212349829 on 03-16-2009 08:00 AM
Message Edited by 8212349829 on 03-16-2009 08:02 AM
0 Kudos
Message 1 of 7
(3,822 Views)

Hi 8212349829,

you can use an event structure. In every event case is a time output which shows when the event occurs.

 

Mike

0 Kudos
Message 2 of 7
(3,816 Views)

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... 😕

0 Kudos
Message 3 of 7
(3,806 Views)

Hi 8212349829,

see the attached example.

 

Mike

0 Kudos
Message 4 of 7
(3,790 Views)

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!

😄

0 Kudos
Message 5 of 7
(3,781 Views)
Solution
Accepted by topic author 8212349829

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

Message 6 of 7
(3,771 Views)
I got it! Thanks a lot!!! 🙂
0 Kudos
Message 7 of 7
(3,741 Views)