LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Global variable value update to indicator on run time

HI All,

 

I am doing some task in subvi which is giving outputs which is of string ,  numeric and booolean format. These ouputs i need to pass to indicators of main vi.

So what i did is , i conncected output of subvi to global variabel and the same global variable i connected to indicator of main vi.

But the indicator value is not updating during run time. it is updating when i stop run and then run the application.

Why is it so?. Could any one suggest how to update during run time itslef?.

 

I have total 26 outputs in my subvi. So is it good using 26 global variabel or any othe way to do?.

 

Regards

Punith

0 Kudos
Message 1 of 58
(3,658 Views)

Hi Punith,

 

do you have somehow ensured that the reading from global variable is done after writing into it? That would explain why you see the value after a new run, only that it is the value from last run.

 

Further, having 26 outputs on a SubVi is not a good design. I suggest using clusters with their bundle/unbundle functions.

 

Cheers,

J.

0 Kudos
Message 2 of 58
(3,637 Views)

Yes it is true.

 

But how to use clusters for indicators?.

 

I also studied some call by reference idea to update main indicator from subvi. Is this way is good for 26 outputs ?.

 

Or  Can i use clusters itslef?.

 

Regards

Punith

0 Kudos
Message 3 of 58
(3,627 Views)

Q: But how to use clusters for indicators?

A: Easy. In block diagram, copy your cluster with controls and then right click and select "Change to indicator". Have you done this: http://www.ni.com/white-paper/7571/en/

?

 

Q: I also studied some call by reference idea to update main indicator from subvi. Is this way is good for 26 outputs?

A: Not a good idea, until you are absolutely familiar with dataflow (normal wires).

 

J.

0 Kudos
Message 4 of 58
(3,610 Views)

@punee wrote:

So what i did is , i conncected output of subvi to global variabel and the same global variable i connected to indicator of main vi.


Why not connect the subvi's outputs to the main vi's indicators directly?

/Y

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

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 5 of 58
(3,599 Views)

Since i have 26 outputs in subi , how to conncect to indicators of main vi.

0 Kudos
Message 6 of 58
(3,588 Views)

Bundle in the subVI, create cluster output in SubVI, connect unbundle or unbundle by name in Main VI and connect the indicators to the Unbundle node.



Remember Cunningham's Law
0 Kudos
Message 7 of 58
(3,584 Views)

I am getting outputs in sunbi in so many if condition , how can bundle this and pass to cluster.

 

Regards

Punith

0 Kudos
Message 8 of 58
(3,555 Views)

If you want to hear opinions, post the subvi here, please. In a vesion 2012 or older is preferable.

0 Kudos
Message 9 of 58
(3,550 Views)

Here i attached my subvi which of only for test vi(int this i have total 6 outputs), kinldy tell me how to pass all this to main vi.

Remember my subvi is recursive subvi. so some times i may recall subvi.

 

Regards

Punith

0 Kudos
Message 10 of 58
(3,536 Views)