From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Code starts in the end

Solved!
Go to solution

Hey guys.

 

I have some akward thing happening with my vi.

 

I have this game I've created, and it all runs inside a while loop that ends on a button click.

 

Anyway, I have made a propery node "FP.OPEN" and gave it a False constant so that whenever the while loop ends it will close the current VI (since this vi is basiclly a sub-vi getting called from another vi, and I dont want to see it anymore once I am finished with my code).

 

For some reason I saw the window instantly shuting down, so I decided to test it and replaced it with a msgbox instead.

 

To my surprise, the msgbox has instantly appeared (may i remind you, the msgbox is in the END of the code)

 

Could someone figure this out?

 

Thank you very much! 🙂

 

*a link to my VI for reference:

 

https://www.dropbox.com/s/n5k3faaf9vkb80i/Special.vi?dl=0

 

 

0 Kudos
Message 1 of 4
(3,013 Views)

Most Likely you have the VI Properties for Windows Apperance left at the default for a "dialog"

 

You do not want that behvior so you need to change the vi properties to what you desire

 

I often just handle those pesky properties inside the vi explictly

Capture.PNG


"Should be" isn't "Is" -Jay
Message 2 of 4
(3,005 Views)

Nope, I double checked that this is the same as my other sub-vi's which work perfectly.

 

Also, could you please explain what this code is doing?

0 Kudos
Message 3 of 4
(2,999 Views)
Solution
Accepted by topic author DannyShulman

Your while loop is not inside the sequence structure, but floating over it (do a diagram cleanup to see). This means the the FP close happens as soon as the second frame is entered. (even if the while loop were part of the frame, the fp-close would run in parallel and still close down the FP immediately. You should at least place it in the last (now empty) frame.)

 

As an advice, please consider restructuring the program from scratch as a state machine. None of the local variables or sequence structures are needed. Once you consolidate all the duplicate code, the entire diagam would probably fit on a postcard.

Message 4 of 4
(2,996 Views)