On Sunday 09 September 2001 04:46 pm, Ken G. Brown wrote:
Hi, I too am now playing with serial ports, both on my Mac at home and on a Windows 2000 machine at work...not having a whole lot of luck so far although I have managed on W2000 when the ports are connected by a null modem cable, to read on com2 what I've sent out on com1. So far am unable to similarly read from an external device.
On the Mac, you may have to re-boot with AppleTalk not using the modem/serial port for things to work (per Mark Guzdial).
Well, note first that you have to set up the serial port parameters before you open the port.
Second, make sure that your handshaking is set up right. And that your cables are connected OK. And that your external device does the right thing with handshaking.
Also note that the serial port read is NON BLOCKING. So pay attention to your return values, especially to the number of characters read. You may well get no characters. Be sure to use a Delay when polling the serial port so that you don't starve other Processes.
I've posted here before helping people with their serial problems; perhaps a search of the list archives would help.