function Look(sPort : String) : Boolean
var
sResponse : String;
bError : Boolean;
t0 : UInt64;
begin
Result := False;
sResponse := '';
bError := False;
//I configured LazSerial control to 9600,8N1,FlowControl None (and tested with Hardware and XonXoff also), RcvLineCRLF=false, rest to default
frmMain.Serial.Device := sPort;
try
frmMain.Serial.Open;
except
bError := True;
end;
if not bError then
begin
Sleep(500); //in a first version, I don't put this delay. I get the same result.
frmMain.Serial.WriteData('V' + #10);
t0 := GetTickCount64();
repeat
if frmMain.Serial.DataAvailable then sResponse := sResponse + frmMain.Serial.ReadData;
until (GetTickCount64() - t0) > 1000;
if sResponse = ('OK'+#10) then Result := True;
frmMain.Serial.Close;
end;
end;