Re: [Tutor] Starting a basic RS232 application?

Magnus Lycka magnus at thinkware.se
Wed Jan 14 16:44:02 EST 2004


Todd G. Gardner wrote:
> I would appreciate your experience in determining the best way to learn how
> to write a basic serial (RS232) software package.

Have you tried using the example code in the pyserial 
library? (See http://pyserial.sourceforge.net/)

Perhaps you should start by establishing a very
rudimentary serial communication between 2 PCs
just using a cable between them and using a
simple serial terminal emulator program: The kind
of program you run if you would use your PC as
a dumb terminal. I thought the hyperterminal would
do, but it seems it expected to find a modem on my
machine at least. I guess something like TeraTerm
<http://hp.vector.co.jp/authors/VA002416/teraterm.html>
will do. If you can type something on one computer,
and see it on the other, you have at least established
a connection, and you know that the cable work etc.

Then you can try to write something on one PC and replace
the terminal in that end with that. Maybe just a little
program that echoes all its input, or maybe converts
lower case to upper case etc. Perhaps something that
emulates the device you expect to get.

Once you have written a program that can interact with
a manual terminal session in one end, you can start
writing code for the other end as well...

Good luck!

-- 
Magnus Lycka, Thinkware AB
Alvans vag 99, SE-907 50 UMEA, SWEDEN
phone: int+46 70 582 80 65, fax: int+46 70 612 80 65
http://www.thinkware.se/  mailto:magnus at thinkware.se



More information about the Tutor mailing list