LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

referencing an element from cluster

The other subvi. It is in build stages, so wiring maybe all over the place. Any tips on better programming also welcome.

 

V

I may not be perfect, but I'm all I got!
0 Kudos
Message 21 of 42
(816 Views)

VeeJay wrote:

Actually, instead of the big subvi part, I am attaching an example program. Here, I can see that both loops run parallelly (if that is a word) but updates are not continuous on the main vi while subvi's are running. Help!


The eg_mainvi VI is empty. Not going to see much with that. Smiley Very Happy

0 Kudos
Message 22 of 42
(812 Views)

Lol :0 I uploaded the program while it was still open. I guess I didnt save it. Here are the versions that work (hope so)

 

Thanks!

 

V

I may not be perfect, but I'm all I got!
Download All
0 Kudos
Message 23 of 42
(799 Views)

VeeJay wrote:

The other subvi. It is in build stages, so wiring maybe all over the place. Any tips on better programming also welcome.

 

V


You previously attached vi, subvi_elevation.vi, is way too huge.  Anything more than one screen is too big.  You should make use of more subvi's to keep the block diagram small enough to fit one screen.  When a block diagram is this big, it is very difficult for someone else to understand what is happening.  It is also very difficult to debug.  If you turn on highlite execution, you have to constantly scroll all over the place to keep up with the execution flow.  Please try to modularize your code to make it easier to follow.

 

Message Edited by tbob on 06-01-2010 03:06 PM
- tbob

Inventor of the WORM Global
0 Kudos
Message 24 of 42
(798 Views)

initially, I had done this main vi. Both cases in one while loop. Smiley Very Happy

 

V

I may not be perfect, but I'm all I got!
0 Kudos
Message 25 of 42
(792 Views)

Hey tbob! How do I further modularize that code? I think I can put math and error calculations in separate vi's. I do think further modularizing it will make it easier programmatically, but then there would be subvi's within subvi's and too many references. wouldn't that make the program more complex? Anyway, I will try and modularize as much as possible as you said. But, in the example program, that is kind of the problem I am facing with respect to updating main vi from subvi's/.

 

Thanks!

 

V 🙂

Message Edited by VeeJay on 06-01-2010 05:15 PM
I may not be perfect, but I'm all I got!
0 Kudos
Message 26 of 42
(793 Views)

If you are expecting to see the numerical result in your main vi while the subvi is running, it won't happen.  You need to reference for the numeric to do this.  Create a reference for the numeric in main.  Create a new control reference in the subvi.  Wire the main numeric reference to the subvi reference.  Then in the subvi, write to a value property node of the new reference.

 

I fixed subvi 2.  Do the same for subvi 1.  See attached.

 

- tbob

Inventor of the WORM Global
Download All
0 Kudos
Message 27 of 42
(783 Views)

VeeJay wrote:

Hey tbob! How do I further modularize that code? I think I can put math and error calculations in separate vi's. I do think further modularizing it will make it easier programmatically, but then there would be subvi's within subvi's ....

Thanks!

 

V 🙂

Message Edited by VeeJay on 06-01-2010 05:15 PM

I have lots of code with subvi's nested down many levels.  This is called modular programming.  Each subvi has a particular small function.  Put them all together to create a large function.  If you have to pass references far down, so be it.  If you have many references, you could bundle them into a cluster, and pass the cluster to all subvi's.  Then the subvi would have to unbundle to get the proper reference.  Believe me, this will make it much easier to troubleshoot.

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 28 of 42
(781 Views)

@tbob Thanks for the tips! Would it also work if we reference the indicator from the subvi into the main vi just the way we do it for sending values to the subvi? Would two way referencing work?

 

Also, I am working OT and noting down what functions of my existing program can be modularized. I will post you on my progres.. Thanks! 🙂

 

V

I may not be perfect, but I'm all I got!
0 Kudos
Message 29 of 42
(756 Views)

VeeJay wrote:

@tbob Thanks for the tips! Would it also work if we reference the indicator from the subvi into the main vi just the way we do it for sending values to the subvi? Would two way referencing work?


No. Think about. How are you going to connect a main VI's connector pane to the subVI? Smiley Wink

 

To access a subVI's front panel from a higher level VI you need to open a VI reference to the subVI and then navigate the Front Panel property's list of controls. 

Message 30 of 42
(753 Views)