Author Topic: nrComm - more help needed!  (Read 883 times)

kasko

  • Newbie
  • *
  • Posts: 5
    • View Profile
nrComm - more help needed!
« on: April 13, 2014, 07:25:59 am »
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