Meine Routine zum Waage auslesen sieht an der Stelle so aus:
Delphi-Quellcode:
var
sReceive : String;
procedure TfmMeasU.ComPort1RxChar(Sender: TObject; Count: Integer);
var
r_buff : array[0..2048] of char;
i,p : Integer;
begin
ComPort1.Read(r_buff,SizeOf(r_buff));
for i := 1 to Count do
begin
if r_Buff[i-1] > #13 then
begin
sReceive := sReceive + r_Buff[i-1];
end else
begin
if r_Buff[i-1] = #13 then
begin
Showmessage('Gewicht : ' + sReceive);
sReceive := '';
end;
end;
end;
end;