Folks;

I have an application where I have to read data being sent by a gas turbine controller. It is at 4800 baud, 8N1 with no flow control. My main script is not working, so I tried something simpler, but it does not work either. I am hooked up for testing to another PC running Hyperterminal so I can send one character at a time from the keyboard - I just want to see my program echo, and it does not. Here is the code. (I put in an escape via the local keyboard.) The error code displayed is zero.

[code=thinbasic]USES "CONSOLE"
USES "COMM"

DIM hcomm AS long
DIM NBytes AS long
DIM InBuff AS STRING

'---Get Comms file number and assign

hcomm = COMM_FREEFILE

'---Set up all comms parameters

COMM_SET( hcomm, %COMM_BAUD, 4800 )
COMM_SET( hcomm, %COMM_BYTE, 8 )
COMM_SET( hcomm, %COMM_NULL, FALSE )
COMM_SET( hcomm, %COMM_PARITY, FALSE )
COMM_SET( hcomm, %COMM_PARITYTYPE, 0 )
COMM_SET( hcomm, %COMM_STOP, 0 )
COMM_SET( hcomm, %COMM_RXBUFFER, 64 )

'---Open the port

COMM_OPEN( 2, hcomm )

console_printat("ERROR = " & err, 30, 6)
DO
NBytes = COMM_Get(hComm, %comm_RXQUE)
COMM_recv(hComm, nBytes, InBuff)
console_printat(InBuff, 20, 10)
IF LEN( CONSOLE_INKEYB ) > 0 THEN 'Allow any key to abort
CONSOLE_CLS
CONSOLE_PRINTAT( "ABORTED", 37, 12 )
CONSOLE_WAITKEY( 3 )
COMM_CLOSE( hcomm )
STOP
ENDIF
LOOP[/code]

Thanks for any help. The debugger does not allow me to look at the RXBUFFER so I don't know how far it is getting, but Hyperterminal receives my sent data properly.

Rick