LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to restart an elapsed time 3 times inside a case structure

When a user points 30 the elapsed time of maintain begins,and he has to mainatin this value for 10 sec,if not the vi stops.i want to give this user 3 chances,even if he missed it after ,the VI shouldnt stop as if he begins again from the beginning,what's mean,the elapsed time of maintain is 0 until he reached 30 but in the 3rd time,when he reached 30 if he doesn't succed to maintain this value for 10 sec,then the Vi stops.if anyone could help,i'll be really grateful.   thanks

1.png

0 Kudos
Message 1 of 13
(3,327 Views)

How does the user interact with all this? What is "maintain", how does he do it? Missed what?

 

Your description is very hard to understand. Also a picture is insufficient to illustrate the problem. Attach the actual VI instead.

 

0 Kudos
Message 2 of 13
(3,324 Views)

The user uses the joystick to reach the value of "30" ,when he succed the elapsed time"that i called maintain" starts counting,in order to say that the user succeds and maintains this value he should stay in this field (30-5 ; 30+5)=(25 ;35) for 10 sec,the moment he's out of this domain the loop stops,consequently he didn't succed.what i want is to give user the chance 3 times,if he's out the loop(then the VI)shouldn't stopn just the elapsed time (maintain) has to equal 0 until the user reached 30 again....... but for the 3rd time if he's out the VI must stops.

i hope that u get the point Mr altenbach,if not i can try to explain it again in an other way.

thanks

 

 

 

23.png

 

 

 

0 Kudos
Message 3 of 13
(3,311 Views)

I admire your enthusiasm for taking on tougher and tougher assignments, but you really should be concentrating on learning the basics first.  It seems this would be best expressed as a state machine.

 

Is the sound loop suppoesed to be related to the main loop in any way?  What are you expecting from the sound loop?

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 4 of 13
(3,286 Views)

the user hears the assignement first,then he begins the test.i didn't really get what u meant

0 Kudos
Message 5 of 13
(3,275 Views)

@achfire wrote:

the user hears the assignement first,then he begins the test.i didn't really get what u meant


Actually, it appears that you undesrtood exactly what I meant.  🙂

 

You could include that as a part of your state machine.  You could start out with a "Continue" button that is grayed out, then becomes enabled after the sound file completes.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 6 of 13
(3,266 Views)

no;what i wanna say is what's the relation of  your suggestion with my problem.the sound file doesn't have any link with the issue that i want to solve

0 Kudos
Message 7 of 13
(3,257 Views)

@achfire wrote:

no;what i wanna say is what's the relation of  your suggestion with my problem.the sound file doesn't have any link with the issue that i want to solve


Oh, that was me just trying to gather up as much information as possible so I could give you a more meaningful answer.

 

I really think you should rewrite the VI as a state machine.  What you have is overly complicated.  With a state machine, it would be very easy to branch from one state to another.

 

 

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 8 of 13
(3,241 Views)

thanks  a lot

 

i was just wondering if there is a simple way to make some change,a for loop or sth else to add apart a state machine to solve my problem

 

anyway thanks again

0 Kudos
Message 9 of 13
(3,234 Views)

@achfire wrote:

thanks  a lot

 

i was just wondering if there is a simple way to make some change,a for loop or sth else to add apart a state machine to solve my problem

 

anyway thanks again


Well, the state machine is a simple way to fix it because then you don't have all the states to sort through at once, which I think is where your problem lies.  🙂

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 10 of 13
(3,226 Views)