LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is Block Diagram Open

Solved!
Go to solution

Is there a way to tell if the Block Diagram is open when a VI is startedI have a subVI that is set to modal when openWhen 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?

 

 

0 Kudos
Message 1 of 3
(2,507 Views)
Solution
Accepted by topic author nate

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 

 

Message 2 of 3
(2,489 Views)

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. 

 

 

0 Kudos
Message 3 of 3
(2,437 Views)