12-02-2014 10:11 AM
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.
Solved! Go to Solution.
12-02-2014 10:18 AM
Why does the subVI not open/close the panel by itself?
Norbert
12-02-2014 10:35 AM
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.
12-02-2014 10:56 AM
@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.)
12-02-2014 11:10 AM
@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.
12-02-2014 01:10 PM
Thanks
I included the case statement in the sub vi and added the ignore error and everything works fine.