Author Topic: best way to processing recieved buffer  (Read 1256 times)

zagdaa

  • Newbie
  • *
  • Posts: 2
    • View Profile
best way to processing recieved buffer
« on: November 30, 2011, 10:17:00 am »
Hi,

I'm just trying to use TnrComm component and sending some commands to Comport periodically and receiving some datas using OnAfterRecieve
event and TTimer.onTimer. when i'm receiving datas in buffer i'm gonna process immediately and put results to tables, but while processing, next messages are droppped.

Please tell me right way to process received datas without any loss of incoming datas.

Regards,
Zagdaa.

Roman Novgorodov

  • Engineer
  • Administrator
  • Hero Member
  • *****
  • Posts: 994
  • we will win
    • View Profile
    • Forums.nrCommLib.Com
Re: best way to processing recieved buffer
« Reply #1 on: December 01, 2011, 10:36:40 am »
Hello

nrComm Lib setup includes some sample projects that can help you:

Demos\Codes\codes_demo.dpr
Demos\SimplePacket\SimplePacket.dpr
Demos\DataProc\dataproc.dpr

Also you can read this post:
http://forums.nrcommlib.com/index.php?topic=8.0

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.

zagdaa

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: best way to processing recieved buffer
« Reply #2 on: December 01, 2011, 12:03:18 pm »
Thank you for your reply.

But my problem is not sending data. I'm sending some commands periodically for monitoring some status of equipment.
So these demos are not useful for me.

Roman Novgorodov

  • Engineer
  • Administrator
  • Hero Member
  • *****
  • Posts: 994
  • we will win
    • View Profile
    • Forums.nrCommLib.Com
Re: best way to processing recieved buffer
« Reply #3 on: December 01, 2011, 12:24:14 pm »
Hello

Quote
But my problem is not sending data

It seems like there are some misunderstanding between us.

Demos\Codes\codes_demo.dpr
- This demo shows HEX/DEC codes of all incoming bytes. It receives data in OnAfterReceive event. It sends nothing.

Demos\SimplePacket\SimplePacket.dpr
- This code demonstrates how you can detect incoming strings with #13#10 at end. It receives data in OnAfterReceive event. It sends nothing.

Demos\DataProc\dataproc.dpr
- This demo shows capabilities of TnrDataProcessor component. It allows to detect various packet in incoming data stream. You can set any char markers for start or end packet and etc. It sends nothing.

Post http://forums.nrcommlib.com/index.php?topic=8.0 explains that incoming data can be separated in several calls of OnAfterReceive handler and your code should precess this situation correctly.

So all above info describes various methods for process incoming data.

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.