LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VI Hierarchy

Solved!
Go to solution

Hi, 

I got 5 VIs, 1 which is the main frame created by me and the other 4 is for collecting data from different smart meters created by my friend. However, under the VI hierarchy, the 4 VIs for collecting data is not under the main frame. I would like my main frame to read data from the 4 VIs. Currently they are all on the same level on the hierarchy chart. Is there any way I could edit the VI hierarchy?

 

Download All
0 Kudos
Message 1 of 8
(3,396 Views)

VI Hierarchy shows the way the VIs are arranged within your program. To change this, change the way your main VI is written.

 

However, it seems like you're asking the wrong question. Usually the hierarchy windows are useful as a debugging/informational tool, but not considered a design input.

Probably calling the 4 VIs within the main VI will do what you want, but there may be complications depending on the design.

 

As a side note, attaching the actual VIs rather than an image with default icons would make it easier to give further help 🙂


GCentral
0 Kudos
Message 2 of 8
(3,369 Views)

Hi, 

Thank you for your quick response. May I know how do I call the 4 VIs within the main VI? Attached is my current progression. Main Frame is my main VI, while Metergroup1, Metergroup2, Metergroup3 and Metergroup4 are the 4 VIs which I want to call. I also attached a picture of how I want the hierarchy to become. 

Download All
0 Kudos
Message 3 of 8
(3,339 Views)
Solution
Accepted by topic author Olso

1. Add all of your VIs into a project.

2. Drag a VI from your project onto the block diagram of your main VI.

 

You can also use the "Select a VI..." from the palettes to open a file browser to select the VI to put on your block diagram.  Sounds like you should really check out the free online tutorials.  Links are at the top of the LabVIEW forum.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 8
(3,335 Views)

I *think* what crossrulz wrote would work for you.

 

Looking at the code, I'd suggest you might make it easier to read if you could remove some of the seemingly duplicate globals/Network Variables - I guess probably the NVs are for physical channels so you need both in each case but I'm less sure about the duplicate NodeASG ON, NodeASG OFF etc, especially when they are doubles (why not boolean?). The "Off" channels appear to have inverted logic, which makes it a bit confusing...

 

Programmatic access for the Network Shared Variables would allow you to reduce the size of the Main Frame.vi even whilst retaining all of the variables by building a (reentrant) VI that takes a reference and does the =1, =0, current boolean and then timing circuit bit. You can see an example of this by right clicking on one of the nodes and choosing "Replace with Programmatic Access", and then you can wire the same reference into the second one.

Programmatic access for the top caseProgrammatic access for the top case

 

As it is, changing the timing delay for any one circuit will affect all of the others because they're in the same outer While loop.

Here using a split subVIHere using a split subVI

You could go further and make a subVI which takes the ON, OFF, Node boolean and the pair of Variables as inputs (perhaps using a cluster) and then had both of these instances of the subVI inside.

 


GCentral
0 Kudos
Message 5 of 8
(3,325 Views)

Thank you for your help, it was what I needed. Sorry, where can I check those free online tutorials as I did not see those links on the top?

0 Kudos
Message 6 of 8
(3,162 Views)

Thank you for your reply, I will try your suggestion and improve on my design. Pardon me if I got any additional questions in the future. 

0 Kudos
Message 7 of 8
(3,161 Views)

Hi Olso,

 


@Olso wrote:

Sorry, where can I check those free online tutorials as I did not see those links on the top?


See here:

check.png

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 8
(3,157 Views)