I am trying to read data from a "serial port" (using a USB-serial adaptor).

I am on a MacBook Pro running 10.5.8, using LiveCode 4.5, and Prolific model 2303 USB-serial adaptor.

The following code does not work:

on mouseUp
   put "modem:" into usbSerial
   put empty into field "Field"

   open driver usbSerial for text read
   read from driver usbSerial for 5 chars
   put it after field "field"

   close driver usbSerial
end mouseUp

Setting a breakpoint on the "read from" shows that the "open" does not appear to fail. Single-stepping through the read does not wait for any input from the connected terminal, it returns immediately. "It" is empty afterward.

By reading for N chars I believe I am side-stepping any line - terminator issues.

I have confirmed that the USB-serial adaptor and the terminal can talk to each other properly, using the command-line invocation: 'screen / dev/tty.usbserial'. I have confirmed that the serialControlString matches the terminal's settings.

This fail whether I use "open file" or "open driver".
This fails whether I use "modem" or "printer" as the device.

If I use /dev/tty.usbserial", the IDE hangs and I have to Force-Quit it.

I have tried using the SerialTest.rev stack (http://www.troz.net/rev/stacks/SerialTest.rev ) as well: identical results.

I have read Phil Worthington's paper on serial communication (http://www.pdslabs.net/usb/rev-usb1.pdf ); I believe I'm doing just as he suggests (except for the no-name adaptor I bought), but no luck. I did notice that "the DeviceNames" seems to now return its results in a format different from the one Phil describes, for whatever that might be worth (LC4.5 changes?).

Has anything changed in LC4.5 regarding serial communication? Can others run the serialTest.rev script properly under LC4.5?

Any suggestions welcome!


Larry Walker

Walker Energy Systems LLC
Madison, WI  USA

Strategies & Technologies

www.walkerenergysystems.com








_______________________________________________
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

Reply via email to