LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

stoping a while loop using an external intrupt

hey there

 

 i am a little new to labview and i was wondering that how can stop a while loop using a external intrupt. what i mean to say is that using the stop sign in the while loop stops the loop but what i want to do is to some way stop the while loop , where the stop bolean control is placed outside the loop , or the conditions for which the while loop is coming after the loop has started ...so how can i do it .

 

attachted is a VI which has  stop control outside the while loop . when i run it, it just keep on runing .. i want to stop the while loop using an external intrupt.

 

thnx all

 

0 Kudos
Message 1 of 8
(3,952 Views)

Walia,

 

You can create property node (with the "value" property) or a local variable to be wired directly to the "loop condition" terminal of the while loop.

Offcorse there are other methods like generating the  dynamic events and so on.

But using the property node or local variable are not recommended in the example that you have attched. I didnt understand why you kept the stop button outside the loop also...

 

Probably if you provide more info some one will definetly help you out.

 

Guru

Regards
Guru (CLA)
Message 2 of 8
(3,946 Views)

Hi waila,

 

one thing that you should keep in mind, is that once the loop has started, no information enters or exits the loop.

So you can not just wire your "end-loop"-condition directly to the stop terminal.

One way to achieve what you are trying is a local variable or a property node.

 

Cheers,

Pattos

LabVIEW Gretchin
0 Kudos
Message 3 of 8
(3,938 Views)

hi GURUTHILAK

 

i know abt property node and local variable but if you can help he in understading how to use dynamic events it would be great ful 

as for why i m doing this ... it was just somthing that came to my mind and i thought to post on the forum. because i know that when a while loop is running no information goes in or out of the loop . So i was wondering is there a way to bypass the rule or not

thnx

0 Kudos
Message 4 of 8
(3,931 Views)

walia,

 

There is something called as "event structure" which has a "Dynamic event terminals" (right click on the event structure select the "Show dynamic event terminals"

 

using this, you can programatically fire the events and perfrom the required operation.

 Attched is a vi for your understanding

 

Guru

Regards
Guru (CLA)
0 Kudos
Message 5 of 8
(3,921 Views)

> when a while loop is running no information goes in or out of the loop

 

Perhaps this is obvious, but just to make sure, I'll say it:

 

Actions performed through references *can* send information into or out of while loops that are running.

 

For example: queues, notifiers, user events, property nodes ...

 

steve

 

www.ashfordsolutions.com

--------------------------------------------------------------------------------------------------------------------------
Help the forum when you get help. Click the "Solution?" icon on the reply that answers your
question. Give "Kudos" to replies that help.
--------------------------------------------------------------------------------------------------------------------------
Message 6 of 8
(3,904 Views)

Check out this example from the community, it shows how you can stop parallel loops using SubVI's local varribales or events.

 

Emergency Stop Events (while loop, for loop, Sub VI)

 

0 Kudos
Message 7 of 8
(3,876 Views)

thank you all

 

it was a great help.

 

regards

 

0 Kudos
Message 8 of 8
(3,846 Views)