06-22-2009 02:14 PM
Is there a way to tell if the Block Diagram is open when a VI is started? I have a subVI that is set to modal when open. When trouble-shooting, if I run my application, but forget to disable modal for the subVI it causes the system to lock up.
It would be nice if I could set the property of the VI to not be modal if the block diagram was open.
Any suggestions?
Solved! Go to Solution.
06-22-2009 03:14 PM
I would attempt this by doing several things:
1) Go to the VI Properties>Window Appearance and click on the Customize button. From there uncheck the "show front panel when called" box.
2) When the VI starts, read the VI Property "Front Panel Window.State" - this will tell you if the window is already openned (ie if the window is openned the window state will be "standard", "Maximized" or "Minimized"). Note: this is the visibility of the front panel, not the block diagram
3a) If the VI is not already opened, set the "Front Panel Window.Behaviour" property to modal and then open the front panel using the VI Invoke Node of "Front Panel.Open". This is basically mimicking the behaviour you describe right now.
3b) If the VI is already opened, set the behaviour property to default or Floating to allow you to click other windows.
4) When finished, if the VI was not already openned, manually close it using the Front Panel.Close invoke node (if it was already openned, leave it openned)
I've attached a screen shot of this kind of thing. I hope this helps,
Shaun
06-29-2009 08:30 AM
Nice! Thanks for the info. The only thing I changed was that I did not set the behavior to floating, because I did not always want it on top of other windows. I used default instead and set the IsFrontmost property to true so when it is called, it loads as the top window.