Author Topic: No Response on send string  (Read 1884 times)

adyble

  • Newbie
  • *
  • Posts: 10
    • View Profile
No Response on send string
« on: June 19, 2009, 06:54:34 pm »
Hi
I am using the Dterminal as a base for my app.
We read from 2 kinds of device
Cintiunuous stream which works perfectly and
one where we must send XB + #13
A couple of weeks ago I had a version that worked, but changed something and can;t find the old code.
I can't even get anything from the SimplePacket demo :
I am juts using the nrComm and nrTerminal components.

EndOfPacket:string=#13;
  idxEOP:integer=1;

  for i := 0 to Received - 1 do begin
    ch := PChar(Buffer);
    if ch = EndOfPacket[idxEOP] then begin
      if idxEOP >= Length(EndOfPacket) then begin
        DoSomethingWithPacket(DataPacket);
        DataPacket := '';
        idxEOP := 1;
      end;
      Inc(idxEOP);
    end else begin
      idxEOP := 1;
      DataPacket := DataPacket + ch;
    end;
  end;
end;

procedure TForm1.bSendClick(Sender: TObject);
begin
  nrComm1.SendString( eSend.Text + EndOfPacket );
end;

Thanks
Andy

Roman Novgorodov

  • Engineer
  • Administrator
  • Hero Member
  • *****
  • Posts: 994
  • we will win
    • View Profile
    • Forums.nrCommLib.Com
Re: No Response on send string
« Reply #1 on: June 22, 2009, 02:58:55 pm »
Hello

The latest version does not have any significant changes for incoming data processig.
Possible you missed something. Check serial port settings.
Try to use Demos\Codes\codes_demo.dpr for check incoming bytes.

Roman Novgorodov
DeepSoftware llc - The professional components for Delphi/CBuilder/.NET. The high quality custom software development.
Forums.nrCommLib.Com - DeepSoftware Tech Support Forum.