Serial communication

Bill Vlahos bvlahos at jpl.nasa.gov
Fri Nov 30 18:53:00 EST 2001


I want to receive information coming in via a serial connection and 
capture for processing in Rev. When I use a terminal application (ZTerm) 
the info comes across as plain text so it looks like it will be easy to 
capture. I'm using Mac OS X and a KeySpan USB to serial adapter. The 
Rev. docs say that Rev expect Mac serial ports to be "Printer:" or 
"Modem:" but the KeySpan driver doesn't allow renaming. ZTerm lists the 
port name as "KeyUSA28X91.1". I have created a stack in the IDE (Rev 
1.1) with a field to display the data and have written the following 
card script which doesn't seem to do anything:

on openCard
   open file "KeyUSA28X91.1:"
end openCard

on idle
   set the serialControlString to "KeyUSA28X91.1"
   read from file "KeyUSA28X91.1:" for 1 line
   put it after field "Incoming"
end idle

When I run this it doesn't appear to do anything. I think I see the 
insertion point blinking but it may also be my imagination. Eventually I 
will want to send commands out the serial port to but I want to get this 
working first. The settings of the device match the defaults for Rev 
(i.e. baud rate, etc.)

Bill Vlahos




More information about the use-livecode mailing list