Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- procedure TForm1.Button1Click(Sender: TObject);
- begin
- Label1.Caption:= ''; // ST
- Label2.Caption:= '';
- Label3.Caption:= ''; // vaha
- Label4.Caption:= ''; //
- LazSerial1.WriteData(#$52#$0d#$0a);
- while (stavvazeni = 'ST') do
- begin
- Application.ProcessMessages;
- sleep(100);
- LazSerial1.WriteData(#$52#$0d#$0a);
- end;
- sleep(500);
- Memo1.Lines.AddText('stav vazeni ' + stavvazeni);
- Label5.Caption:= stavvazeni;
- Label6.Caption:= vaha;
- end;
- procedure TForm1.LazSerial1RxData(Sender: TObject);
- var
- sl: TStringList;
- begin
- data := '';
- sleep(50);
- data := lazserial1.ReadData;
- sl := TStringList.Create;
- sl.Delimiter := ',';
- sl.DelimitedText := data;
- stavvazeni := Trim (sl[0]);
- vaha := Trim (sl[2]);
- Label1.Caption:= stavvazeni ;
- Label2.Caption:= Trim (sl[1]);
- Label3.Caption:= Trim (sl[2]);
- Label4.Caption:= Trim (sl[3]);
- sl.Free;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement