01-05-2010 01:24 AM
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
01-05-2010 01:35 AM
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
01-05-2010 02:02 AM
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,
01-05-2010 03:14 AM
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
01-05-2010 04:39 AM
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
01-05-2010 05:56 AM
> 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
01-05-2010 03:46 PM
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)
01-06-2010 04:10 AM
thank you all
it was a great help.
regards