07-22-2011 07:45 AM
I am using two while loops in labview .. i want a single stop button to stop the both things.
Please help me
thanks
mahadev
07-22-2011 07:48 AM
Hi,
Use the local variable of your stop dutton in second loop.
07-22-2011 08:20 AM
I did not get u s, can u expalin it
I am using 2 stop buttons to stop 2 while loops but i wanted to stop both while loops by using a single stop button.
thanks
mahadev
07-22-2011 08:29 AM
Hi Mahadev
As mentioned by Himanshu Goyal, this is possible by using the local varibale of your stop button to feed the stop condition of your second loop as shown here. In this configuration, the mechanical action of your stop button must be one of the three switch modes (not latch) for LabVIEW to accept and run your code.
Depending on your application, you may also like to look into the "Master/Slave" or "Produced/Consumer" multiple loop architecture. These can be useful when you wish to control or synchornize the timed execution of multiple loops and also if you require data to be passed between them.
Hope this helps!
Paul H.
National Instruments UK and Ireland
Applications Engineer
07-22-2011 08:30 AM
Place the 1st stop button inside the first while loop as you normally would. Create a local variable and put it inside the second while loop and wire it like you would your second stop button (just replace the 2nd stop button you have with a local variable). When you make a local variable you will have to link it to something, and you can link it to your first stop button, so that when you click the 1st stop button, it stops both loops.
07-22-2011 08:37 AM
Still in confusion what u mean by Local variable and how to create iot and link iut
07-22-2011 08:40 AM
Go to your block diagram and right click to open your functions pallette.
Click the tab on the top that says search and just type in "Local Variable"
You will find it.
Place iton your block diagram and it will just be a "?" in a box.
Right click and choose select item, and then select your stop button.
07-22-2011 08:43 AM
After you select it to correspond to your stop button, make sure you wire it to the while loop just like you would a normal stop button.
07-22-2011 09:33 AM
@mahadev wrote:
Still in confusion what u mean by Local variable and how to create iot and link iut
This tells me that you have not done any of the tutorials or read any of the LabVIEW Help. Please take the time to go through the tutorials. To learn more about LabVIEW it is recommended that you go through the introduction material, tutorial(s), and other material in the NI Developer Zone's Learning Center which provides links to other materials and other tutorials. There are also several Technical Resources. You can also take the online courses for free.
Also, please use full words, not text-message-speak on the forums. What is "iot" and "iut"?
07-22-2011 10:00 AM
I think the iot and the iut are the result of a type-o, I even made one myself when i wrote iton and missed the space in between (see my previous posts)