I am using following function which works fine (without HTerm):
*************************************
xData := myComRead(4)
if len(xData) > 0
? "data read: [" + xData + "] len=" + ltrim(len(xData))
endif
FUNCTION myComRead(comport)
local cData=""
local ok := .F.
IF com_open(comport)
com_hard(comport,.F.)
com_soft(comport,,.F.)
com_timeout(comport, 10, 0, 100, 0, 100) // Windows
IF com_init(comport,9600,"N",8,1)
ok := .T.
ENDIF
ENDIF
if ok
cData := com_read(comport)
else
alert("cannot open COM port#" + ltrim(comport))
endif
com_close(comport)
return cData
*************************************
Hope this helps you,
AL