LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Need help with my project

Solved!
Go to solution

hey, I am a beginner of labveiw, recently my professor give me a some project as below

 

  1. Push buttons that allows the user to indicate the start recording time and same button to indicate the time has ended.
  2. Show three numeric indicators(seconds):
  3. frequency (start to start)(Average of last 5).
  4. duration (start to end)(Average of last 5).
  5. break between two duration (end to start)(Average of last 5).

 

I can only figure out the “duration” as following image , anyone who could help me for the rest of two, thanks so muchlabveiw questionE.PNG

0 Kudos
Message 1 of 34
(3,874 Views)

OK, let's take it by the numbers:

Requirement 1 tells you that an event structure will be needed.
Requirement 2 tells you that you will need time functions, and the ability to manipulate time values.
Requirements 3 - 5 tell you that you will need more than one shift register. You will also need the analysis routines to do the statistics.

Take those hints and see what you come up with. Start with a subset of the problem. Write a vi that takes the current time and displays it whenever the button is pressed. Start with just that, we can build from there. 

 

Want to know a secret? Your professor isn't really interested in teaching you how to create a timer. It's far more important that you learn how to think.

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 34
(3,837 Views)

thanks so much mike, just another question, how to make the system know I press the button and let the system record the time I pressed ?

0 Kudos
Message 3 of 34
(3,798 Views)

@zqz51911 wrote:

thanks so much mike, just another question, how to make the system know I press the button and let the system record the time I pressed ?


Event Structure.  You can make an event case for the button's value changing.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 34
(3,792 Views)

yep, I uesed event structure. and it works for the duration calculation , however, how to wire to make the system to record the time between the firt time I pressed the button and the second time I pressed the button ?labveiw questionE2.PNG

0 Kudos
Message 5 of 34
(3,788 Views)

@zqz51911 wrote:

yep, I uesed event structure. and it works for the duration calculation , however, how to wire to make the system to record the time between the firt time I pressed the button and the second time I pressed the button ?


As in save it to a file?  There is a whole suite of functions in the File I/O palette that you can use.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 6 of 34
(3,784 Views)

not save in a file , finally all the three values(frequency duration and break) sholud have indicator to showing on the front panel.

0 Kudos
Message 7 of 34
(3,781 Views)

@zqz51911 wrote:

not save in a file , finally all the three values(frequency duration and break) sholud have indicator to showing on the front panel.


Then just calculate the values and dispaly them with indicators.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 8 of 34
(3,774 Views)

the question is I have no idea how to coding the calcaulation.......

0 Kudos
Message 9 of 34
(3,772 Views)

You are already keeping a shift register for the time.  I would change this to be 2 shift registers: one for when the button was turned on and a second for when the button was turned off.  When the button is turned off, you just subtract to get the duration.  When the button is turned on, you subtract the current time and the time is was previously turned on to get the frequency.  The break is just the difference between the current time and the time when the button was turned off.

 

A case structure in your event case will be needed here.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 10 of 34
(3,763 Views)