• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

real time communications on Windows

think2

Senior member
Is it possible to send serial data to a Windows 7 PC from an embedded device using a short RS232 connection where the PC software acknowledges every message sent to it so that there is guaranteed delivery in the absence of a hardware failure. I'm seeing a situation with some third party software running on a PC where it very occasionally takes more than 5 seconds to acknowledge a message. I suspect this is due to Windows stopping the PC application from running sometimes. Has anyone ever successfully done something like this?
 
I've done it many times, and haven't encountered what you're experiencing. After all, COM ports have transmission rates up to 115200bytes/s, so you should be able to get KB/s without any problem.

Try using Tera Term to capture the output, and see if it is a problem with the 3rd party app
 
Thanks for the reply. The people we get the third party software from recently increased the priority of the thread that processes the messages from "normal" priority to high priority and that improved things but after several days of running without losing any messages, there was a 5 to 10 second period where the PC stopped acknowledging.

Does your software use a high priority thread or maybe a "RealTime priority" thread?

I've never used Tera Term. I don't understand how I would use it in this situation.
 
What does this software do? And does it have to be RS232? Because if guaranteed delivery is your goal, perhaps a message queue might be a better fit.
 
Yes it has to be RS232 and guaranteed delivery is the goal. Do you mean a message queue in the embedded device? The embedded device sends 30 to 50 byte messages at 38400 baud and on a busy system its message queue will fill up within around 6 seconds.
 
Tera Term is commonly used terminal emulator. It supports serial ports very well.. So it should be able to capture all that output fairly easy and display it on screen, or log it to a file.
 
Does your software use a high priority thread or maybe a "RealTime priority" thread?

RealTime should almost never be used (can it even be used without admin privileges?).

Process and thread priorities should only really make a difference if there is a significant load on the system at the same time you're trying to use your software. I only bring this up because it sounds like this may not be the problem but I can't say for certain.

You may want to look into increasing the Windows timer resolution[1]. The maximum resolution is 1ms. You can actually increase it further to 0.5ms using "undocumented" functions[1][2] although it's unlikely to be necessary to set it that high. I don't know but maybe this will help although 5 seconds seems like quite a long time. What version of Windows are you running this on?

[1] https://msdn.microsoft.com/en-us/library/windows/desktop/dd743626(v=vs.85).aspx (code example to do this)
[2] http://undocumented.ntinternals.net...ed Functions/Time/NtQueryTimerResolution.html
[3] http://undocumented.ntinternals.net...nted Functions/Time/NtSetTimerResolution.html
 
Disable sleep and unplug the network. That will ensure that your windows system runs as stable as possible for as long as possible. I have done several multiweek monitoring tests using serial ports and the only problem I had was my app had a memory leak and so the app would crash after about 2 weeks. Once I fixed that, it should be able to run for months without trouble though I have never run it for that long. Keeping windows off the network is critical if you want the system to stay idle and stable without having to tinker with settings that you might miss.
 
Back
Top