patrickokeeffe Posted July 30, 2010 Share Posted July 30, 2010 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 More sharing options...
AzeoTech Posted July 30, 2010 Share Posted July 30, 2010 Try setting it to an non-existant port # instead, say port 21. Link to comment Share on other sites More sharing options...
patrickokeeffe Posted July 30, 2010 Author Share Posted July 30, 2010 I went ahead and tried using non-existent ports like 21 & 36 - DAQFactory threw the error 'Unable to initialize Com...: Can't access port, probably in use by another app" in each case. Perhaps I need a real, but still available, port to switch to? Link to comment Share on other sites More sharing options...
AzeoTech Posted August 2, 2010 Share Posted August 2, 2010 Nah, just let it throw the error. Just ignore it. Link to comment Share on other sites More sharing options...
patrickokeeffe Posted August 4, 2010 Author Share Posted August 4, 2010 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 More sharing options...
AzeoTech Posted August 5, 2010 Share Posted August 5, 2010 No, there's something else going on here. Do you have other serial ports listed in your Serial/Ethernet configuration window? Did you open up any old drivers, like the old Modbus driver? Maybe you can post your .ctl doc? Link to comment Share on other sites More sharing options...
BeeHay Posted August 5, 2010 Share Posted August 5, 2010 Would it help anything to do a Purge() first? Just a thought. Link to comment Share on other sites More sharing options...
AzeoTech Posted August 6, 2010 Share Posted August 6, 2010 No, that would just clear daqfactory's internal buffer. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.