LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Global variable value update to indicator on run time

sorry here will be subvi

0 Kudos
Message 11 of 58
(1,214 Views)

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

0 Kudos
Message 12 of 58
(1,201 Views)

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.



Remember Cunningham's Law
Message 13 of 58
(1,186 Views)

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

0 Kudos
Message 14 of 58
(1,177 Views)

@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

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 15 of 58
(1,174 Views)

HI,


Could you give any examples, still i did not understand.

 

Regards

Punith

0 Kudos
Message 16 of 58
(1,167 Views)

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.



Remember Cunningham's Law
0 Kudos
Message 17 of 58
(1,157 Views)

See attached at how it can be solved.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 18 of 58
(1,149 Views)

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.

0 Kudos
Message 19 of 58
(1,141 Views)

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

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 20 of 58
(1,137 Views)