LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why won't VB ActiveX exe shutdown after using Automation close in Labview

I built an instrument driver in Visual Basic and created an ActiveX EXE server to call it from Labview (since I need to see a non-modal form (a progress bar showing time left to scan), I can't make it a dll).
The problem I have is that when the program ends, I call Automation Close to close the refnum yet the activeX exe still remains running. It may have something to do with the com port. When I run the server only calling methods that do not actually talk to the instrument, I can close it down. When I initialize the com port however, the server no longer closes down and the com port remains open.
I created another method to explicitly close the com port before I call Automation Close
but the activeX exe still remains running. When I disable the progress bar from showing and create an ActiveX dll, everything closes fine, but I would like to show the progress bar. Is there something in Visual Basic I need to do to check that it has no callers to it and close down? Any ideas?

Thanks, Trish
0 Kudos
Message 1 of 2
(2,642 Views)
You could always try setting up a type of communication where LabVIEW makes a call to the ActiveX server to shut it down. For example, you implement a function in your VB program which, when called, closes the COM port and calls End(). Just call this function from LabVIEW when you are finished and it should close out. It's worth a try.
J.R. Allen
0 Kudos
Message 2 of 2
(2,642 Views)