I am working on a plug-in recently.ProgramTo obtain data from other programs from the serial port, but the problem is that the serial port is exclusively used, that is, only one program can read or send data to the serial port.
So how can I obtain the same serial port data from other programs without shutting down other programs?
Searched someArticleIf you look at serialport1.open (), it means they haven't tried it. If another program opens the serial port, you can open it.
I have searched some posts and said that hook functions can be used. As a result, the information about hook functions is not mouse or keyboard. Some people have mentioned several functions, such as createfile and readfile, however, no one has written an example. At last, some people mentioned several tools in a reply and downloaded a lot. Only one result can achieve the desired effect, the software name is eltima software serial Splitter (please search for the software), see: http://www.xcar.com.cn/bbs/viewthread.php? Tid = 12227886
I personally tested it and it is indeed available. Multiple programs can share the data of one serial port. The principle is to reuse the software to connect to the real serial port and then Virtualize multiple serial ports, all programs connect to the virtual serial port, so the real serial port data will be uploaded to all virtual serial ports at the same time, which solves the problem, later, I saw that the hardware developer picked up two lines from one serial port to separate the other two serial ports. This feature was implemented from the hardware perspective and the transmission speed was more secure, however, when there are too many programs, it is quite troublesome.
At present, we hope this solution can help those who encounter the same problem. I really hope someone can write examples that can be solved by using hook functions. Of course, from the perspective of technical research, this is the case, however, from the perspective of solving practical problems, the simpler the better, the more ready-made software can be used.