01-10-2006 07:35 AM
01-10-2006 07:43 PM
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
01-10-2006 10:40 PM
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
01-11-2006 12:26 AM
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
01-11-2006 01:39 AM
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
01-11-2006 01:50 AM
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.
01-11-2006 03:19 AM
Sorry becktho.
I was in a meeting....Here is the pic,I took care of the subtraction problem.
Ohiofudu.
01-11-2006 04:56 AM
Hi Ohiofudu,
For some reason, i cannot see the pic you ahve posted
Regards
Dev
01-11-2006 05:50 AM
Hi Dev
Try this one ....I dont know what went wrong.
Regards.
Ohiofudu
01-11-2006 05:57 AM
Ohio that's also a nice solution.
Often there are so many things which can be simplified...