Re: Serial port read troubles
- From: "Greg Cadmes" <gcadmes@xxxxxxxxx>
- Date: 26 Aug 2006 23:06:00 -0700
Hi Chad,
when the data arrival event fies, try reading the characters as a byte
array, and converting the bytes into ASCII (man readable characters).
The 'MAC' unlike Windows doesn't display none readable characters,
meaning, those ouf of printable range. 128 to 255.
Hope this helps,
Greg Cadmes
bullchad@xxxxxxxxx wrote:
I've been working on this problem for a while now, and just can't
figure it out. I have a serial device (going through a Keyspan
serial->usb converter, with the appropriate drivers installed, on the
Mac) that I can send data to correctly, but when it sends data back, I
can't get it to transfer into a tangible piece of data.
I don't have the specs for the serial device, so it's just been
trial/error, but I have a set of commands that do work when I try it on
Windows using the same Keyspan converter. It correctly sends the data
to the device, and will read it back in. On the Mac, I can (usually)
get the "DataAvailable" event of the serial control to fire [e.g. put a
msgbox "test" in the DataAvailable event and it'll usually fire when it
*should* be receiving data), but when I try to read it to a string or
such, there's nothing there. I've tried switching the encodings around,
though I'll admit I don't have much experience with this, so it's
mostly just messing around...though I'm guessing that it's just an
ASCII string being spit back.
Anyone have any ideas? Thanks yet again in advance.
Chad B
.
- Follow-Ups:
- Re: Serial port read troubles
- From: Joe Strout
- Re: Serial port read troubles
- References:
- Serial port read troubles
- From: bullchad
- Serial port read troubles
- Prev by Date: Re: RB or Python?
- Next by Date: Re: Serial port read troubles
- Previous by thread: Serial port read troubles
- Next by thread: Re: Serial port read troubles
- Index(es):
Relevant Pages
|