• Welcome to Forum.Deepsoftware.Com. Please login or sign up.
 
November 21, 2024, 11:04:27 am

News:

SMF - Just Installed!


No Response on send string

Started by adyble, June 19, 2009, 03:54:34 pm

Previous topic - Next topic

adyble

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

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.