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: 

Splash Loading Screen stacked on mainvi and not exiting properly

Because my MainVi takes around 10 seconds to load,

What I want:

A splash screen that basically loads for 10 seconds while the main vi is loading in the background. After 10 seconds the splash screen goes invisible and shows the MainVi. When the MainVi is closed with FP.Close, the whole program exits.

 

ricky48_4-1629168466891.png

 

What I currently get:

Right now it shows up the windows for both subvi and Loading screen stacked ontop of each other. Loading screen runs for 10 seconds, then runs straight to the FP.close case structure instead of staying invisible as the MainVi is still running and has not been clicked by user to quit yet.

 

ricky48_2-1629167860975.png

 

1) How do I make it so that the user cannot see another window/vi is loading in the background.

2) The loading screen vi seems to go straight to close without waiting for MainVi to exit first.

3) When I click exit that calls FP.Close on the MainVi, it doesnt seem to fully close everything, as closing Labview development software it would still show a warning saying

 

ricky48_1-1629167808041.png

0 Kudos
Message 1 of 7
(1,427 Views)

Found this technique in TS custom user interface,

santo_13_0-1629170009276.png

 

You can find this under "C:\Program Files\National Instruments\TestStand 2019\UserInterfaces\Full-Featured\LabVIEW\Source Code"

Update path with actual TS version.

 

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 2 of 7
(1,413 Views)

I don't have TestStand, and downloading from the site I got TestStand 2020 and couldnt find the example you linked.

 

I updated the block diagram to

ricky48_0-1629179674439.png

Where I pass in the loadingScreen vi reference to the MainVi and allow it to call FP.Close on it instead.

With the changes it all seems to work perfectly until when I package into an executable, the loading screen shows up runs 10 seconds and nothing, the MainVi never shows up anymore.

 

Not sure why packaging into executable breaks it.

0 Kudos
Message 3 of 7
(1,385 Views)

Ah nvm above, the executable build was renaming my MainVi, so that was why.

 

One last thing is, the loading splash screen exits properly, but the MainVi doesn't. It calls FP.Close but when it closes, it pops up the labview window of that Vi with the menu, run, stop buttons as if developing.

0 Kudos
Message 4 of 7
(1,366 Views)

If you don't use VI-Server, but instead make the Splash-VI a SubVI, you don't have any difficulties with path names. And for me it always worked very well to use events to control the behaviour of windows.

See the attached example.

Greets, Dave
Download All
0 Kudos
Message 5 of 7
(1,355 Views)

I implemented the subvi method into my main vi, and the splash screen appears and waits correctly. (count is just for a loading slider)

ricky48_0-1629259648001.png

 

There is another flat sequence that does the mainvi initializing/populating the ui.

 

However, eventhough both flat sequence is running; now like before when i click the executable, it would display the icon as running in taskbar but still takes ~10 seconds before opening the vi which now loads the splash screen and waits another 10 seconds, which sorta defeats the purpose of a splash screen.

 

I'm not sure if it's because opening my mainvi takes 10 seconds, or if its just opening the labview runtime environmen that's stalling.

0 Kudos
Message 6 of 7
(1,329 Views)

Hello Ricky,

 

I suppose the latter.

I've never done this, but I suppose you have to load your main-VI via VI-Server. So the VI shown in your BD above can be seen as a launcher, executing the code before the sequence and the first frame, then calling your actual MainVI via VI-Server in the second frame. Feeding the event-refnum into your MainVI allows you to close the Splash-Win not regarding to a fixed time but depending on the state of the MainVI.

 

P.S. Thinking over it, so the launcher-VI turns into being the Splash-Win 😁

Greets, Dave
Message 7 of 7
(1,320 Views)