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

nrComm - more help needed!

Started by kasko, April 13, 2014, 04:25:59 am

Previous topic - Next topic

kasko

Hello to everyone reading this message!
Can someone give me help, please?
I'm using the nrcomm in a DLL. The transmission seems to be working ok, but I have problems with assigning the "OnAfterReceive" event to the procedure reading the incomming bytes.
I'm using the following init-routine:

  ComPort:=TnrComm.Create(nil);
  ComPort.BaudRate:=115200;
  ComPort.ComPortNo:=ComPortNr;
  ComPort.Parity:=pNone;
  ComPort.StopBits:=sbOne;
  ComPort.ByteSize:=8;
  ComPort.EnumPorts:=epFullPresent;
  ComPort.BufferInSize:=8000;
  ComPort.BufferOutSize:=8000;
  ComPort.StreamProtocol:=spNone;
  ComPort.Active:=True;
  ComPort.OnAfterReceive:=ComPortAfterReceive();

But the last line gives me compiling error - "not enough actual parameters".

Trying:
  ComPort.OnAfterReceive:=ComPortAfterReceive(ComPort,Buffer,Received);
Also ends up in an error. The parameters are not declared...

I hope someone can give me some help!

Thanks in advance!

Karl Jan