Releasing serial ports to other applications

Recommended Posts

I've made a button component which launches some third-party software for initially configuring an instrument but since it's a serial device so I need to release the COM port first. Setting the port to zero and reinitializing should do it right? Here's my button code:

lastLicorComPort = Device.LI7500.Port  // save & restore after config
Device.LI7500.Port = 0				 // set dummy port
Device.LI7500.InitComm()			   // make the switch
delay(1)							   // catch up computer (?)
System.ShellExecute("LI7500.exe","open","","C:\Program Files\LI7500v3_0_2\","")

...should work right? The port stays locked up though. Not the utility, nor a terminal program nor even the Safely Remove Hardware icon are able to get through. Am I missing a detail somewhere? I certainly don't want to shut down my whole data acquisition system to configure just one of the instruments. Any help is appreciated.

Link to comment
Share on other sites

Using the device configuration dialog, I changed the port # to an unused physical port and went to the monitor window: incoming data stream from the first port keeps coming in. Setting to zero doesn't work, nor does setting to non-existent COM ports so there is no way to release a com port without quitting DAQFactory and waiting for the process to finish?

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.