06-08-2015 03:54 AM
sorry here will be subvi
06-08-2015 04:36 AM
Since my subvi is recursive sub vi , i understand that i cant use cluster to bundle and unbundle in main.
Only i have to do is i need to pass each value which is i am getting in subvi to the main vi indicators.
How to do this.
Regards
Punith
06-08-2015 06:04 AM
What is it with you and in place structures? You have been told in several other threads not to use them and I would suggest you follow that advice. Then, I don't see that this VI is calling itself recursively- it couldn't possibly since it's set to execute non-reentrantly.
As for your question: What is the problem with placing a bundle node after the case structures, connecting all the values to it, then creating an indicator and connecting it on the connector pane so you can access it from the main vi?
In the other threads you have started, you were given links to tutorials. I don't like being the "rtfm"-guy, but you should take a really good look at them. I see a lot of your problems resolving once you understand the concepts behind LabVIEW as a development tool. This will save you loads and loads of time in the long run and get you to your goal much quicker than opening all those threads. Also, you should start dishing out kudos to all the people that have so patiently helped you in those threads.
06-08-2015 07:33 AM
Hi Peter,
Thanks for your reply, OK now onwards i am not using "in-place-element structure". I am parallely studying in tutorial also.
Yes my subvi is recursive but i shared only some dummy subvi for testing.
I cant use cluster to bundle data and then unbundle to pass the value to main vi, because in subvi calculation is keep on going for some time(since it is recursive i may get output twice for a single indicator).
So i cant use cluster.
Instead of that i want to pass value to indicator of main vi from sub vi. How to do this?.
I have 26 outputs in subvi and all are of differenent data types.
Regards
Punith
06-08-2015 07:47 AM
@punee wrote:
Instead of that i want to pass value to indicator of main vi from sub vi. How to do this?.
I have 26 outputs in subvi and all are of differenent data types.
You can generate a User event which the main vi listens to that updates indicators. If the event bundle e.g. a Name and a variant (Value) you can make a case with the Names as selector and variant to data to get the correct data type.
/Y
06-08-2015 07:50 AM
HI,
Could you give any examples, still i did not understand.
Regards
Punith
06-08-2015 08:12 AM
OK,
I do not (!) endorse this idea, as I am not a fan of global variables, but it is possible to create a global variable with the datatype "cluster". That way you can safely pass data from your SubVIs to your MainVI without having to create 26 global variables. By safely I mean you will never know when this has updated, but it's a quick fix for your problem.
Other than that I would go for a solution based on a queue or a user event like Yamaeda suggested. That way you can be sure when something has updated. There are plenty of examples that come with LabVIEW and show you how to do it. "Simple Queue.vi" should show you how to use queues.
06-08-2015 08:26 AM
See attached at how it can be solved.
/Y
06-08-2015 08:47 AM
Hi
Thanks for your kind reply. OK I understand the logic here. But what will happen if subvi is recursive. This will not work at that time.
06-08-2015 08:49 AM
As long as you send the User event reference down the recursion they'll send the same type of event and Main will listen.
/Y