Hi,
I have an application which needs to read serial messages at 50Hz (one messsage every 20ms). The messages are 100bytes in size. What will be the best method to read the data effectively? Will it be polling or using the ComCallBack function?
I have tested both the polling method and the ComCallBack but the result is not satisfactory. I need to read the message ASAP once it arrives, and calculate the data rate or interval between messages. However, frequently there is a few message queue up at the port, suggesting that the program cannot read the messages fast enough. I am aware that the timing will not be accurate, but at least, I need to read the messages sufficently fast enough so that there is not more then one message at the queue at any one time. That will be good enough.
I'm using a i7 8 core processor. On the task schedule most of the CPUs are mainly idle when the program runs.
I have tried creating a new thread for the polling or the installcomcallback function and give it TimeCritical priority but it doesn't help.
Appreciate any advise.
Thank you very much.
Regards