01-08-2010 03:38 AM
01-08-2010 05:00 AM
Hi nolsqn,
... because you connect a number >0 to the N Terminal. The stop button can first be analysed inside the loop.
Mike
01-12-2010 01:52 AM
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.
01-12-2010 02:11 AM
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
01-12-2010 02:19 AM - edited 01-12-2010 02:21 AM
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
01-12-2010 03:39 AM
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
01-12-2010 03:58 AM
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
01-12-2010 05:00 AM - edited 01-12-2010 05:04 AM
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
01-12-2010 08:25 AM
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.
01-12-2010 10:50 PM
my apologies . Will ensure this from onwards.