oComm = CREATEOBJ('MSCOMMLib.MSComm') * Open and Initialize COM port #1 for use oComm.CommPort = 1 oComm.Settings = "9600,N,8,1" oComm.InputLen = 0 oComm.PortOpen = .T. for i = 1 to 10000 && loop until get first character for a few seconds oComm.inputlen = 1 lnChar = oComm.input IF lnchar = "B" && break out, found character * Read in the rest of the bytes from the buffer oComm.inputlen = 8 cnetstring = oComm.input return "OK" ENDIF ENDFOR * "CLOSE THE PORT" oComm.PortOpen = .F. release oComm