{"id":104102,"date":"2026-09-11T20:48:57","date_gmt":"2026-09-11T12:48:57","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/104102.html"},"modified":"2026-09-11T20:48:57","modified_gmt":"2026-09-11T12:48:57","slug":"%e4%b8%b2%e5%8f%a3%e9%80%9a%e4%bf%a1%e5%85%a5%e9%97%a8%e5%88%b0%e5%ae%9e%e6%88%98%ef%bc%9a10%e6%ad%a5%e6%90%9e%e6%87%82%e5%b7%a5%e4%b8%9a%e8%ae%be%e5%a4%87%e7%9a%84%e6%82%84%e6%82%84%e8%af%9d","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/104102.html","title":{"rendered":"\u4e32\u53e3\u901a\u4fe1\u5165\u95e8\u5230\u5b9e\u6218\uff1a10\u6b65\u641e\u61c2\u5de5\u4e1a\u8bbe\u5907\u7684\u201c\u6084\u6084\u8bdd\u201c"},"content":{"rendered":"<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260911124856-6aa3f8b8a2e05.jpg\" \/><\/p>\n<\/p>\n<h4>&#x1f4d6; \u672c\u6587\u76ee\u5f55<\/h4>\n<li>\u4ec0\u4e48\u662f\u4e32\u53e3\u901a\u4fe1&#xff1f;<\/li>\n<li>\u4e32\u53e3\u957f\u4ec0\u4e48\u6837&#xff1f;DB9\u63a5\u53e3\u8be6\u89e3<\/li>\n<li>RS232 \/ RS422 \/ RS485 \u4e09\u5927\u6807\u51c6<\/li>\n<li>\u6570\u636e\u5e27\u683c\u5f0f&#xff1a;\u4e00\u5e27\u6570\u636e\u662f\u600e\u4e48\u4f20\u7684<\/li>\n<li>\u4e32\u53e3\u56db\u8981\u7d20&#xff1a;\u6ce2\u7279\u7387\u3001\u6570\u636e\u4f4d\u3001\u505c\u6b62\u4f4d\u3001\u6821\u9a8c\u4f4d<\/li>\n<li>\u52a8\u624b\u524d\u51c6\u5907&#xff1a;\u865a\u62df\u4e32\u53e3\u5de5\u5177<\/li>\n<li>C# \u7b2c\u4e00\u6b65&#xff1a;\u626b\u63cf\u5e76\u6253\u5f00\u4e32\u53e3<\/li>\n<li>\u63a5\u6536\u6570\u636e&#xff1a;DataReceived \u4e8b\u4ef6\u4e0e\u8de8\u7ebf\u7a0bUI<\/li>\n<li>\u53d1\u9001\u6570\u636e&#xff1a;\u6587\u672c\u6a21\u5f0f\u4e0e\u5341\u516d\u8fdb\u5236\u6a21\u5f0f<\/li>\n<li>\u5b8c\u6574\u5b9e\u6218&#xff1a;\u4e00\u4e2a\u4e32\u53e3\u8c03\u8bd5\u52a9\u624b<\/li>\n<h3>1\u4ec0\u4e48\u662f\u4e32\u53e3\u901a\u4fe1&#xff1f;<\/h3>\n<p>\u60f3\u8c61\u4e00\u4e0b\u4e24\u4e2a\u4eba\u6253\u7535\u8bdd&#xff1a;\u4e00\u4e2a\u4eba\u8bf4&#xff0c;\u4e00\u4e2a\u4eba\u542c&#xff0c;\u58f0\u97f3\u4e00\u4e2a\u5b57\u4e00\u4e2a\u5b57\u5730\u4f20\u8fc7\u53bb\u3002\u4e32\u53e3\u901a\u4fe1\u5c31\u662f\u8fd9\u4e2a\u9053\u7406\u2014\u2014\u6570\u636e\u6309\u7167\u4f4d&#xff08;bit&#xff09;\u7684\u987a\u5e8f&#xff0c;\u4e00\u5e27\u4e00\u5e27\u5730\u4f20\u8f93\u3002<\/p>\n<p>\u5728\u5de5\u4e1a\u81ea\u52a8\u5316\u9886\u57df&#xff0c;\u51e0\u4e4e\u6240\u6709\u8bbe\u5907\u90fd\u652f\u6301\u4e32\u53e3\u901a\u4fe1\u3002\u5b83\u7684\u63a5\u53e3\u7b80\u5355\u3001\u534f\u8bae\u6210\u719f&#xff0c;\u662fPLC\u3001\u4f20\u611f\u5668\u3001\u626b\u7801\u67aa\u3001\u53d8\u9891\u5668\u7b49\u8bbe\u5907\u4e4b\u95f4\u6700\u5e38\u7528\u7684&#034;\u6c9f\u901a\u65b9\u5f0f&#034;\u3002<\/p>\n<p>  \u6838\u5fc3\u7279\u70b9&#xff1a;\u4e32\u884c\u4f20\u8f93&#xff08;\u4e00\u4f4d\u4e00\u4f4d\u53d1&#xff09;\u3001\u5168\u53cc\u5de5&#xff08;\u53ef\u540c\u65f6\u6536\u53d1&#xff09;\u3001\u8ddd\u79bb\u9002\u4e2d\u3001\u6210\u672c\u4f4e\u3001\u6297\u5e72\u6270\u80fd\u529b\u56e0\u6807\u51c6\u800c\u5f02\u3002<\/p>\n<p>\u4e0eUSB\u3001\u4ee5\u592a\u7f51\u8fd9\u4e9b&#034;\u73b0\u4ee3&#034;\u63a5\u53e3\u76f8\u6bd4&#xff0c;\u4e32\u53e3\u770b\u8d77\u6765&#034;\u8001&#034;&#xff0c;\u4f46\u5b83\u7b80\u5355\u3001\u7a33\u5b9a\u3001\u53ef\u9760&#xff0c;\u5728\u5de5\u4e1a\u73b0\u573a\u81f3\u4eca\u65e0\u53ef\u66ff\u4ee3\u3002<\/p>\n<h3>2\u4e32\u53e3\u957f\u4ec0\u4e48\u6837&#xff1f;DB9\u63a5\u53e3\u8be6\u89e3<\/h3>\n<p>\u6700\u7ecf\u5178\u7684\u4e32\u53e3\u63a5\u53e3\u5c31\u662f DB9&#xff08;D-sub 9\u9488&#xff09;&#xff0c;\u4e00\u4e2a\u68af\u5f62\u76849\u9488\u63a5\u5934\u3002\u4f60\u53ef\u80fd\u5728\u8001\u7535\u8111\u4e0a\u89c1\u8fc7\u5b83\u3002<\/p>\n<\/p>\n<p>   \u56fe&#xff1a;DB9 \u4e32\u884c\u63a5\u53e3\u9488\u811a\u5b9a\u4e49<\/p>\n<p>9\u4e2a\u9488\u811a\u5404\u53f8\u5176\u804c&#xff0c;\u6700\u5e38\u7528\u7684\u5176\u5b9e\u53ea\u67093\u4e2a&#xff1a;<\/p>\n<table>\n<tbody>\n<tr>\u9488\u811a\u540d\u79f0\u4f5c\u7528<\/tr>\n<tr>\n<td>2<\/td>\n<td>RXD&#xff08;\u63a5\u6536&#xff09;<\/td>\n<td>\u6536\u6570\u636e<\/td>\n<\/tr>\n<tr>\n<td>3<\/td>\n<td>TXD&#xff08;\u53d1\u9001&#xff09;<\/td>\n<td>\u53d1\u6570\u636e<\/td>\n<\/tr>\n<tr>\n<td>5<\/td>\n<td>GND&#xff08;\u5730&#xff09;<\/td>\n<td>\u4fe1\u53f7\u53c2\u8003\u5730<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>  \u5b9e\u9645\u5f00\u53d1\u4e2d&#xff0c;\u5f88\u591a\u8bbe\u5907\u53ea\u63a5 TXD\u3001RXD\u3001GND \u4e09\u6839\u7ebf\u5c31\u80fd\u901a\u4fe1&#xff0c;\u5176\u4ed6\u6d41\u63a7\u9488\u811a\u53ef\u4ee5\u4e0d\u63a5\u3002<\/p>\n<p>   \u56fe&#xff1a;DB9 \u516c\u5934&#xff08;\u9488&#xff09;\u4e0e\u6bcd\u5934&#xff08;\u5b54&#xff09;<\/p>\n<p>\u516c\u5934\u5e26\u9488&#xff0c;\u6bcd\u5934\u5e26\u5b54&#xff0c;\u5bf9\u63a5\u65f6\u6ce8\u610f\u4ea4\u53c9\u8fde\u63a5&#xff1a;A\u7684TXD\u63a5B\u7684RXD&#xff0c;A\u7684RXD\u63a5B\u7684TXD&#xff0c;GND\u76f4\u8fde\u3002<\/p>\n<h3>3RS232 \/ RS422 \/ RS485 \u4e09\u5927\u6807\u51c6<\/h3>\n<p>\u4e32\u53e3\u4e0d\u662f\u53ea\u6709\u4e00\u79cd&#xff01;\u6839\u636e\u7535\u6c14\u6807\u51c6\u4e0d\u540c&#xff0c;\u5e38\u89c1\u7684\u6709\u4e09\u79cd&#xff1a;<\/p>\n<\/p>\n<p>   \u56fe&#xff1a;RS232 \/ RS422 \/ RS485 \u8f6c\u6362\u5668\u4e0e\u63a5\u7ebf\u5bf9\u6bd4<\/p>\n<table>\n<tbody>\n<tr>\u6807\u51c6\u4f20\u8f93\u65b9\u5f0f\u6700\u5927\u8ddd\u79bb\u7279\u70b9<\/tr>\n<tr>\n<td>RS232<\/td>\n<td>\u5355\u7aef&#xff08;\u70b9\u5bf9\u70b9&#xff09;<\/td>\n<td>\u7ea615\u7c73<\/td>\n<td>\u6700\u5e38\u89c1&#xff0c;\u7535\u8111\u539f\u751f\u652f\u6301&#xff0c;\u53ea\u80fd1\u5bf91<\/td>\n<\/tr>\n<tr>\n<td>RS422<\/td>\n<td>\u5dee\u5206&#xff08;\u5168\u53cc\u5de5&#xff09;<\/td>\n<td>\u7ea61200\u7c73<\/td>\n<td>\u6297\u5e72\u6270\u5f3a&#xff0c;\u8ddd\u79bb\u8fdc<\/td>\n<\/tr>\n<tr>\n<td>RS485<\/td>\n<td>\u5dee\u5206&#xff08;\u534a\u53cc\u5de5&#xff09;<\/td>\n<td>\u7ea61200\u7c73<\/td>\n<td>\u53ef\u6302\u591a\u4e2a\u8bbe\u5907&#xff08;\u603b\u7ebf&#xff09;&#xff0c;\u5de5\u4e1a\u6700\u5e38\u7528<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>  \u8bb0\u4f4f&#xff1a;RS232 \u662f&#034;\u4e00\u5bf9\u4e00\u6253\u7535\u8bdd&#034;&#xff0c;RS485 \u662f&#034;\u4e00\u547c\u767e\u5e94\u7684\u5bf9\u8bb2\u673a&#034;\u3002\u5de5\u4e1a\u73b0\u573a\u957f\u8ddd\u79bb\u3001\u591a\u8bbe\u5907\u573a\u666f\u57fa\u672c\u90fd\u7528 RS485\u3002<\/p>\n<h3>4\u6570\u636e\u5e27\u683c\u5f0f&#xff1a;\u4e00\u5e27\u6570\u636e\u662f\u600e\u4e48\u4f20\u7684<\/h3>\n<p>\u4e32\u53e3\u53d1\u6570\u636e\u4e0d\u662f&#034;\u88f8\u5954&#034;\u7684&#xff0c;\u6bcf\u4e00\u5e27\u90fd\u6709\u56fa\u5b9a\u7684&#034;\u5305\u88c5\u683c\u5f0f&#034;&#xff0c;\u5c31\u50cf\u5bc4\u5feb\u9012\u8981\u6709\u4fe1\u5c01\u4e00\u6837&#xff1a;<\/p>\n<\/p>\n<p>   \u56fe&#xff1a;\u4e32\u53e3\u901a\u4fe1\u6570\u636e\u5e27\u683c\u5f0f&#xff08;\u8d77\u59cb\u4f4d &#043; \u6570\u636e\u4f4d &#043; \u6821\u9a8c\u4f4d &#043; \u505c\u6b62\u4f4d&#xff09;<\/p>\n<p>\u4e00\u5e27\u6570\u636e\u7684\u7ed3\u6784\u4f9d\u6b21\u662f&#xff1a;<\/p>\n<li>\u8d77\u59cb\u4f4d&#xff08;Start Bit&#xff09;&#xff1a;\u5148\u53d1\u4e00\u4e2a\u4f4e\u7535\u5e73&#xff0c;\u544a\u8bc9\u5bf9\u65b9&#034;\u6211\u8981\u5f00\u59cb\u8bf4\u8bdd\u4e86&#034;<\/li>\n<li>\u6570\u636e\u4f4d&#xff08;Data Bits&#xff09;&#xff1a;\u5b9e\u9645\u8981\u4f20\u7684\u6570\u636e&#xff0c;\u901a\u5e388\u4f4d&#xff08;\u4e00\u4e2a\u5b57\u8282&#xff09;&#xff0c;\u4f4e\u4f4d\u5148\u53d1&#xff08;LSB&#xff09;<\/li>\n<li>\u6821\u9a8c\u4f4d&#xff08;Parity Bit&#xff09;&#xff1a;\u53ef\u9009&#xff0c;\u7528\u6765\u68c0\u67e5\u4f20\u8f93\u51fa\u9519<\/li>\n<li>\u505c\u6b62\u4f4d&#xff08;Stop Bit&#xff09;&#xff1a;\u9ad8\u7535\u5e73&#xff0c;\u8868\u793a&#034;\u8fd9\u5e27\u8bf4\u5b8c\u4e86&#034;<\/li>\n<p>  \u901a\u4fe1\u53cc\u65b9\u5fc5\u987b\u7ea6\u5b9a<br \/>\n  \u5b8c\u5168\u76f8\u540c\u7684\u5e27\u683c\u5f0f&#xff0c;\u5426\u5219\u6536\u5230\u7684\u5c31\u662f\u4e71\u7801&#xff01;\u8fd9\u5c31\u662f\u4e3a\u4ec0\u4e48\u4e32\u53e3\u8c03\u8bd5\u603b\u8981\u5148\u914d\u53c2\u6570\u3002<\/p>\n<h3>5\u4e32\u53e3\u56db\u8981\u7d20&#xff1a;\u6ce2\u7279\u7387\u3001\u6570\u636e\u4f4d\u3001\u505c\u6b62\u4f4d\u3001\u6821\u9a8c\u4f4d<\/h3>\n<p>\u6253\u5f00\u4efb\u4f55\u4e00\u4e2a\u4e32\u53e3\u8c03\u8bd5\u5de5\u5177&#xff0c;\u90fd\u4f1a\u770b\u5230\u8fd9\u56db\u4e2a\u53c2\u6570\u3002\u5b83\u4eec\u5c31\u662f\u901a\u4fe1\u53cc\u65b9\u7684&#034;\u6697\u53f7&#034;&#xff0c;\u5fc5\u987b\u4e00\u81f4&#xff1a;<\/p>\n<table>\n<tbody>\n<tr>\u53c2\u6570\u542b\u4e49\u5e38\u89c1\u503c<\/tr>\n<tr>\n<td>\u6ce2\u7279\u7387 BaudRate<\/td>\n<td>\u6bcf\u79d2\u4f20\u8f93\u7684\u4e8c\u8fdb\u5236\u4f4d\u6570&#xff08;bps&#xff09;&#xff0c;\u51b3\u5b9a\u901a\u4fe1\u901f\u5ea6<\/td>\n<td>9600\u300119200\u300138400\u3001115200<\/td>\n<\/tr>\n<tr>\n<td>\u6570\u636e\u4f4d DataBits<\/td>\n<td>\u6bcf\u5e27\u5b9e\u9645\u6570\u636e\u7684\u4f4d\u6570<\/td>\n<td>6\u30017\u30018&#xff08;\u6700\u5e38\u75288&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>\u505c\u6b62\u4f4d StopBits<\/td>\n<td>\u5e27\u7ed3\u675f\u6807\u8bb0\u7684\u4f4d\u5bbd<\/td>\n<td>1\u30011.5\u30012&#xff08;\u6700\u5e38\u75281&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>\u6821\u9a8c\u4f4d Parity<\/td>\n<td>\u9519\u8bef\u68c0\u6d4b\u65b9\u5f0f<\/td>\n<td>\u65e0&#xff08;None&#xff09;\u3001\u5947\u6821\u9a8c&#xff08;Odd&#xff09;\u3001\u5076\u6821\u9a8c&#xff08;Even&#xff09;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>  \u6700\u5e38\u7528\u7684\u7ec4\u5408&#xff1a;9600 \u6ce2\u7279\u7387 &#043; 8\u6570\u636e\u4f4d &#043; 1\u505c\u6b62\u4f4d &#043; \u65e0\u6821\u9a8c&#xff0c;\u7b80\u79f0<br \/>\n  9600-8-N-1\u3002\u65b0\u8bbe\u5907\u9ed8\u8ba4\u57fa\u672c\u90fd\u662f\u8fd9\u4e2a\u3002<\/p>\n<h3>6\u52a8\u624b\u524d\u51c6\u5907&#xff1a;\u865a\u62df\u4e32\u53e3\u5de5\u5177<\/h3>\n<p>\u5199\u4e32\u53e3\u7a0b\u5e8f\u6700\u5934\u75bc\u7684\u662f\u2014\u2014\u6ca1\u6709\u786c\u4ef6\u600e\u4e48\u6d4b\u8bd5&#xff1f;<\/p>\n<p>\u7b54\u6848\u662f\u7528\u865a\u62df\u4e32\u53e3\u8f6f\u4ef6&#xff08;\u5982 Virtual Serial Port Driver&#xff09;&#xff0c;\u5b83\u80fd\u5728\u7535\u8111\u4e0a\u521b\u5efa\u4e00\u5bf9&#034;\u865a\u62df\u4e32\u53e3&#034;&#xff0c;\u6bd4\u5982 COM3 \u548c COM4&#xff0c;\u4e24\u8005\u5185\u90e8\u4e92\u8fde\u3002\u4f60\u7528\u81ea\u5df1\u7684\u7a0b\u5e8f\u6253\u5f00 COM3&#xff0c;\u7528\u4e32\u53e3\u52a9\u624b\u6253\u5f00 COM4&#xff0c;\u5c31\u80fd\u4e92\u76f8\u6536\u53d1\u6570\u636e\u4e86\u3002<\/p>\n<p>  \u865a\u62df\u4e32\u53e3\u5bf9\u662f<br \/>\n  \u6210\u5bf9\u51fa\u73b0\u7684&#xff1a;\u53d1\u5f80 COM3 \u7684\u6570\u636e\u4f1a\u51fa\u73b0\u5728 COM4&#xff0c;\u53cd\u4e4b\u4ea6\u7136\u3002\u8fd9\u662f\u5f00\u53d1\u8c03\u8bd5\u7684\u795e\u5668&#xff0c;\u4e0d\u9700\u8981\u4efb\u4f55\u771f\u5b9e\u786c\u4ef6\u3002<\/p>\n<p>\u8d44\u6599\u4e2d\u9644\u5e26\u4e86 Virtual Serial Port Driver 6.9 \u548c \u4e32\u53e3\u52a9\u624b.exe&#xff0c;\u5b89\u88c5\u540e\u521b\u5efa\u4e00\u5bf9\u865a\u62df\u4e32\u53e3\u5373\u53ef\u5f00\u59cb\u8c03\u8bd5\u3002<\/p>\n<h3>7C# \u7b2c\u4e00\u6b65&#xff1a;\u626b\u63cf\u5e76\u6253\u5f00\u4e32\u53e3<\/h3>\n<p>C# \u64cd\u4f5c\u4e32\u53e3\u975e\u5e38\u7b80\u5355&#xff0c;.NET Framework \u5185\u7f6e\u4e86 System.IO.Ports.SerialPort \u7c7b&#xff0c;\u65e0\u9700\u7b2c\u4e09\u65b9\u5e93\u3002<\/p>\n<h4>\u2460 \u626b\u63cf\u7535\u8111\u4e0a\u7684\u53ef\u7528\u4e32\u53e3<\/h4>\n<p> using System.IO.Ports;<\/p>\n<p>\/\/ \u83b7\u53d6\u5f53\u524d\u7535\u8111\u6240\u6709\u53ef\u7528\u4e32\u53e3\u540d<br \/>\nstring[] ports &#061; SerialPort.GetPortNames();<br \/>\n\/\/ \u7ed1\u5b9a\u5230\u4e0b\u62c9\u6846<br \/>\ncbPort.DataSource &#061; ports; <\/p>\n<h4>\u2461 \u914d\u7f6e\u4e32\u53e3\u56db\u8981\u7d20<\/h4>\n<p> \/\/ \u6ce2\u7279\u7387<br \/>\n_serialPort.BaudRate &#061; 9600;<br \/>\n\/\/ \u6570\u636e\u4f4d<br \/>\n_serialPort.DataBits &#061; 8;<br \/>\n\/\/ \u505c\u6b62\u4f4d&#xff08;\u679a\u4e3e&#xff09;<br \/>\n_serialPort.StopBits &#061; StopBits.One;<br \/>\n\/\/ \u6821\u9a8c\u4f4d&#xff08;\u679a\u4e3e&#xff09;<br \/>\n_serialPort.Parity &#061; Parity.None; <\/p>\n<h4>\u2462 \u6253\u5f00 \/ \u5173\u95ed\u4e32\u53e3<\/h4>\n<p> private void button1_Click(object sender, EventArgs e)<br \/>\n{<br \/>\n    if (button1.Text &#061;&#061; &#034;\u6253\u5f00&#034;)<br \/>\n    {<br \/>\n        if (cbPort.SelectedIndex &#061;&#061; -1)<br \/>\n        {<br \/>\n            MessageBox.Show(&#034;\u7535\u8111\u8fd8\u6ca1\u6709\u53ef\u7528\u7684\u4e32\u53e3&#xff0c;\u8bf7\u5148\u914d\u7f6e&#034;);<br \/>\n            return;<br \/>\n        }<br \/>\n        try<br \/>\n        {<br \/>\n            _serialPort.PortName &#061; cbPort.SelectedItem.ToString();<br \/>\n            _serialPort.BaudRate &#061; Convert.ToInt32(cbBaudRate.SelectedItem);<br \/>\n            _serialPort.Open();   \/\/ \u6253\u5f00\u4e32\u53e3<br \/>\n            button1.Text &#061; &#034;\u5173\u95ed&#034;;<br \/>\n        }<br \/>\n        catch (Exception ex)<br \/>\n        {<br \/>\n            MessageBox.Show($&#034;\u4e32\u53e3\u6253\u5f00\u5931\u8d25:{ex.Message}&#034;);<br \/>\n        }<br \/>\n    }<br \/>\n    else<br \/>\n    {<br \/>\n        _serialPort.Close();  \/\/ \u5173\u95ed\u4e32\u53e3<br \/>\n        button1.Text &#061; &#034;\u6253\u5f00&#034;;<br \/>\n    }<br \/>\n} <\/p>\n<p>  \u6253\u5f00\u4e32\u53e3\u4e00\u5b9a\u8981\u7528<br \/>\n  try-catch&#xff01;\u4e32\u53e3\u88ab\u5176\u4ed6\u7a0b\u5e8f\u5360\u7528\u3001\u53c2\u6570\u9519\u8bef\u90fd\u4f1a\u629b\u5f02\u5e38\u3002<\/p>\n<h3>8\u63a5\u6536\u6570\u636e&#xff1a;DataReceived \u4e8b\u4ef6\u4e0e\u8de8\u7ebf\u7a0bUI<\/h3>\n<p>\u4e32\u53e3\u6536\u5230\u6570\u636e\u65f6\u4f1a\u89e6\u53d1 DataReceived \u4e8b\u4ef6\u3002\u4f46\u6709\u4e2a\u5927\u5751&#xff1a;\u8fd9\u4e2a\u4e8b\u4ef6\u8fd0\u884c\u5728\u540e\u53f0\u7ebf\u7a0b&#xff0c;\u4e0d\u80fd\u76f4\u63a5\u64cd\u4f5cUI\u63a7\u4ef6&#xff0c;\u5fc5\u987b\u7528 Invoke \u5207\u56deUI\u7ebf\u7a0b\u3002<\/p>\n<p> public Form1()<br \/>\n{<br \/>\n    InitializeComponent();<br \/>\n    \/\/ \u6ce8\u518c\u6570\u636e\u63a5\u6536\u4e8b\u4ef6<br \/>\n    _serialPort.DataReceived &#043;&#061; _serialPort_DataReceived;<br \/>\n}<\/p>\n<p>private void _serialPort_DataReceived(object sender, SerialDataReceivedEventArgs e)<br \/>\n{<br \/>\n    \/\/ 1. \u6839\u636e\u53ef\u8bfb\u5b57\u8282\u6570\u521b\u5efa\u7f13\u51b2\u533a<br \/>\n    byte[] readData &#061; new byte[_serialPort.BytesToRead];<\/p>\n<p>    \/\/ 2. \u8bfb\u53d6\u6570\u636e\u5230\u7f13\u51b2\u533a<br \/>\n    _serialPort.Read(readData, 0, readData.Length);<\/p>\n<p>    \/\/ 3. \u5b57\u8282\u6570\u7ec4\u8f6c\u5b57\u7b26\u4e32&#xff08;UTF8\u7f16\u7801&#xff09;<br \/>\n    string receiveMsg &#061; Encoding.UTF8.GetString(readData);<\/p>\n<p>    \/\/ 4. \u8de8\u7ebf\u7a0b\u66f4\u65b0UI&#xff08;\u5fc5\u987b&#xff01;&#xff09;<br \/>\n    this.Invoke(new Action(() &#061;&gt;<br \/>\n    {<br \/>\n        richTextBox1.AppendText(receiveMsg &#043; &#034;\\\\r\\\\n&#034;);<br \/>\n    }));<br \/>\n} <\/p>\n<p>  \u4e3a\u4ec0\u4e48\u5fc5\u987b Invoke&#xff1f;WinForms \u63a7\u4ef6\u4e0d\u662f\u7ebf\u7a0b\u5b89\u5168\u7684&#xff0c;\u540e\u53f0\u7ebf\u7a0b\u76f4\u63a5\u6539\u63a7\u4ef6\u5c5e\u6027\u4f1a\u62a5&#034;\u7ebf\u7a0b\u95f4\u64cd\u4f5c\u65e0\u6548&#034;\u5f02\u5e38\u3002<br \/>\n  Invoke \u628a\u64cd\u4f5c\u5c01\u9001\u5230UI\u7ebf\u7a0b\u6267\u884c\u3002<\/p>\n<p>  \u4e32\u53e3\u63a5\u6536\u662f<br \/>\n  \u5f02\u6b65\u7684&#xff0c;\u6570\u636e\u53ef\u80fd\u5206\u591a\u6b21\u5230\u8fbe\u3002\u5982\u679c\u9700\u8981\u62fc\u5305&#xff0c;\u8981\u81ea\u5df1\u7ef4\u62a4\u7f13\u51b2\u533a\u548c\u534f\u8bae\u89e3\u6790\u903b\u8f91\u3002<\/p>\n<h3>9\u53d1\u9001\u6570\u636e&#xff1a;\u6587\u672c\u6a21\u5f0f\u4e0e\u5341\u516d\u8fdb\u5236\u6a21\u5f0f<\/h3>\n<p>\u53d1\u9001\u6570\u636e\u5f88\u7b80\u5355&#xff0c;\u8c03\u7528 Write \u65b9\u6cd5\u5373\u53ef\u3002\u4f46\u8981\u6ce8\u610f&#xff1a;\u4e32\u53e3\u4f20\u8f93\u7684\u662f\u5b57\u8282&#xff0c;\u5b57\u7b26\u4e32\u9700\u8981\u5148\u7f16\u7801\u3002<\/p>\n<h4>\u6587\u672c\u6a21\u5f0f\u53d1\u9001<\/h4>\n<p> \/\/ \u5b57\u7b26\u4e32 \u2192 UTF8\u5b57\u8282\u6570\u7ec4 \u2192 \u53d1\u9001<br \/>\nbyte[] writeData &#061; Encoding.UTF8.GetBytes(chatMsg.Text);<br \/>\n_serialPort.Write(writeData, 0, writeData.Length); <\/p>\n<h4>\u5341\u516d\u8fdb\u5236\u6a21\u5f0f\u53d1\u9001<\/h4>\n<p>\u5de5\u4e1a\u8bbe\u5907\u7ecf\u5e38\u9700\u8981\u53d1\u5341\u516d\u8fdb\u5236\u6307\u4ee4&#xff08;\u5982 01 03 00 00 00 01&#xff09;&#xff0c;\u9700\u8981\u5148\u628ahex\u5b57\u7b26\u4e32\u8f6c\u6210\u5b57\u8282\u6570\u7ec4&#xff1a;<\/p>\n<p> \/\/ hex\u5b57\u7b26\u4e32 &#034;01 03 00 01&#034; \u2192 byte[] {0x01, 0x03, 0x00, 0x01}<br \/>\nprivate byte[] StringToHexByte(string hexString)<br \/>\n{<br \/>\n    string[] buffer &#061; hexString.Split(&#039; &#039;);<br \/>\n    byte[] result &#061; new byte[buffer.Length];<br \/>\n    for (int i &#061; 0; i &lt; buffer.Length; i&#043;&#043;)<br \/>\n    {<br \/>\n        result[i] &#061; Convert.ToByte(buffer[i], 16);<br \/>\n    }<br \/>\n    return result;<br \/>\n}<\/p>\n<p>\/\/ \u5b57\u8282\u6570\u7ec4 \u2192 hex\u5b57\u7b26\u4e32&#xff08;\u7528\u4e8e\u663e\u793a&#xff09;<br \/>\nprivate string ByteToHexString(byte[] data)<br \/>\n{<br \/>\n    string result &#061; &#034;&#034;;<br \/>\n    foreach (var b in data)<br \/>\n        result &#043;&#061; b.ToString(&#034;X2&#034;) &#043; &#034; &#034;;<br \/>\n    return result.Trim();<br \/>\n} <\/p>\n<h4>\u5b8c\u6574\u7684\u53d1\u9001\u6309\u94ae\u903b\u8f91<\/h4>\n<p> private void btnSend_Click(object sender, EventArgs e)<br \/>\n{<br \/>\n    if (!_serialPort.IsOpen)<br \/>\n    {<br \/>\n        MessageBox.Show(&#034;\u8bf7\u5148\u8fde\u63a5\u4e32\u53e3&#xff01;&#034;);<br \/>\n        return;<br \/>\n    }<br \/>\n    if (string.IsNullOrEmpty(chatMsg.Text))<br \/>\n    {<br \/>\n        MessageBox.Show(&#034;\u8bf7\u8f93\u5165\u8981\u53d1\u9001\u7684\u5185\u5bb9&#034;);<br \/>\n        return;<br \/>\n    }<\/p>\n<p>    if (cbHexSend.Checked)<br \/>\n    {<br \/>\n        \/\/ \u5341\u516d\u8fdb\u5236\u53d1\u9001<br \/>\n        byte[] data &#061; StringToHexByte(chatMsg.Text.Trim());<br \/>\n        _serialPort.Write(data, 0, data.Length);<br \/>\n    }<br \/>\n    else<br \/>\n    {<br \/>\n        \/\/ \u6587\u672c\u53d1\u9001<br \/>\n        byte[] data &#061; Encoding.UTF8.GetBytes(chatMsg.Text);<br \/>\n        _serialPort.Write(data, 0, data.Length);<br \/>\n    }<br \/>\n} <\/p>\n<h3>10\u5b8c\u6574\u5b9e\u6218&#xff1a;\u4e00\u4e2a\u4e32\u53e3\u8c03\u8bd5\u52a9\u624b<\/h3>\n<p>\u628a\u524d\u9762\u7684\u77e5\u8bc6\u62fc\u8d77\u6765&#xff0c;\u5c31\u662f\u4e00\u4e2a\u529f\u80fd\u5b8c\u6574\u7684\u4e32\u53e3\u8c03\u8bd5\u52a9\u624b\u3002\u672c\u9879\u76ee\u662f\u4e00\u4e2a C# WinForms \u5e94\u7528&#xff0c;\u5305\u542b\u4ee5\u4e0b\u529f\u80fd&#xff1a;<\/p>\n<ul>\n<li>\u2705 \u81ea\u52a8\u626b\u63cf\u53ef\u7528\u4e32\u53e3<\/li>\n<li>\u2705 \u6ce2\u7279\u7387 \/ \u6570\u636e\u4f4d \/ \u505c\u6b62\u4f4d \/ \u6821\u9a8c\u4f4d \u53ef\u914d\u7f6e<\/li>\n<li>\u2705 \u6253\u5f00 \/ \u5173\u95ed\u4e32\u53e3<\/li>\n<li>\u2705 \u6587\u672c &amp; \u5341\u516d\u8fdb\u5236 \u53cc\u6a21\u5f0f\u6536\u53d1<\/li>\n<li>\u2705 \u5b9a\u65f6\u81ea\u52a8\u53d1\u9001<\/li>\n<li>\u2705 \u5173\u952e\u8bcd\u667a\u80fd\u56de\u590d&#xff08;Dictionary \u5339\u914d&#xff09;<\/li>\n<li>\u2705 \u9ed1\u5e95\u767d\u5b57 \/ \u767d\u5e95\u9ed1\u5b57 \u5207\u6362<\/li>\n<\/ul>\n<h4>\u5173\u952e\u8bcd\u667a\u80fd\u56de\u590d\u793a\u4f8b<\/h4>\n<p>\u6536\u5230&#034;\u82f9\u679c&#034;\u81ea\u52a8\u56de\u590d\u82f9\u679c\u7684\u4ecb\u7ecd&#xff0c;\u8fd9\u5728\u8bbe\u5907\u6307\u4ee4\u5e94\u7b54\u573a\u666f\u5f88\u5b9e\u7528&#xff1a;<\/p>\n<p> Dictionary&lt;string, string&gt; _dic &#061; new Dictionary&lt;string, string&gt;()<br \/>\n{<br \/>\n    { &#034;\u82f9\u679c&#034;, &#034;\u82f9\u679c\u539f\u4ea7\u4e8e\u4e2d\u4e9a\u5929\u5c71\u5c71\u8109&#8230;&#034; },<br \/>\n    { &#034;\u9999\u8549&#034;, &#034;\u9999\u8549\u5bcc\u542b\u94be\u548c\u7ef4\u751f\u7d20&#8230;&#034; },<br \/>\n    { &#034;\u6a58\u5b50&#034;, &#034;\u6a58\u5b50\u5bcc\u542b\u7ef4\u751f\u7d20C&#8230;&#034; }<br \/>\n};<\/p>\n<p>\/\/ \u53d1\u9001\u65f6\u5339\u914d\u5173\u952e\u8bcd<br \/>\nstring input &#061; chatMsg.Text;<br \/>\nif (_dic.ContainsKey(input))<br \/>\n{<br \/>\n    richTextBox1.AppendText(&#034;\u4ecb\u7ecd:&#034; &#043; _dic[input]);<br \/>\n}<br \/>\nelse<br \/>\n{<br \/>\n    richTextBox1.AppendText(&#034;\u672a\u5339\u914d\u5230\u5bf9\u5e94\u5173\u952e\u8bcd\\\\r\\\\n&#034;);<br \/>\n} <\/p>\n<h4>\u5b9a\u65f6\u81ea\u52a8\u53d1\u9001<\/h4>\n<p> private void cbTime_CheckedChanged(object sender, EventArgs e)<br \/>\n{<br \/>\n    if (cbTime.Checked)<br \/>\n    {<br \/>\n        timer1.Interval &#061; Convert.ToInt32(numericUpDown1.Text);<br \/>\n        timer1.Start();<br \/>\n    }<br \/>\n    else<br \/>\n    {<br \/>\n        timer1.Stop();<br \/>\n    }<br \/>\n}<\/p>\n<p>private void timer1_Tick(object sender, EventArgs e)<br \/>\n{<br \/>\n    btnSend_Click(sender, e); \/\/ \u5b9a\u65f6\u89e6\u53d1\u53d1\u9001<br \/>\n} <\/p>\n<p>  \u9879\u76ee\u7ed3\u6784&#xff1a;\u89e3\u51b3\u65b9\u6848<br \/>\n  Day07.sln \u2192 \u9879\u76ee<br \/>\n  1. \u4e32\u53e3\u8c03\u8bd5\u52a9\u624b \u2192 \u4e3b\u7a97\u4f53<br \/>\n  Form1.cs\u3002\u57fa\u4e8e .NET Framework 4.7.2&#xff0c;\u7528 Visual Studio \u6253\u5f00\u5373\u53ef\u7f16\u8bd1\u8fd0\u884c\u3002<\/p>\n<h4>&#x1f3af; \u5b66\u4e60\u8def\u7ebf\u603b\u7ed3<\/h4>\n<table>\n<tbody>\n<tr>\u9636\u6bb5\u4f60\u9700\u8981\u638c\u63e1<\/tr>\n<tr>\n<td>\u5165\u95e8<\/td>\n<td>\u4e32\u53e3\u539f\u7406\u3001DB9\u63a5\u53e3\u3001\u56db\u8981\u7d20\u914d\u7f6e<\/td>\n<\/tr>\n<tr>\n<td>\u8fdb\u9636<\/td>\n<td>C# SerialPort \u7c7b\u3001\u6536\u53d1\u6570\u636e\u3001\u8de8\u7ebf\u7a0bUI<\/td>\n<\/tr>\n<tr>\n<td>\u5b9e\u6218<\/td>\n<td>\u5341\u516d\u8fdb\u5236\u534f\u8bae\u89e3\u6790\u3001Modbus RTU\u3001\u591a\u8bbe\u5907\u603b\u7ebf<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u4e32\u53e3\u901a\u4fe1\u770b\u4f3c\u53e4\u8001&#xff0c;\u4f46\u5b83\u662f\u5de5\u4e1a\u81ea\u52a8\u5316\u7684\u57fa\u77f3\u3002\u638c\u63e1\u4e86\u5b83&#xff0c;\u4f60\u5c31\u80fd\u548c\u7edd\u5927\u591a\u6570\u5de5\u4e1a\u8bbe\u5907&#034;\u5bf9\u8bdd&#034;\u4e86\u3002\u52a8\u624b\u5199\u4e00\u4e2a\u81ea\u5df1\u7684\u4e32\u53e3\u8c03\u8bd5\u52a9\u624b&#xff0c;\u662f\u6700\u597d\u7684\u5b66\u4e60\u65b9\u5f0f&#xff01;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#x1f4d6; \u672c\u6587\u76ee\u5f55 \u4ec0\u4e48\u662f\u4e32\u53e3\u901a\u4fe1&#xff1f;\u4e32\u53e3\u957f\u4ec0\u4e48\u6837&#xff1f;DB9\u63a5\u53e3\u8be6\u89e3RS232 \/ RS422 \/ RS485 \u4e09\u5927\u6807\u51c6\u6570\u636e\u5e27\u683c\u5f0f&#xff1a;\u4e00\u5e27\u6570\u636e\u662f\u600e\u4e48\u4f20\u7684\u4e32\u53e3\u56db\u8981\u7d20&#xff1a;\u6ce2\u7279\u7387\u3001\u6570\u636e\u4f4d\u3001\u505c\u6b62\u4f4d\u3001\u6821\u9a8c\u4f4d\u52a8\u624b\u524d\u51c6\u5907&#xff1a;\u865a\u62df\u4e32\u53e3\u5de5\u5177C# \u7b2c\u4e00\u6b65&#xff1a;\u626b\u63cf\u5e76\u6253\u5f00\u4e32\u53e3\u63a5\u6536\u6570\u636e&#xff1a;DataReceived \u4e8b\u4ef6\u4e0e\u8de8\u7ebf\u7a0bUI\u53d1\u9001\u6570\u636e&#xff1a;\u6587\u672c\u6a21\u5f0f\u4e0e\u5341\u516d\u8fdb\u5236\u6a21\u5f0f\u5b8c\u6574\u5b9e\u6218&#xff1a;\u4e00\u4e2a\u4e32\u53e3\u8c03<\/p>\n","protected":false},"author":2,"featured_media":104101,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[11843,7701],"topic":[],"class_list":["post-104102","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-winforms","tag-7701"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u4e32\u53e3\u901a\u4fe1\u5165\u95e8\u5230\u5b9e\u6218\uff1a10\u6b65\u641e\u61c2\u5de5\u4e1a\u8bbe\u5907\u7684\u201c\u6084\u6084\u8bdd\u201c - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/104102.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u4e32\u53e3\u901a\u4fe1\u5165\u95e8\u5230\u5b9e\u6218\uff1a10\u6b65\u641e\u61c2\u5de5\u4e1a\u8bbe\u5907\u7684\u201c\u6084\u6084\u8bdd\u201c - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"&#x1f4d6; \u672c\u6587\u76ee\u5f55 \u4ec0\u4e48\u662f\u4e32\u53e3\u901a\u4fe1&#xff1f;\u4e32\u53e3\u957f\u4ec0\u4e48\u6837&#xff1f;DB9\u63a5\u53e3\u8be6\u89e3RS232 \/ RS422 \/ RS485 \u4e09\u5927\u6807\u51c6\u6570\u636e\u5e27\u683c\u5f0f&#xff1a;\u4e00\u5e27\u6570\u636e\u662f\u600e\u4e48\u4f20\u7684\u4e32\u53e3\u56db\u8981\u7d20&#xff1a;\u6ce2\u7279\u7387\u3001\u6570\u636e\u4f4d\u3001\u505c\u6b62\u4f4d\u3001\u6821\u9a8c\u4f4d\u52a8\u624b\u524d\u51c6\u5907&#xff1a;\u865a\u62df\u4e32\u53e3\u5de5\u5177C# \u7b2c\u4e00\u6b65&#xff1a;\u626b\u63cf\u5e76\u6253\u5f00\u4e32\u53e3\u63a5\u6536\u6570\u636e&#xff1a;DataReceived \u4e8b\u4ef6\u4e0e\u8de8\u7ebf\u7a0bUI\u53d1\u9001\u6570\u636e&#xff1a;\u6587\u672c\u6a21\u5f0f\u4e0e\u5341\u516d\u8fdb\u5236\u6a21\u5f0f\u5b8c\u6574\u5b9e\u6218&#xff1a;\u4e00\u4e2a\u4e32\u53e3\u8c03\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/104102.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-09-11T12:48:57+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260911124856-6aa3f8b8a2e05.jpg\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/104102.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/104102.html\",\"name\":\"\u4e32\u53e3\u901a\u4fe1\u5165\u95e8\u5230\u5b9e\u6218\uff1a10\u6b65\u641e\u61c2\u5de5\u4e1a\u8bbe\u5907\u7684\u201c\u6084\u6084\u8bdd\u201c - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-09-11T12:48:57+00:00\",\"dateModified\":\"2026-09-11T12:48:57+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/104102.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/104102.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/104102.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u4e32\u53e3\u901a\u4fe1\u5165\u95e8\u5230\u5b9e\u6218\uff1a10\u6b65\u641e\u61c2\u5de5\u4e1a\u8bbe\u5907\u7684\u201c\u6084\u6084\u8bdd\u201c\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u4e32\u53e3\u901a\u4fe1\u5165\u95e8\u5230\u5b9e\u6218\uff1a10\u6b65\u641e\u61c2\u5de5\u4e1a\u8bbe\u5907\u7684\u201c\u6084\u6084\u8bdd\u201c - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/104102.html","og_locale":"zh_CN","og_type":"article","og_title":"\u4e32\u53e3\u901a\u4fe1\u5165\u95e8\u5230\u5b9e\u6218\uff1a10\u6b65\u641e\u61c2\u5de5\u4e1a\u8bbe\u5907\u7684\u201c\u6084\u6084\u8bdd\u201c - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"&#x1f4d6; \u672c\u6587\u76ee\u5f55 \u4ec0\u4e48\u662f\u4e32\u53e3\u901a\u4fe1&#xff1f;\u4e32\u53e3\u957f\u4ec0\u4e48\u6837&#xff1f;DB9\u63a5\u53e3\u8be6\u89e3RS232 \/ RS422 \/ RS485 \u4e09\u5927\u6807\u51c6\u6570\u636e\u5e27\u683c\u5f0f&#xff1a;\u4e00\u5e27\u6570\u636e\u662f\u600e\u4e48\u4f20\u7684\u4e32\u53e3\u56db\u8981\u7d20&#xff1a;\u6ce2\u7279\u7387\u3001\u6570\u636e\u4f4d\u3001\u505c\u6b62\u4f4d\u3001\u6821\u9a8c\u4f4d\u52a8\u624b\u524d\u51c6\u5907&#xff1a;\u865a\u62df\u4e32\u53e3\u5de5\u5177C# \u7b2c\u4e00\u6b65&#xff1a;\u626b\u63cf\u5e76\u6253\u5f00\u4e32\u53e3\u63a5\u6536\u6570\u636e&#xff1a;DataReceived \u4e8b\u4ef6\u4e0e\u8de8\u7ebf\u7a0bUI\u53d1\u9001\u6570\u636e&#xff1a;\u6587\u672c\u6a21\u5f0f\u4e0e\u5341\u516d\u8fdb\u5236\u6a21\u5f0f\u5b8c\u6574\u5b9e\u6218&#xff1a;\u4e00\u4e2a\u4e32\u53e3\u8c03","og_url":"https:\/\/www.wsisp.com\/helps\/104102.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-09-11T12:48:57+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260911124856-6aa3f8b8a2e05.jpg"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"4 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/104102.html","url":"https:\/\/www.wsisp.com\/helps\/104102.html","name":"\u4e32\u53e3\u901a\u4fe1\u5165\u95e8\u5230\u5b9e\u6218\uff1a10\u6b65\u641e\u61c2\u5de5\u4e1a\u8bbe\u5907\u7684\u201c\u6084\u6084\u8bdd\u201c - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-09-11T12:48:57+00:00","dateModified":"2026-09-11T12:48:57+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/104102.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/104102.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/104102.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u4e32\u53e3\u901a\u4fe1\u5165\u95e8\u5230\u5b9e\u6218\uff1a10\u6b65\u641e\u61c2\u5de5\u4e1a\u8bbe\u5907\u7684\u201c\u6084\u6084\u8bdd\u201c"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/104102","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=104102"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/104102\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/104101"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=104102"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=104102"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=104102"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=104102"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}