LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to stop execution in while loop without stopping execution of other loops in the same vi

Don't mind - just post a picture to keep me up do date Smiley Wink.
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
Message 11 of 20
(1,733 Views)

Dear Dev and Thomas

Thanks a lot for your reply. Both your vis solved my first problem, stopping the execution of both while loops using one control. But I still have another problem. The subtract button doesn't work at all and as soon as I stop execution of while loop the vi stops execution. All that I want is to stop the while loops after getting the array and then to subtract or compare specific values in the arrays, but not to exit from the vi. 

It seems like I can't pass any values out of the while loops, also I can't access the arrays from outside and stopping the while loop stops or reinitializes (if Labview runs in continuous mode) the arrays and in either cases the subtract button doesn't work at all.

Thanks guys again for your help and looking forward to get replies from you.

Rahul

 

0 Kudos
Message 12 of 20
(1,709 Views)

Hi Rahul,

In the attached VI, i have brought the subtraction case inside one of the loops.

So, you can subtract before stopping the VI.

the same can be done with Thomas's solution too

Regards

Dev

0 Kudos
Message 13 of 20
(1,695 Views)

Hi Rahul

I modified my vi, so that you don't have to use "run continuously" (by the way - I almost never use this). The subtraction of the two elements works without any problems.

If you don't want the arrays to be reinitialized, either use a shift register with the outer loop too. But there are also other ways to do this.

You just basically have to understand the principle of dataflow (search the forums for this words, and I'm sure you will find several threads).

Thomas

Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 14 of 20
(1,691 Views)

Thanks to both of you very much again. That helped me a lot.

But all that I wanted was to access any data or control to or from inside the while loops from outside (using local variable or direct wiring) the while loops ie from other part of the program running parallelly to these loops. In your programs,I have to bring the case structure inside the while loops to make it work. But I just want to keep it outside and access data from the array generated inside.

I don't have good knowledge of dataflow. Is it like I have to use global variable to store the data or control reference inside to access it later from anywhere outside the loop??

Thanks again

Rahul

 

0 Kudos
Message 15 of 20
(1,689 Views)

There are several possibilities to do this, depending on the general design of your application.

Just for instance you could use local or global variables, LV2-style globals, queues and so on.

I'd suggest you to have a look at the LV manual (lvuser.pdf), which should be located in the manuals directory of your LV installation. It is important to understand the basics.

Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 16 of 20
(1,686 Views)

Sorry becktho.

I was in a meeting....Here is the pic,I took care of the subtraction problem.

Ohiofudu.

Certified LabVIEW Architect
Certified TestStand Architect
0 Kudos
Message 17 of 20
(1,680 Views)

Hi Ohiofudu,

For some reason, i cannot see the pic you ahve posted

Regards

Dev

 

0 Kudos
Message 18 of 20
(1,664 Views)

Hi Dev

Try this one ....I dont know what went wrong.

Regards.

Ohiofudu

Certified LabVIEW Architect
Certified TestStand Architect
Message 19 of 20
(1,662 Views)

Ohio that's also a nice solution.

Often there are so many things which can be simplified...

Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 20 of 20
(1,656 Views)