LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to Create Hierarchy Without Creating SubVI Files

Solved!
Go to solution

Hi, 

I have an existing LabView program that uses SubVI blocks.  I want to change it so that I don't need to copy SubVI files to the library (when I transfer the program to another computer).  The goal is to have ONE single file/program that I can copy, paste, and run on other computers.  So I want to know if there is a way to create hierarchy without creating SubVI files or how to embed the SubVI into the program.  My program and the subVI files are attached here.

 

Thanks,

Rocky

0 Kudos
Message 1 of 14
(3,238 Views)
Solution
Accepted by topic author MPS_Rocky

You could create a build into an executable.  That would be the most common way if you insist on having just one file.

 

You could also build a source distribution into a zip file.  Then you just copy and paste the zip file and unzip wherever you want it.


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 2 of 14
(3,233 Views)

Hi rocky,

 

your problem isn't to have all in ONE file:

check.png

That's your VI in the Navigation window (after AutoCleanUp) on a FullHD screen (marked by the brighter rectangle in the upper left corner).

It's way to big and all I can recommend is: Use MORE subVIs!

Best regards,
GerdW


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

You could also make an llb, and even designate the toplevel VI.

 

However, this is ancient technology and not often used anymore.

0 Kudos
Message 4 of 14
(3,224 Views)

How do I make it into an executable?  (That is probably my solution.)

 

I know I have a "large" code; I am still trying to clean up the mess whenever I have free time.

 

Thanks.

0 Kudos
Message 5 of 14
(3,193 Views)

I searched the web on "how to create executable" and I don't think my version supports that feature.  I will probably need to bundle all the subVIs.  Thanks for all the help.  (I kind of know I don't have that feature, that's why I asked if I can "embed" the subVI into the code.)

0 Kudos
Message 6 of 14
(3,189 Views)
What edition of LV are you using? You need the application builder, which is available with either the Full or Professional version.

Regardless, having no subVIs is a very bad (and unnecessary) way of dealing with the situation.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 7 of 14
(3,169 Views)

@MPS_Rocky wrote:

I searched the web on "how to create executable" and I don't think my version supports that feature.


You will need to be using the Project.  You should be using a project anyways to keep your code organized and easily accesible.  But at the bottom of the project tree is a section for Build Specifications.  Right-click on that and you will see an option to create an executable.  You will need the Full or Professional version or LabVIEW to have the Application Builder.


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 8 of 14
(3,138 Views)

In some versions of LabVIEW you can go to Tools >> Build Application.  This simply makes a project, adds your VI to it, and then adds the EXE to the build specifications.

 

But I totally agree that you should be working from a project.  In other programming languages you wouldn't think of opening one file at a time in a text editor, you would open the project in the IDE.  And if you did this you wouldn't think of having just one text file, you would break it up into classes, or other sub-functions.

0 Kudos
Message 9 of 14
(3,127 Views)

The advice you've received here is pretty solid.  Putting everything into the single VI makes your code a bit harder to read.  It sounds like you've inherited code that was already a bit hard to read.

 

The one piece I wanted to add was to bring up the Application Builder tool others have suggested using only comes with the Professional Development System and not with the Full Development System.

0 Kudos
Message 10 of 14
(3,115 Views)