Unable to read PC serial port

Ken G. Brown kbrown at tnc.com
Wed Aug 22 03:53:10 UTC 2001


Some novice questions:
I need to take input from a PC serial port (Windows 2000, Alpha 
updates to 4261) and stream it to a scrollable editable window and 
vice versa for keyboard input, back to the port.
I'm not making much progress so far. Would PluggableTextMorph be the 
one to use?
How does one go about getting the text from the port to flow into the window?
Starting from Ned's recent tips, I've tried the code below and have 
managed to output to the port but reading doesn't seem to work.
  --------------------
p _ SerialPort new initialize;
baudRate: 9600;
dataBits: 8;
inputFlowControlType: 2;
outputFlowControlType: 2;
parityType: 0;
stopBitsType: 1;
openPort: 2.
q _ String new:1000.
p nextPutAll: 'b'.  "this b makes it out the port, although it 
appears to be more than one character, and starts the transmission 
back to the port from an external device"
p readInto: q startingAt: 1.
Transcript show: q stringRepresentation. "this appears to get 
something but inspects as 0's"
p close.
---------
This is with Alpha updates to 4261.

Smalltalk listLoadedModules. #('B2DPlugin 17 May 2001 (i)' 'SerialPlugin 17
May 2001 (i)' 'LargeIntegers v1.2 17 May 2001 (i)' 'BitBltPlugin 17 May 2001
(i)' 'SecurityPlugin 17 May 2001 (i)' 'FilePlugin 17 May 2001 (i)'
'MiscPrimitivePlugin 17 May 2001 (i)')
-------------------------
Are there any later updates to the SerialPlugin? Anyone been 
successful at serial input?
Any pointers would be greatly appreciated.
  Thx for any help.
  Ken




More information about the Squeak-dev mailing list