06-08-2015 12:35 AM
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
06-08-2015 01:09 AM - edited 06-08-2015 01:09 AM
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.
06-08-2015 01:23 AM
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
06-08-2015 02:04 AM
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.
06-08-2015 02:10 AM
@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
06-08-2015 02:17 AM
Since i have 26 outputs in subi , how to conncect to indicators of main vi.
06-08-2015 02:24 AM
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.
06-08-2015 03:22 AM
I am getting outputs in sunbi in so many if condition , how can bundle this and pass to cluster.
Regards
Punith
06-08-2015 03:26 AM
If you want to hear opinions, post the subvi here, please. In a vesion 2012 or older is preferable.
06-08-2015 03:52 AM
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