05-26-2014 11:39 AM
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
05-26-2014 11:52 AM
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.
05-26-2014 12:28 PM - edited 05-26-2014 12:30 PM
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
05-26-2014 04:36 PM
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?
05-26-2014 05:15 PM
the user hears the assignement first,then he begins the test.i didn't really get what u meant
05-26-2014 05:56 PM
@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.
05-26-2014 06:04 PM - edited 05-26-2014 06:04 PM
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
05-26-2014 07:09 PM
@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.
05-26-2014 07:50 PM
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
05-26-2014 08:00 PM
@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. 🙂