kpv19820
Junior Member | Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору procedure TForm1.ComPortRxChar(Sender: TObject; Count: Integer); Var Buf: array[1..1024] of ansichar; st: TstringList; i,ReadBytes: integer; begin i:=0; ReadBytes := ComPort.Read(Buf, Count); if ReadBytes < 0 then ShowMessage('Ошибка чтения из COM-порта') else begin for i := 1 to ReadBytes do begin if (IntToHex(Ord(Buf[i]),2)<>'0B') then begin if (IntToHex(Ord(Buf[i]),2)<>'1C') then s1:=s1 + Buf[i]; end; end; end; if (IntToHex(Ord(Buf[ReadBytes-1]),2)='1C') then begin st := TStringList.Create; try st.Delimiter := #13; st.StrictDelimiter := True; st.DelimitedText := s1; datasave(st); //Функция обработки и занесения в БД s1:=''; finally st.Free; end; end; end; | Всего записей: 55 | Зарегистр. 07-12-2007 | Отправлено: 11:11 18-11-2017 | Исправлено: kpv19820, 11:43 18-11-2017 |
|