LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Closing a Com Port

I have a CVI application that utilizes a DLL (developed by someone else) that calls a DLL (developed by someone else) to initialize/open the com port to be used in my application.
 
This is OK for me because I dont need to worry about which com port I am using, but the only problem is when I exit my program the com port is still open and will not close out until I terminate execution of my CVI program. I guess because the DLL that opened the com port does not know when my program exits.
 
My question is, can I close a com port from within my application not knowing exactly which com port I am using?
 
In my testing obviously I know what com port I am using and when I try to do a CloseCom(4) it still does not close out the com port that I am using and obviously from a task manager perspective my program is still running.
 
Any ideas, Thanks.
0 Kudos
Message 1 of 3
(3,422 Views)
I think CVI can only close comport if it is opened by cvi. Dll must close comport once you call its deinitialize function if it has any.
I also noticed that in CVI closes comport itself after you exit/stop debug application even if you don't call CloseCom function from cvi application.
Thanks.
CVI 2010
LabVIEW 2011 SP1
Vision Builder AI 2011 SP1
0 Kudos
Message 2 of 3
(3,403 Views)

Is there a Windows Command or some sort of override command that will close the com port out for me? Because I dont have access to the DLL that initialzied the com port. Is there anyway I can close that com port at all?

Otherwise my problem will never exit out correctly until that com port is closed.

Any suggestions?

Thanks 

0 Kudos
Message 3 of 3
(3,356 Views)