NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I force a serial port to close?

Hello,

My TestStand app calls CVI C functions that use the serial ports. Sometimes during debug, CVI will close while a serial port is still open.
From that time on, CVI thinks the port is in use by windows, and can't close or open it.
Is there a way (short of rebooting the PC) to force the port to close, even though CVI thinks something else is using it?

Thanks for the help,
Jim Polstra
0 Kudos
Message 1 of 5
(8,811 Views)
Jim,

I don't know much about CVI, but did you try "Unload all Modules" from the Sequence Editors "File" menu?

Regards
Herbert
0 Kudos
Message 2 of 5
(8,811 Views)
"Unload all Modules" does not close the port. In fact, the port is still open even if I exit TestStand and CVI, and then open them again.

It's Windows itself that thinks the port is still open, so I'm looking for an SDK or API (I think)function that will force it to close.

Anyone have any ideas?

Jim
0 Kudos
Message 3 of 5
(8,811 Views)
The Win32 Communications API is documented here:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/devio/base/communications_functions.asp

The Win32 DDK for Serial and Serenum is documented here:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/serial/hh/serial/sseovr_32g7.asp

Jason F.
Applications Engineer
National Instruments
www.ni.com/ask
0 Kudos
Message 4 of 5
(8,811 Views)
How are you calling the CVI-RS232 functions? Are you calling the cvirte.dll directly from TestStand or did you create a dll/exe file in CVI? I've been trying to reproduce your problem but haven't been able to.
0 Kudos
Message 5 of 5
(8,811 Views)