• Welcome to Forum.Deepsoftware.Com. Please login or sign up.
 

how send/receive with nrcomm

Started by omidan321, November 26, 2013, 06:06:34 am

Previous topic - Next topic

omidan321

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

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.