Author Topic: how send/receive with nrcomm  (Read 1377 times)

omidan321

  • Newbie
  • *
  • Posts: 2
    • View Profile
how send/receive with nrcomm
« on: November 26, 2013, 08:06:34 am »
hi,
i want send/receive data with com port  . but cant do this job with nrcomm .
so , i waiting for your respond on this topic .

Roman Novgorodov

  • Engineer
  • Administrator
  • Hero Member
  • *****
  • Posts: 994
  • we will win
    • View Profile
    • Forums.nrCommLib.Com
Re: how send/receive with nrcomm
« Reply #1 on: January 16, 2014, 07:02:12 am »
Hello

TnrComm class provides following methods:

TnrComm.SendString(s:string);
TnrComm.SendChar(ch:char);
TnrComm.SendData(const Buff:PAnsiChar;const N:cardinal);

procedure TnrComm.Read(Buffer: PAnsiChar; Len: cardinal); // waits and reads necessary count of bytes
function TnrCustomComm.ReadMax(Buffer:PAnsiChar; MaxLen:integer) : integer;
procedure TnrCustomComm.ReadAll(Buffer: PAnsiChar); // reads all available (already received) data
function TnrCustomComm..ReadString:AnsiString; // reads all available (already received) data as string

But best way is handle and process incoming data in OnAfterReceive event.

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