gettingstarted
[Top] [All Lists]

Re: Old Fashioned Serial Port Communications

To: "Getting Started" <gettingstarted at lists dot realsoftware dot com>
Subject: Re: Old Fashioned Serial Port Communications
From: "Roger Meier" <roger dot meier at pobox dot com>
Date: Thu, 31 Mar 2005 17:06:28 -0800
Delivered-to: gettingstarted at lists dot realsoftware dot com
References: <A24042ECFA3E4A4D9E2BF0A66542685209E05249 at emss04m04 dot us dot lmco dot com>
Brad,

The RB part is very easy to implement, check out the language reference, it's got all you need to know.

The hard part is to find out what 'language' to use when talking to your watch if you don't have any documentation. The best thing to do is to 'sniff' your serial communication. There are several ways to achieve this:

There is a tool called 'Serialtest Spy' from Frontline, which allows you to sniff your local serial port (PC only):
http://www.fte.com/spy01.asp
I believe they have demo downloads. Install and run the tool, then run your DOS program. With the tool you can find out what bit format and baudrate the port is running at, and it records the data going back and forth. This should enable you to figure out what commands are being sent to the watch, and what format the data is in that the watch sends back.

If can't use this tool for any reason, you can add 2 more serial ports to your computer (there are inexpensive USB to Serial port interfaces). Then you can program your own sniffer in RB. This is real easy and is a nice hobby project to familiarize yourself with RB's Serial control. All you need is a program that sends the data received on one port to the other and vice versa, and logs the data to an Editfield or a file. You should be able to write something up in less than an hour or so. The easiest would be to implement the whole thing in an event driven way, i.e. in the 'DataAvailable' event of one port, read the data with ReadAll and write it to the other port (and also send it to an EditField or file). Do this for both ports. To sniff the data, plug in your watch into port 3, and connect port 1 to port 2 via a nullmodem cable. Make sure your DOS program uses port 1, and make sure your sniffer program exchanges data between port 2 and 3, and that they are set to the same baudrate and byte format (no of bits, parity, etc) as the DOS program. This works great for debugging purposes too.

Good luck.

Roger



----- Original Message ----- From: "Herder, Bradford J" <bradford dot j dot herder at lmco dot com>
To: "Getting Started" <gettingstarted at lists dot realsoftware dot com>
Sent: Thursday, March 31, 2005 1:47 PM
Subject: Old Fashioned Serial Port Communications


Hi,

Can RB talk to a PC's Old Fashioned Serial Port?
Does anyone have any examples along those lines?

I have this stopwatch that can interface with PC's serial port but it
uses a DOS program to receive info into a flat file.  I'd love to
convert this to work via a RB windows app, maybe launch Excel.

Of course, I have no documentation on how to talk to this watch...
This is the watch:
http://www.toptime.com/499/499.html

If there's some way to tell the watch - send me some data,
I got it, send me some more, I could look at what I got and
figure out what it's sending.

Probably a pipe dream, but have to ask.

Thanks,
Brad
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>





_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>