LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

stopping the execution in between

Hi,

I am using a Event structure to Start and Stop the test. In the Start event i will be having a stacked sequence which consists of many sequences. In the Stop Event I will be stopping the execution. If I press Start button the sequence under this event will start running. I want to Stop the execution or skip the next set of sequences in between the sequence. During this I lose the control over the GUI and I cannot do anything until the sequence under the Start event is completed. I can stop the execution by pressing the abort button but i want do it programmatically.

 

Regards,

Rajashekar

0 Kudos
Message 1 of 17
(3,849 Views)

Hi,

Introduce an abort button and cover up all the sequences with case structure.  When the abort button is ON then the sequences will not execute.

 


During this I lose the control over the GUI and I cannot do anything until the sequence under the Start event is completed.
Is your GUI not responding when the sequences are executed? Is that what you say here?? if so what sort of operation your sequence is performing.  Post a screen shot of vi if possible.
With regards,
JK
(Certified LabVIEW Developer)
Give Kudos for Good Answers, and Mark it a solution if your problem is solved.
0 Kudos
Message 2 of 17
(3,845 Views)

You should use a state machine architecture and, as such, avoid using a sequence structures. When you transit between states, you can poll the stop button and stop your state machine when you want to. Have a look at a template by navigating to File -> New.. and going to the Standard State Machine design pattern.

 

If you have any questions, post back.

Adnan Zafar
Certified LabVIEW Architect
Coleman Technologies
0 Kudos
Message 3 of 17
(3,844 Views)
This is the sample type vi how i will be using in my program. In this dont want to abort the execution just i want to skip the next steps in the sequence exit from that event.
0 Kudos
Message 4 of 17
(3,838 Views)
As suggested in the previous reply by Adnan you can use state machine to avoid such circumstances.   State machine is versatile and provides control over the execution of the code. Doing modifications into the present architecture that you follow will lead to more trouble and will become cubersome when your code size grows.
Message Edited by JK1 on 04-06-2009 01:59 AM
With regards,
JK
(Certified LabVIEW Developer)
Give Kudos for Good Answers, and Mark it a solution if your problem is solved.
0 Kudos
Message 5 of 17
(3,822 Views)

After ok button pressed,Do u want an option in your programme to skip the sequence structure? which steps you need to skip?


In this dont want to abort the execution just i want to skip the next steps in the sequence exit from that event.
 

 I am not understood your words.Smiley Indifferent

Balaji PK (CLA)
Ever tried. Ever failed. No matter. Try again. Fail again. Fail better

Don't forget Kudos for Good Answers, and Mark a solution if your problem is solved.
0 Kudos
Message 6 of 17
(3,820 Views)

Its not to skip the sequence structure,  after Start button is pressed.

Its like i provided wrong inputs and I started the test by pressing start button.The test is in middle of the sequence and i dont want the test to complete, I just want to stop that event(using stop button in the program) and wants to provide correct input and start the test.

Or I want to stop that event when it is running in middle of the sequence and want to start freshly.

0 Kudos
Message 7 of 17
(3,811 Views)

Here you go...your code with state machine implementation. If you implement it this way, you can definitely take care of the case that you have mentioned.

 

Example in LV 8.6.

Adnan Zafar
Certified LabVIEW Architect
Coleman Technologies
Message 8 of 17
(3,808 Views)
The code ypou sent i tested, its executes the current sequence and stops from the next sequence when the stop buttonis pressed. Is it not possible to stop (stop the current runninng sequence itself) the execution as soon as i press the Stop button irrespective of whatever it is doing ( without using abort button).
0 Kudos
Message 9 of 17
(3,790 Views)

No you won't be able to do that unless you divide the code further into sub-states. And, that's why it's always recommended to make your code modular. Post a snapshot of an isolated version of your code, so I can understand what's going on.

Adnan Zafar
Certified LabVIEW Architect
Coleman Technologies
0 Kudos
Message 10 of 17
(3,781 Views)