11-23-2011 02:58 AM
I have a simple sub that just has a For loop with the usual index. I want to pass the index to the main vi program and first tried pasing through a wire and connector output to the sub. However, the index does not pass since the loop is busy in the sub. I can use a Global variable but the index just goes to the global variable front panel. How do I get the index numerical value to the front panel of the main vi?
Solved! Go to Solution.
11-23-2011 03:11 AM
Do you want pass all the values as from 0 to 500 in array or you what to pass one by one.
11-23-2011 03:55 AM
Hi,
Did you try using a functional global? Chek out the attached example.
Regards,
NitzZ
(Give Kudos to good Answers, Mark it as a Solution if your problem is Solved;))
11-23-2011 04:14 AM
Create a reference to your Index in your main.vi and pass this to the SubVI. In your SubVI write your index value to the Property Value.
Dont forget to include the reference on you connector pane
11-23-2011 04:20 AM
Hi,
You can also try this approach using the control refernce. Though i would suggest the Functional globals.
Regards,
Nitzz
(Give Kudos to good Answers, Mark it as a Solution if your problem is Solved)
11-23-2011 06:42 AM
example
11-23-2011 10:43 AM
Thanks but I am a bit confused as to what to put in the main prog. I have this (attached) but it doesn't work.
11-23-2011 10:56 AM
Ok I got it now. Great solution - simple.
11-23-2011 11:58 AM
Fascinating but too complex
11-23-2011 03:28 PM
only problem is when you press the stop button, you have to wait until the 500 iteration of the For loop has complete which is why I changed the subvi to a while loop so that the button is passed down too the subvi to stop the while loop as well.