07-29-2011 12:30 PM
Hello,
I have another project that sends the Labview window to minimize. Then when a PLC process completes, a bit is read, and the labview window opens and a dialog box asks if a printout completes. My question is that the bringing window to the front part of my program is very unreliable, especially if one or more windows have been activated/opened and worked on. How can I make that function more robust?
07-29-2011 02:46 PM
galimba, can you show us the function you are talking about? What is the code you are using to control the LabVIEW window you are talking about?
07-29-2011 04:07 PM
Here's the program attached. I think it might be easier to call a subVI that controls the front window panel, but I'm not sure.
07-29-2011 04:56 PM
I don't understand why you're trying to bring the calling VI to the front. The VI's front panel does not need to be shown in order to see the dialog box.
07-29-2011 05:05 PM
The assumption there was that if the calling vi window is up front, then the dialog box would pop up in front of that, making it the front-most window. Not elegant, but about 50% successful.
07-29-2011 05:33 PM
But you don't need to do so, right? All you need is the dialog. In fact, you don't even need to do that, as you can write your VI so that it behaves the same way. See attached for an alternative.
07-29-2011 05:48 PM
I would suggest following altenbach's advice. There is no need opening a fp of a vi if it does not need to be opened. The dialog box will open on its own, regardless of what vi it happens to be in.
07-29-2011 06:04 PM
is smercurio = altenbach? I'm confused. . .
Well, I kind of stripped the vi down to the basic parts in question. So a report is generated that reads filename entered into a directory. That report then gets printed and the dialog box should pop up to the front - asking if the report printed correctly. How do I get more control over the popup dialog box? If the Report Txt Gen MOD.vi is used as the dialog, by calling it as a subVI, that vi would become the active window (with some vi call tweaks)?
07-29-2011 06:34 PM
Sorry, no. I thought it was Altenbach who posted. Follow smercurio's advice.
07-29-2011 08:21 PM
@galimba wrote:
is smercurio = altenbach? I'm confused. . .
Hah! Don't I wish!
Well, I kind of stripped the vi down to the basic parts in question. So a report is generated that reads filename entered into a directory. That report then gets printed and the dialog box should pop up to the front - asking if the report printed correctly. How do I get more control over the popup dialog box? If the Report Txt Gen MOD.vi is used as the dialog, by calling it as a subVI, that vi would become the active window (with some vi call tweaks)?
The VI I uploaded is configured to show itself when called and close itself afterwards. If you place it in the block diagram of a VI and run the higher level VI you will see this. What kind of control are you looking for?