LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Open close sub vi front panal

Solved!
Go to solution

I have a sub vi which returns a true or false. I'm using a case statement to open and close the front panal of the sub vi.  If true I'm using a invoke FP:Open to open the sub vi and if false I'm using an invoke FP:close to close the front panal. The sub vi and case structure or inside a while loop. My problem is if a false is returned without the front panal already being open an error occurs. Is there a different setting I should be using or is there a way to determine if the front panal is closed so I don't use the invoke FP:Close?

 

Thanks.

0 Kudos
Message 1 of 6
(3,198 Views)

Why does the subVI not open/close the panel by itself?

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 6
(3,196 Views)

I didn't think of doing it that way. If I use FP:Open and FP:Close depending on true or false value I still get an error if False and the front panel is already closed. I don't know of another way to open and close the front panel based on the condition.

0 Kudos
Message 3 of 6
(3,172 Views)

@Knoebel wrote:

I didn't think of doing it that way. If I use FP:Open and FP:Close depending on true or false value I still get an error if False and the front panel is already closed. I don't know of another way to open and close the front panel based on the condition.


I usually code stuff like this literally first (i.e., case statement for T/F) because that is how I picture the logic in my mind.  Then immediately it gets optimized to use the Boolean output directly.  Most people can probably combine the two steps in their head.  I have to write it out before optimizing.

 

That being said, you can always trap that particular error code right after and deal with it.  (Probably even swallowing that error code would work.)

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 4 of 6
(3,163 Views)
Solution
Accepted by topic author Knoebel

@Knoebel wrote:

I didn't think of doing it that way. If I use FP:Open and FP:Close depending on true or false value I still get an error if False and the front panel is already closed. I don't know of another way to open and close the front panel based on the condition.


Yes, you will get an error if you try to close a panel that is not open.  Just ignore the error with the Clear Specific Error.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 6
(3,154 Views)

Thanks

 

I included the case statement in the sub vi and added the ignore error and everything works fine.

0 Kudos
Message 6 of 6
(3,134 Views)