Serial comm differences between PC & Mac?

Dar Scott dsc at swcp.com
Thu Dec 2 13:44:49 EST 2004


On Dec 2, 2004, at 8:07 AM, runrev at jkvaldez.com wrote:

> Short version
> I'm connected via a serial cable to a device on OSX & all's well. I 
> read
> "1 int1" of data & receive data including control characters like 4, 
> 7, 6.
> Unplug serial cable & plug into PC. Now the control characters are 
> unusual
> values like -84 & other unexpected values occur along with the expected
> values. Any idea why the data is different from OSX to PC?

Is the port already open when you plug it in?  You might be getting 
garbage characters as you plug in the cable.  You might need to sync on 
something good.

I only use the chunktype of char.  Maybe you have stumbled on a feature 
of int1.  If you do switch to char and use charToNum(), you won't get 
the negative character value.

You might want to set the serialControlString.  I have a vague memory 
of a problem in relying on the default.  The -84 looks like a "." with 
the high bit set.  Maybe there is a problem with parity.  Are you 
seeing every other letter correctly, such as A, C, E?

There are other differences between the platforms, but they might not 
apply here.

Dar

****************************************
     Dar Scott Consulting
     http://www.swcp.com/dsc/
     Programming Services
****************************************



More information about the use-livecode mailing list