Hello,
I am using Laz_serial to get data from com port.
I have following data from com port.
SOH STX DLE "MY DATA IN PACKET" EOT
So every packet is closed by EOT
I want to parse this packet to so I have each packet in own line.
I use example from laz serial:
*******************************************
Str := Serial.ReadData;
CurPos := Pos( Char(4) ,Str);
if CurPos = 0 then begin
FTempStr := FTempStr + Str;
end
else
begin
FTempStr := FTempStr + Copy( Str, 1, CurPos -1 );
Memo.Lines.BeginUpdate;
Memo.Lines.Add(ftempstr);
Memo.Lines.EndUpdate;
Memo.SelStart := Length(Memo.Lines.Text)-1;
Memo.SelLength:=0;
FTempStr := Copy(Str,CurPos +1, Length(Str) - CurPos);
end;
*******************************************
But in many cases I see that in memo I do not get every packet in own line.
Any suggestions?
I am using com0com for virtual ports