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

Don’t get any event on received data.

Started by vetech, January 08, 2010, 09:04:18 am

Previous topic - Next topic

vetech

Hi

I have the following code in a constructor for a new class the must handle mu RS232 communication.

  _Comm := TnrComm.Create(nil);
  _Comm.ComPortNo       := comport;
  _Comm.BaudRate        := 4800;
  _Comm.ByteSize        := 8;
  _Comm.StopBits        := sbOne;
  _Comm.Parity          := pNone;
  _Comm.EventChar       := #0;
  _Comm.UseMainThread   := true;
  _Comm.TimeoutWrite    := 100;
  _Comm.TimeoutRead     := 100;
  _Comm.BufferInSize    := 8192;
  _Comm.BufferOutSize   := 8192;
  _Comm.RS485Mode       := false;
  _Comm.StreamProtocol  := spNone;
  _Comm.TraceStates     := [tsRxChar];
  _Comm.TerminalUsage   := tuNone;
  _Comm.TerminalEcho    := false;
  _Comm.EnumPorts       := epQuickAll;
  _Comm.DataProcessor   := _CommPack;

  _CommPack := TnrDataProcessor.Create(_Comm);
  _CommPack.DataPackets.Add;
  _CommPack.DataPackets.Items[0].PacketLengthMax  := 100;
  _CommPack.DataPackets.Items[0].Active          := true;
  _CommPack.DataPackets.Items[0].PacketLength    := 0;
  _CommPack.DataPackets.Items[0].PacketBegin     := chr(1);
  _CommPack.DataPackets.Items[0].PacketEnd       := chr(13);
  _CommPack.DataPackets.Items[0].ResetOthers     := false;
  _CommPack.DataPackets.Items[0].PacketEndByTimeout := FALSE;
  _CommPack.OnDataPacket                         := NewBCUData;
  _CommPack.Timeout                              := 100;

  _CommPack.Active        := true;
  _Comm.Active            := true;

My new class can send but nothing is received data nor do I get any event even  that I am 100% sure that date is send to the selected comport. Do I missing something the TnrDataProcessor or is something else wrong â€" pleas give me a hint .

Best regars

Johnny Hansen

Roman Novgorodov

Hello

Do you show me a relal sample of source code?

I see a strange thing:

...
_Comm.DataProcessor   := _CommPack;
_CommPack := TnrDataProcessor.Create(_Comm);
...


It seems like _Comm.DataProcessor property is still NULL value, because you create TnrDataProcessor later.

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