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.
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.
07-07-2015 02:56 PM
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.
Solved! Go to Solution.
07-07-2015 03:01 PM
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.
07-07-2015 03:13 PM
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?
07-07-2015 03:23 PM - edited 07-07-2015 03:29 PM
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
07-07-2015 05:02 PM
@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)
07-07-2015 09:33 PM
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?
07-08-2015 06:19 AM
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.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
07-08-2015 06:32 AM
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.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
07-08-2015 09:56 AM
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?
Blog for (mostly LabVIEW) programmers: Tips And Tricks
07-08-2015 01:19 PM
coastalmainebird, it is mostly for debugging purposes.