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

best way to processing recieved buffer

Started by zagdaa, November 30, 2011, 08:17:00 am

Previous topic - Next topic

zagdaa

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

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

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

Hello

QuoteBut 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.