From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to open subvis before software execution?

Solved!
Go to solution

Hi all,

I am wondering if there is a way of opening subvis along with my main vi and having it run the same time the main vi is running?  As soon as I double click on the main vi, I want the subvi front panels to pop up along with the main vi and run them all when I click run on my main vi.  Thankyou.

0 Kudos
Message 1 of 13
(3,548 Views)

Just put these VIs in your main VI and have them run in parallel with you main code.  That is the simple way to do 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 13
(3,538 Views)

So if I put it in a parallel while loop with my main program, it will open the the front panel of the subvi as well before execution?

0 Kudos
Message 3 of 13
(3,524 Views)
Solution
Accepted by topic author BigDallas

To get the sub vi's FPs to open when they are called, go to file>>VI properties, select the Window Appearance option from the dropdown, click customize, and check off "Show front panel when called"

 

That will at least open the front panels of the Sub-vis as soon as they are called in the main vi.

 

As for Having all the FP's open just by opening the main vi but before running the main vi, I'm not sure. 

 

Edit: a Typo

 

Edit 2:  Beneath "Show front panel when called" is another option.  "Open front panel when loaded."  It looks like that does what you want.  Check that off for all of your sub vi's

Message 4 of 13
(3,515 Views)

@BigDallas wrote:

So if I put it in a parallel while loop with my main program, it will open the the front panel of the subvi as well before execution?


Do the subVIs already have While loops in them?  If so, you do not put them in another While loop.  You just call them to be in parallel with the rest of your code (ie no data dependencies)


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 5 of 13
(3,459 Views)

What is it you're hoping to accomplish with three front panels that you can't accomplish with one?

 

You've never used a program before and said "excel is pretty amazing... but you know what would make it even better?  if it opened three windows for me to deal with instead of one" have you?

Message 6 of 13
(3,406 Views)

You've never used a program before and said "excel is pretty amazing... but you know what would make it even better?  if it opened three windows for me to deal with instead of one" have you?

 

 

Well, no, but all Excel windows look alike.  I have an app now with 15+ windows (and counting). They're all running at once, and they could all be shown at once, if you like.

And they don't all look (or work) alike.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 7 of 13
(3,345 Views)
Solution
Accepted by topic author BigDallas

Yes, there are two steps.

 

1... Place your subVIs on the diagram of the main VI, outside of any loops or cases or anything else.  This will make them run whenever the main VI runs.

2... Set the SubVIs to OPEN FRONT PANEL WHEN LOADED on the WINDOW APPEARANCE - CUSTOMIZE pane.  This will make them open whenever th main VI opens.

 

You should realize several things:

1... You have to have an event loop in each subVI that handles controls from that VI's panel.

2... You have to provide a signal (Event, notifier, occurrence, etc..) to the subVI to quit, whenever the main VI quits.  ABORT is not a good plan.

3... Debugging is a bit more complicated.  If you hit a breakpoint on one VI, the others are still running.  If you ABORT one VI, the others are still running.

4... You have to share the CPU.  You can't do stuff like poll the GO button a million times per second in one VI, because you'll starve the other loops.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 8 of 13
(3,330 Views)

I'm just curious, BigDallas, what are you trying to do with this arrangement?

 

I've been programming LabVIEW since 1989, and never ever have used the OPEN PANEL WHEN LOADED option.  Not one time.

 

I have them RUN when the main VI runs, but have never needed to OPEN them when the main VI opens.

 

How is this useful for you?

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 9 of 13
(3,283 Views)

coastalmainebird, it is mostly for debugging purposes.  

0 Kudos
Message 10 of 13
(3,241 Views)