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

what is the best way to do a pooled protocol-type comunication?

Started by especialista, April 12, 2012, 02:01:15 am

Previous topic - Next topic

especialista

Hello Roman! Hope everything is allright!

I'm trying to do a point-to-multi_point serial communication protocol using nrcommport and dataprocessor.

No troubles found in configuring nrcommport and dataprocessor.

The protocol is based in pooling type method, i.e, the computer will ask to each device, via ZigBee Network,  if it has data to be sent. if any data is present on the device, it will send one or more 6 byte lenght packets. The last packet sent by the device will enable the computer to ask the same question to the next device, and so on.

For each packet received, dataprocessor.ondatapacked id fired, as expected, and the data is processed.

Each device has a limited amount of storage (microcontroller based devices), so I have to ensure the comunication with each device will occur, at least once in a minute.

If the computer is running JUST the application that will handle the communication, it works fine. I tested it continuously for about 70 hours with no errors.

If any other "CPU resources killer" program (like a disk defragment tool, or antivirus scan) is running along, once in a while, I got exceptions on the data processor or one or more devices going offline due to absence of comunication and consequently, memory full.

So this makes me belive that for some unknown reason, data is not coming out from the computer to the devices, and, in the case of dataprocessor exceptions, data is being missed.

Is there any advice you could give me? How to improve communication priotiry in this case?

Thanks in advance!

Roman Novgorodov

Hello

I'm sorry about delay with my reply. It seems like forum engine misses EMAIL notifications. We are trying to find and resolve problem.

About your problem.
TnrDataProcessor processes incoming data in TnrComm serial port monitor thread. Thread works in Normal priority. Theoretically it should not lost any data. Possible we will include public property for change Priority.

Also you can play with UseMainThread property too. Possible there are problems with waiting main from thread if this property is true.

Possible there are some problems in kernel drivers of your serial port adapter. It can lost data if CPU overload.

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.

especialista