Opening serial connection to Arduino

Hi, I'm clearly a complete noob (+old + cranky + not too bright!) and am working my way through using Arduino, so please keep the above in mind.

I'm using quite a number of example sketches using serial connection and serial print to communicate to the IDE serial monitor. When the sketches are compiled and uploaded serial communication begins and everything is wonderful in the world. However if I disconnect the Arduino (ie break the serial connection) and then plug it back in to the USB cable to the host computer there is obviously no serial connection. If I re-upload the sketch, then the serial connection begins again.

I presume there is a send command from the serial monitor function on the Serial Monitor command line to request a connection, but I don't know what it is, and no amount of searching is helping me.

I guess this is a super basic function I don't understand, sorry about that. But after having 2 consecutive faulty RTC modules and wondering what I was doing wrong (nothing as it turned out) I'd like to see if i can get this sorted.

Thanks

886014: However if I disconnect the Arduino (ie break the serial connection) and then plug it back in to the USB cable to the host computer there is obviously no serial connection.

No serial connection? Are you disconnecting your Arduino with Serial Monitor open? Then expecting serial communications to resume?

886014: I presume there is a send command from the serial monitor function on the Serial Monitor command line to request a connection...

There is a call into the operating system from the application that is initiating the connection.

If you break the connection with the Serial Monitor open and then re-connect the Arduino it probably appears to the PC as a different serial / COM port because the PC thinks the first connection is still in use.

...R

Not under Windows. The handle is "orphaned". When the application (Serial Monitor) interacts with the operating system an error is returned. Forever.

The recovery path is simple. Close the handle then start over.

Ok, well I did say I wasn't too bright ;)

Yes I was breaking the connection with the Serial Monitor window open (using Arduino IDE under Mac if that makes a difference, haven't had as much joy using a Raspberry Pi).

I'm surprised that I hadn't tried just closing the monitor window and reopening it. I didn't expect the serial connection to automatically recommence when plugging it back in, but did wonder if there was a command from that window where it didn't need to be closed and could force a new connection.

Closing it down and re-opening is no big deal for the level I'm at, and thank you all so much for this information so quickly.

886014: Ok, well I did say I wasn't too bright ;)

4th Order Ignorance has nothing to do with intelligence (brightness). In other words, no one is born knowing how the Windows serial kernel driver behaves. We all have to learn that.

In any case, welcome to the forum.