Re: Serial port read troubles



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

.



Relevant Pages

  • Re: MS Word question
    ... see this Microsoft article on the WP Converter in ... depending on whether or not your system includes the special WP Windows ... However, many non-English characters ... quotation mark, Word won't find the symbol, because the oe digraph and the ...
    (sci.med.transcription)
  • Re: Corrupt Word Files
    ... Naaaahhhh :-) I open Word documents all the time on external drives. ... designed for PCs and forgot that a Mac file is in two parts: ... Microsoft made a decision some years back to drop support for that converter ... Because Microsoft updated their Word 2 converter for Windows 95/Word 97, ...
    (microsoft.public.mac.office.word)
  • Re: MS Word question
    ... see this Microsoft article on the WP Converter in ... depending on whether or not your system includes the special WP Windows ... However, many non-English characters ... quotation mark, Word won't find the symbol, because the oe digraph and the ...
    (sci.med.transcription)
  • Re: Im sure glad I didnt buy a Mac Mini!
    ... George Graves wrote: ... Also if one writes a document in Word for Mac, and saves it as a current Word for Windows file, All ASCI ... Characters above 255 will be missing when the file is opened with a current version of Word on Windows. ... These incomaptibilities are mostly caused because Windows font sets are incomplete and special characters have to be accessed from a special menu. ...
    (comp.sys.mac.advocacy)
  • Re: length of char in bits differs on Win/Linux and Mac
    ... You were just lucky on Windows with your algorithm, and you used the wrong encoding for reading on the Mac. ... because Java uses Unicode for all characters. ...
    (comp.lang.java.programmer)