LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I am using two while loops in labview .. i want a single stop button to stop the both things

I am using two while loops in labview .. i want a single stop button to stop the both things.

 

Please help me

 

thanks

mahadev

0 Kudos
Message 1 of 26
(6,882 Views)

Hi,

 

Use the local variable of your stop dutton in second loop.

Thanks and Regards
Himanshu Goyal | LabVIEW Engineer- Power System Automation
Values that steer us ahead: Passion | Innovation | Ambition | Diligence | Teamwork
It Only gets BETTER!!!
0 Kudos
Message 2 of 26
(6,881 Views)

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

0 Kudos
Message 3 of 26
(6,870 Views)

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

Message 4 of 26
(6,863 Views)

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.

0 Kudos
Message 5 of 26
(6,862 Views)

Still in confusion what u mean by Local variable and how to create iot and link iut

0 Kudos
Message 6 of 26
(6,854 Views)

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.

0 Kudos
Message 7 of 26
(6,850 Views)

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.

0 Kudos
Message 8 of 26
(6,847 Views)

@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"?

0 Kudos
Message 9 of 26
(6,834 Views)

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)

0 Kudos
Message 10 of 26
(6,820 Views)