当前位置:网站首页>Using com0com/com2tcp to realize TCP to serial port (win10)

Using com0com/com2tcp to realize TCP to serial port (win10)

2022-06-13 00:18:00 csaaa2005

        A recent requirement requires the use of TCP To serial port hardware module , Taobao sells , There is a so-called compact version , To realize the virtual serial port, you need to buy its full-featured version , I studied , Including many online downloads TCP Software for virtual serial port mutual conversion , Or it can not be used normally (win10), Or there's a charge , Although not much , But I feel sick , The domestic environment is so , It's understandable , The problem is that you all use foreign open source code , But it has become a tool to make money , It's a little unkind .

Here it is , I extracted the core usage methods of the open source part , So that people who need it at home can use it normally without spending money .

1. This open source project com2com( name Null-modem emulator) Address :

https://sourceforge.net/projects/com0com/

com2tcp Address :

ponticulus download | SourceForge.net

Of these two open source projects exe The file needs to be downloaded .

download com0com Get a compressed package containing :

Setup_com0com_v3.0.0.0_W7_x64_signed.exe

Setup_com0com_v3.0.0.0_W7_x86_signed.exe

        Two documents , Install according to your own system , The installation process will prompt that the driver is not signed , Unavailable . Ignore him first . After the installation, you can see that there are setupc.exe and setupg.exe Two documents ,setupc Command line tool ,setupg Is a tool with a window , It's almost functional , You can also create and modify .

2. Download the com2tcp.exe Also put it in this directory .

 3.        Now let's deal with the driver signature problem ,win10 Drivers that need to be signed , Otherwise, it will not load , This is also the key that many users can not use it normally . In the device manager com0com Under a , You can see com0com - bus for serial port pair emulator This driver is marked with an exclamation point . Right click to update the driver —— Auto search , Give Way win10 Go there by yourself microsoft Download the driver from the website of , Automatic installation , Then the exclamation point disappeared , The driver is ready to run . If you have permission problems , Solve first administrators Group permissions , See :Win10 Registry could not save changes to permissions access denied _ Great Xia Zhou's blog -CSDN Blog _ Could not save pair wuauserv Permission changes With more and more security control over the system , It is very troublesome to modify the key data of the registry , From time to time, it will pop up that you can't save xxxxxx Permission changes , Access denied , Operation generated an error , Prompt for operation error , What to do at this time ? Here is the latest Win10 There is no recycle bin after upgrading B The situation of , Make a preliminary preparation first , Relevant solutions will be published in the future . that Win10 Registry prompt could not save the to xx What if permission changes deny access ? Method / Step here to the recycle bin CLSID Perform permission modification as a demonstration , After opening the registry editor , Enter the path to be operated , Operate on permissions , The goal is https://blog.csdn.net/qq_37674858/article/details/107876060?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522163583334916780264029137%2522%252C%2522scm%2522%253A%252220140713.130102334..%2522%257D&request_id=163583334916780264029137&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-24. Continue with the following operation while ensuring that the drive is loaded normally :

        After the above installation is completed, it will generally produce 2 Virtual serial port pairs . such as COM10,COM11 , If you use the serial port debugging tool , You can open either of these serial ports .

open setupg, Will see COM10 and COM11 These two serial ports are right , modify :COM11 Change it to :CNCA0, meanwhile Get rid of use Ports class Check of , On the other side COM10 use Ports class Be sure to check , In this way, the port can be mapped COM10 ; After setting, click apply, Refresh the device manager , See that there is only... Left in the port com10; This is the port we want to use in the software .

 

5. Next is TCP The connection of , Open the command line , Enter into com0com Under folder . function com2tcp( See step 2), You can see help information , function :

com2tcp --telnet \\.\CNCA0  192.168.0.2  5000    among 192.168.0.2 It's the address of the server ,5000 It's the port number

You can save the above characters to bat File to run in  

After pressing enter, you can see that the link was created successfully ; In this case, use the serial port debugging tool , open com10, The number sent will be sent to tcp The server

 

The server I have here is actually bought online tcp The module to serial port , Lite version , It can be used normally. . The software here uses the virtual serial port to send , The other end is a real serial port that sends data to other devices , Due to the use of TCP, The transmission distance is greatly increased , It can also realize remote management

end .

原网站

版权声明
本文为[csaaa2005]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202280601484633.html