Basically I need to be able to unplug the Arduino while the serial port is open(basically while I am connected to it in PuTTY, Termite, etc) and be able to plug it back in again without having to quit termite/putty. At the moment, if i unplug it while connected to it in PuTTY, and plug it back in, it still shows up in device manager with the exact same COM port, but i cannot do any serial communication to it despite the COM port being detected.
It is in principle not possible. Application opens the port via Windows API. If port "disappears" the "port open state" disappears too. Only way is close port before unplugging Arduino.
that doesnt make sense. even if i unplug the arduino before closing PuTTY, as long as i close PuTTY before i plug it in again, it will connect no problem.
That's the point. Putty gets a "handle" for the port when you open it. When the port is (forcibly) closed, the handle is broken; it leads nowhere and is not automatically replaced/ reconnected by the OS when you plug the USB in; you have to get a new handle and PuTTY does not expect to need to do such a thing.
The only way to achieve what you're asking for would be to implement your own virtual port driver which kept the port running even when the USB device was unplugged. Although the cleanest solution would be to provide your version of the USB serial drivers providing this capability, if you didn't want to do that then it would be possible to implement it as a serial bridge which connects to the existing USB serial device and presents its own persistent device. So technically it's possible, if you don't mind writing device drivers, but it's a bit ugly. Do you really need to do it? It should be possible to close the port, unplug the device, replug the device and open the port again without having to go to any special lengths.
PeterH:
It should be possible to close the port, unplug the device, replug the device and open the port again without having to go to any special lengths.
Which is to say that if you are writing your own program to interface with it, the program - unlike PuTTY - should detect the removal of the USB device and (with appropriate indication) continue regular searching for the device until it re-appears.
Paul__B:
Which is to say that if you are writing your own program to interface with it, the program - unlike PuTTY - should detect the removal of the USB device and (with appropriate indication) continue regular searching for the device until it re-appears.
That's not what I was trying to say. If you perform an orderly shutdown of the COM port connection before you unplug the Arduino then the COM port should reappear and be available for your chosen serial client to reconnect to, next time you plug the Arduino in. On the other hand if you rip the port away from underneath an application which is not designed to deal with that then of course it is going to end in tears.