in reply to Perl on Windows insists on waiting for serial port's RLSD(DCD)

I am trying to use an RS232 port (via FTDI on USB) and have unexpected trouble: Perl complains that the port is blocked since it has to wait for RLSD(DCD). I spent hours in the Internet to find and try solutions ... but no luck. I even soldered a bridge between DTR and DCD, set DTR to active, and could confirm the physical level change ... still a blocked port.

Hi. From your description it sounds like you are attempting a loopback connection on your serial adapter. For loopback without hardware flow control you only need to connect RXD and TXD, pins 2 and 3 on a DB9 serial connector. For hardware flow control you also need to connect DTR with DSR ( pins 4 and 6 ) and RTS with CTS ( pins 7 and 8 ). National Instruments has a tutorial about serial loopback testing.

The next step would be to verify that your hardware works. You can do that with Hyperterminal or another terminal program such as PuTTY. With echo 'on' in Hyperterminal you will see what you type but you should see it doubled as it is received back on the RXD pin. It's been a while since I've used Hyperterminal but the setup is pretty simple, something like tell it the com port, baud, etc.

Finally you might start off with some of the example scripts in the distribution for Win32::SerialPort. Download the tar.gz file and look in the 'eg' folder for stty.plx or try some of the other demo scripts. Let us know what progress you make. I am curious what the application is or if this is just a test.

  • Comment on Re: Perl on Windows insists on waiting for serial port's RLSD(DCD)

Replies are listed 'Best First'.
Re^2: Perl on Windows insists on waiting for serial port's RLSD(DCD)
by UltraDMA (Initiate) on Jan 23, 2016 at 19:27 UTC

    Hi!

    Thanks for your reply!

    Well, in fact I want to do some "real" data transfer but at first wrote a simple 4 bytes out 4 bytes in test to see how it works. The application I head for, is communication with an embedded system via a console port. That system does not understand any handshaking, therefore my first test uses just that setting. Disturbingly, although I disabled handshaking entirely, Perl complains about a missing RLSD, even when I supply the physical voltage level.

    My script is stitched together from example code from the CPAN "man" page of Win32::SerialPort. Anyhow, I will try the examples, maybe they do something different.

    Cheers, UltraDMA