LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

stoping a state in state machine

ohhh sorry .. okay i m replacin the wait function with any other code .. but why does the for loop excutes for atleast once even when i have pressed the stop botton
Regards
0 Kudos
Message 11 of 20
(1,385 Views)

Hi nolsqn,

 

... because you connect a number >0 to the N Terminal. The stop button can first be analysed inside the loop.

 

Mike

0 Kudos
Message 12 of 20
(1,369 Views)

hi

plz anyone can suggest me a way in my VI that i have attached at the start of the discussion , how to go from one state to the other on the user request without letting the while loop outside to complete one cycle

 

what i am tryin to achive is that when in any state either it be 2 or 3 .. if the user presses a botton at any time the program takes it to state one 

 

or if there is any way else so tel me that also.

Regards
0 Kudos
Message 13 of 20
(1,328 Views)

Hi nolsqn,

you got a lot of solutions.

If you use queued state machine and you have a "time intensive" process in one of your states, then you have to include the reaction on a queue event into this process.

 

Mike

Message 14 of 20
(1,325 Views)

Hi,

 

You need to put in a select switch inside the loop but before the case structure.  Wire the button to the select switch and when true goto state 1, when false continue states as normal.

 

As stated several times before however this "Button" will only get read in between state transitions; which you have no control over how long they are going to take etc.  If state 1 is for some kind of emergency off or something then you really need a different design for that function and keep the state machine as a proper state machine

 

Craig

Message Edited by craigc on 12--01-2010 08:21 AM
LabVIEW 2012
0 Kudos
Message 15 of 20
(1,322 Views)

hi craigc...

 

the different design ??? can u help me in that ...i want that three states such that the user shd have the option to select ano one of them once the program runs and in the middle at anyone of them the user can have the power of emergency off

what design shd i follow

 

regards

Regards
0 Kudos
Message 16 of 20
(1,301 Views)

Hi,

 

If the power off is an emergency OFF then it should definitely be hardware dependent not in the software.  If it is just a reset, or you monitor the Emergency off and quit software / reset as a result then you should split "State 1" out of your state machine and monitor it in a seperate loop / event case / whatever way you want to do it.  One way is to launch the state machine programatically and quit it programatically depending on your emergency /reset status / State.  There are lots of different ways to do this but you havent described exactly what state 1 is intending to do etc.

 

Craig

LabVIEW 2012
Message 17 of 20
(1,296 Views)

actually power off is a user switch ... which whd end or change the state as and when the user feel like it. .. i used while loop and conditional for loof both have same problem that when i press the user emergeny off botton it first complete the loop .. i want to just simply jump from that program either to stop or a state .....can u provide me with a basic design as a vi ? if its posible

Message Edited by nolsqn on 01-12-2010 05:04 AM
Regards
0 Kudos
Message 18 of 20
(1,288 Views)

Nosqn,

 

Can you do us all a favor and please use complete words when typing your messages so they are easily readable rather than resorting to text message speech, (i.e.  u plz whd shd).  This is a professional forum and not a bunch of teenagers with thumbs flying all over a cell phone.

 

A plea for full words

Message 19 of 20
(1,273 Views)

my apologies . Will ensure this from onwards.

Regards
0 Kudos
Message 20 of 20
(1,256 Views)