LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I create a status window?

Hi,
it should be an easy task neverthelessI have not found anything helpful.

For a measurement program, there have to be done some initialization steps which take some time.
Therefore I want a window appear saying: "Initialization... please wait".
The front panel should be blocked during this time.
After the several initalization SubVIs are done this window should disappear without any user action.

So, it is not a dialog, what is it then...
Thanks for any hints...

Tilman.

0 Kudos
Message 1 of 6
(4,096 Views)
Hi TBe,
 
You can do this in several ways..  all almost equally challenging or simple..
 
For instance, you can create a display which is placed on a Tab which shows the message "Initialization... Please Wait".  This one would not have any controls or buttons.  I would leave the run button accessible on the top window of the vi, just in case you need to stop it if something goes wrong.  If you have a means to determine how far the initialization process is, then place a progress bar.  Usually if it takes more than a few seconds (30s??).  I get impatient looking at non-changing screens... 😉
 
So when running the vi, make this Tab appear on top; thus not giving access to any buttons or controls.  Thereby "blocking" the front panel, or giving the illusion of that (I won't go into details).  You can size the Front Panel and lock it in place, to prevent someone from clicking on the Tab and selecting another screen...
 
After the initialization process, you can change Tabs to the appropriate one which has the controls and buttons you wish to display.
 
 
That was one method..
 
Another method is to use the Property Node for the controls and displays and change their configuration to "Grey" them out, making them unaccessible, or making the "invisible" during the initialization and then making them "Visible" when they become active. 
 
Property Nodes can be accessed by right-clicking a control or display on the Front Panel and selecting Create Property Node.  The property node and the configuration are done on the Control Panel.  Click on the Property Node and select the setting you wish to modify.  Change it to write and wire a boolean in the case of "visible / invisible". 
 
 
Let's start with these (or rather one of these methods).  Let me know if you have some problems.  I unfortunately do not have access to LV at this time, otherwise I would have prepared a quick vi to illustrate both examples.
 
Regards,
 
JLV
Message 2 of 6
(4,078 Views)
There is a more sophisticated solution that isn't too much more complicated.
 
LabView handles loops in a single vi in different threads. That means that two loops on the same block diagram run independently. You can achieve what you are looking for if you put your status window in one loop and your init process in another.
 
The two loops still need to communicate with each other. For that you can use local variables.
 
Find attached  an example of what I mean. I have simulated both the initialization process (inner loop) and the status dialog (modal cancel dialog).
 
The milliseconds elapsed display is only there to show that the top loop is actually running while the dialog is still waiting for you to click it.
 
With only a little more work, you could replace the dialog with a window that reports the status of the init process using a number instead of a boolean (Abort)
0 Kudos
Message 3 of 6
(4,061 Views)
I, personally, think the best solution is to use some helper SubVIs and a Splash Screen VI and use regular data flow to handle the opening and closing.  I developed an example of this last night but I forgot to bring the example with me to post.
 
First SubVI: Opens the Splash Screen VI via open by reference.  You will need to set the option to allow parallel processing so the original VI does not wait around for the SubVI to finish.  Do not close the VI reference.  Pass this out for later use.
 
Splash Screen VI: Set up options in window appearance so there is no title bar, buttons, nothing.  Just a blank window with your message.  The main body is simply a never ending while loop.
 
Second SubVI: Closes the Splash Screen reference by aborting using the reference passed by first SubVI.
 
 
Normal use would be Open Splash wired to your initialize routine wired to Close Splash.  I was testing this last night and it works like a charm.  Also its easy on the eyes as its compact and does not require queues or seperate loops.  I will post my example tomorrow when I have the time... cheers!
0 Kudos
Message 4 of 6
(4,042 Views)
Heres the example I was talking about yesterday.  Code should be self documenting and, where its possible it is not, I have added comments.
 
Main: run this for example
Initialiaze: dummy initialize routine which pauses for 5 seconds
Open Splash: opens the splash screen via call by reference
Splash: splash screen itself
Close Splash: closes the splash screen via reference
 
Enjoy!
Any questions let us know...
 
 
Message 5 of 6
(4,029 Views)
Hi, thank you all,

your numerous and different approaches tell me that I have not overlooked any simple straight forward solution which has been implemented already in a LabView Icon.

Chaos, your solution was ready for copy paste without any changes... Thank you.
That´s what I was looking for...

Thanks & greetings,
Tilman.



0 Kudos
Message 6 of 6
(4,012 Views)