LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VI Server Closing Entire EXE

Solved!
Go to solution

I recently just ran into an issue when transitioning my code into an EXE. I have a main program that is using the VI server to run some other VIs, have them pop up, and then closes them when they are finished running. I have been running it from the development enviornment and everything has been working perfectly. I am able to use the VI server to open multiple VI's, close them, and repeat the process over and over without any issues. I am now trying to create an EXE out of this program. When I try to open the VIs through the VI server, that still works fine but for some reason when these VIs finish running, it closes my entire EXE rather than just the VI I'm trying to close. Any thoughts on why this is only happening in my EXE and how to prevent this?

0 Kudos
Message 1 of 7
(1,874 Views)
Solution
Accepted by Cannon_Controls

We can't debug an image, can you post actual code?  The main VI and all subVIs you made.

 

The only thing that would definitely cause this is if one of your VIs or subVIs is calling the Quit LabVIEW function, can you do a search to check and see if any of them might?

0 Kudos
Message 2 of 7
(1,852 Views)

The point about debugging pictures is correct, and I also don't see anything that would match the description.

 

I will say that if this is the only way you run these VIs, it would be much simpler to statically call the VIs as subVIs and set their properties to show the FP when called and close it when the VI stops running (both are in VI Properties>>Window Appearance>>Customize). That way you only get a subVI call instead of this whole code.


___________________
Try to take over the world!
0 Kudos
Message 3 of 7
(1,812 Views)

If the VI Server is needed for some future complexity, at least try if the exe crashes if you call the VI as a normal sub VI. Then you'd know for sure if the crash is caused by VI Server or something else.

 

If you're using VI server because you're planning on calling other VIs (knights, pawns, I imagine), well, that's what polymorphism is for. OO might seem like a learning curve, but DIY OO will be harder in the end.

0 Kudos
Message 4 of 7
(1,805 Views)

I did originally try using it as a subVI and setting the subvi node setup to have it pop-up and close. That worked perfectly the first time that the vi opened but then I couldn't get it to open afterwards. That's what led me to the VI server. In the same main VI I used this approach with a bunch of other VIs and it worked perfectly. Just this one would crash the EXE but would work fine in the development environment. I ended up just making an EXE out of this VI and calling it using the command line prompts and that works fine so I think I'll just go with that.

 

Also, I didn't post the code as it's over 250 VIs. Genuinely was just wondering if anyone had run into this issue before or if they had any troubleshooting advice.

0 Kudos
Message 5 of 7
(1,794 Views)

@Cannon_Controls wrote:

I did originally try using it as a subVI and setting the subvi node setup to have it pop-up and close.


That's not what was recommended. It should work though.

 

What was recommended was that the VI opens itself (VI Properties>Window Appearance>Customize...>Show front panel when called) and close itself (Close afterwards if originally closed).

 

The 'automatic' option won't work when you call the VI dynamically.

 

If the VI makes LabVIEW crash or close, there's something in it that does this, or the VI is corrupted.

 

Post the VI...

0 Kudos
Message 6 of 7
(1,792 Views)

You were right. I was quitting LabVIEW in one of my SubVIs. Thank you for the help.

0 Kudos
Message 7 of 7
(1,790 Views)