A bit of history: We have an application that was written many years ago (1998 is the first date in PVC, but the application is about 5 years older than this, since it was originally a DOS program). This application communicates with hardware through a serial port. When we got to Windows XP, we started getting reports that the application was dying after a short time. It seems that the serial number just โdiedโ and the application remained stuck. The only way to recover from this situation is to restart the application.
The only information I can find on this problem was apparently due to the fact that the Windows Message system skipped this information, the buffer was full and the system was stuck. This piece of information has remained in the document of the old word, but there is no evidence to support this. It also mentions that this is common only at high bit rates (115200 +).
The solution was to provide customers with USB-> serial converters along with the equipment.
Today: We are working on a new version of equipment that will work both through the network and through serial ports. Therefore, to allow me to work with the network code, minus the actual equipment, we use the VSCOM NetCom113 device . It also sets up a virtual communication port for users (i.e.: mine).
Now I have the network code integrated with the application, it looks like the NetCom device is showing the same behavior as the physical symbol. This is undesirable since the application should run longer than 30 seconds.
Google returns the null problems we are experiencing.
It was interesting to me:
- Has anyone experienced this before? If so, what did you do to fix / fix the problem?
- Does anyone have any suggestions regarding the correctness of the original author of the document and what can I do to verify the theory?
Unfortunately, I canโt send the code because the serial code is closely connected with the rest of the system, although if you have questions about this, I can answer questions about this.
Update:
- The code is written using Win32 Comm routines, so I use CreateFile, ReadFile. There are also reasonable calls to GetOverlappedResult.
- It doesn't hang on its own, it's just that the comm stops. You can access the menu, click on the buttons, but nothing can interact with the connected equipment. Using realterm , you can see that no data is coming in or out.
- I think the link to the Windows message is that the problem is internal to windows. The data arrived, but the kernel lost it and thus did not inform the rest of the system about it.
- Flow control is not used.
- Writing a โsimpleโ test is difficult because the code is tightly coupled and the underlying protocol is quite complex and will require a lot of work.
source share