{"id":22630,"date":"2025-04-19T06:13:03","date_gmt":"2025-04-18T22:13:03","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/22630.html"},"modified":"2025-04-19T06:13:03","modified_gmt":"2025-04-18T22:13:03","slug":"c%e8%bd%bb%e6%9d%be%e5%ae%9e%e7%8e%b0modbustcp%e6%9c%8d%e5%8a%a1%e5%99%a8%e6%8e%a5%e5%8f%a3","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/22630.html","title":{"rendered":"C#\u8f7b\u677e\u5b9e\u73b0ModbusTCP\u670d\u52a1\u5668\u63a5\u53e3"},"content":{"rendered":"<p>\u5927\u5bb6\u597d&#xff01;\u6211\u662f\u4ed8\u5de5\u3002<\/p>\n<p>\u901a\u900f&#xff01;\u7ec8\u4e8e\u628aModbusRTU\u5f04\u660e\u767d\u4e86<\/p>\n<p>\u8fd9\u6837\u770b\u6765&#xff0c;ModbusTCP\u534f\u8bae\u592a\u7b80\u5355\u4e86<\/p>\n<p>\u592a\u7b80\u5355\u4e86&#xff01;C#\u8f7b\u677e\u5b9e\u73b0Modbus\u901a\u4fe1<\/p>\n<p>\u524d\u9762\u7ed9\u5927\u5bb6\u4ecb\u7ecd\u4e86\u4e00\u7cfb\u5217\u5173\u4e8eModbus\u548cModbusTCP\u7684\u77e5\u8bc6&#xff0c;\u4e3b\u8981\u9488\u5bf9\u7684\u662fModbusTCP\u5ba2\u6237\u7aef\u3002<\/p>\n<p>\u5728\u5b9e\u9645\u5f00\u53d1\u8fc7\u7a0b\u4e2d&#xff0c;\u6709\u53ef\u80fd\u4f1a\u9700\u8981\u5f00\u653e\u6570\u636e\u63a5\u53e3\u7ed9PLC\u6216\u7b2c\u4e09\u65b9\u5382\u5bb6\u3002<\/p>\n<p>\u4eca\u5929\u7ed9\u5927\u5bb6\u5206\u4eab\u4e00\u4e0b&#xff0c;\u5982\u4f55\u57fa\u4e8eC#\u6765ModbusTCP\u670d\u52a1\u5668\u63a5\u53e3\u3002<\/p>\n<h4>\u4e00\u3001NModbus4<\/h4>\n<p>ModbusTCP\u670d\u52a1\u5668\u7684\u672c\u8d28\u5c31\u662fTCP\u670d\u52a1\u5668&#xff0c;\u6839\u636e\u8bc6\u522bModbusTCP\u8bf7\u6c42\u62a5\u6587&#xff0c;\u8fd4\u56de\u5bf9\u5e94\u7684ModbusTCP\u62a5\u6587\u3002<\/p>\n<p>\u867d\u7136\u539f\u7406\u5f88\u5bb9\u6613\u7406\u89e3&#xff0c;\u4f46\u662f\u81ea\u5df1\u5f00\u53d1\u8fd8\u662f\u9700\u8981\u4e00\u70b9\u65f6\u95f4\u7684&#xff0c;\u5f53\u7136\u6211\u4eec\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5f00\u6e90\u5e93\u6765\u5b9e\u73b0&#xff0c;\u6211\u4eec\u8fd9\u91cc\u91c7\u7528\u7684\u662fNModbus4\u3002<\/p>\n<p>NModbus4\u662f\u4e00\u4e2a\u5f00\u653e\u6e90\u7801\u7684Modbus\u5e93\u3002<\/p>\n<p>\u6211\u4eec\u901a\u8fc7Nuget\u641c\u7d22NModbus4\u5373\u53ef\u641c\u7d22\u5b89\u88c5\u3002<\/p>\n<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"169\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418221302-6802ce6e4ae34.png\" width=\"720\" \/><\/p>\n<h4>\u4e8c\u3001ModbusTCPServer<\/h4>\n<p>\u5b89\u88c5\u597dNModbus4\u540e&#xff0c;\u6211\u4eec\u8fdb\u884c\u5c01\u88c5\u4e00\u4e0b&#xff0c;\u521b\u5efa\u4e00\u4e2aModbusTCPServer\u7c7b&#xff0c;\u5bf9\u4e8e\u8fdb\u884c\u5c01\u88c5&#xff0c;\u5c01\u88c5\u4e86\u4ee5\u4e0b\u51e0\u4e2a\u65b9\u6cd5&#xff1a;<\/p>\n<p>\u65b9\u6cd5\u4e00&#xff1a;\u5f00\u542f\u670d\u52a1<\/p>\n<p>\/\/ModbusTcpSlave\u5bf9\u8c61<br \/>\nprivate ModbusTcpSlave modbusTcpSlave &#061; null;<br \/>\n\/\/TcpListener\u5bf9\u8c61<br \/>\nprivate TcpListener tcpListener;<br \/>\npublic void StartServer(string ip, int port)<br \/>\n{<br \/>\n    tcpListener &#061; new TcpListener(IPAddress.Parse(ip), port);<br \/>\n    modbusTcpSlave &#061; ModbusTcpSlave.CreateTcp(1, tcpListener);<br \/>\n    modbusTcpSlave.Listen();<br \/>\n}<\/p>\n<p>\u65b9\u6cd5\u4e8c&#xff1a;\u5173\u95ed\u670d\u52a1<\/p>\n<p> public void StopServer()<br \/>\n {<br \/>\n     modbusTcpSlave?.Dispose();<br \/>\n }<\/p>\n<p>\u65b9\u6cd5\u4e09&#xff1a;\u5411\u4fdd\u6301\u5bc4\u5b58\u5668\u5b58\u50a8\u533a\u4e2d\u5199\u5165\u6570\u636e<\/p>\n<p>public void SetHoldingRegisterFloatValue(int offset, float value)<br \/>\n{<br \/>\n    byte[] buffer &#061; BitConverter.GetBytes(value);<br \/>\n    ushort highValue &#061; BitConverter.ToUInt16(buffer, 0);<br \/>\n    ushort lowValue &#061; BitConverter.ToUInt16(buffer, 2);<br \/>\n    \/\/\u83b7\u53d6\u4fdd\u6301\u578b\u5bc4\u5b58\u5668\u5b58\u50a8\u533a<br \/>\n    ModbusDataCollection&lt;ushort&gt; data &#061; modbusTcpSlave.DataStore.HoldingRegisters;<br \/>\n    data[offset] &#061; lowValue;<br \/>\n    data[offset &#043; 1] &#061; highValue;<br \/>\n}<br \/>\npublic void SetHoldingRegisteUShortValue(int offset, ushort value)<br \/>\n{<br \/>\n    \/\/\u83b7\u53d6\u4fdd\u6301\u578b\u5bc4\u5b58\u5668\u5b58\u50a8\u533a<br \/>\n    ModbusDataCollection&lt;ushort&gt; data &#061; modbusTcpSlave.DataStore.HoldingRegisters;<br \/>\n    data[offset] &#061; value;<br \/>\n}<\/p>\n<p>\u65b9\u6cd5\u56db&#xff1a;\u5982\u679c\u9700\u8981\u83b7\u53d6\u62a5\u6587&#xff0c;\u53ef\u4ee5\u6dfb\u52a0\u4e00\u4e9b\u4e8b\u4ef6<\/p>\n<p>public event Action&lt;object, ModbusSlaveRequestEventArgs&gt; ModbusSlaveRequestReceived;<br \/>\nprivate void ModbusTcpSlave_ModbusSlaveRequestReceived(object sender, ModbusSlaveRequestEventArgs e)<br \/>\n{<br \/>\n    ModbusSlaveRequestReceived?.Invoke(sender,e);<br \/>\n}<br \/>\npublic event Action&lt;object, ModbusSlaveRequestEventArgs&gt; ModbusSlaveWriteComplete;<br \/>\nprivate void ModbusTcpSlave_WriteComplete(object sender, ModbusSlaveRequestEventArgs e)<br \/>\n{<br \/>\n    ModbusSlaveWriteComplete?.Invoke(sender, e);<br \/>\n}<\/p>\n<h4>\u4e09\u3001\u6848\u4f8b\u5e94\u7528<\/h4>\n<p>\u6709\u4e86\u4ee5\u4e0a\u65b9\u6cd5\u540e&#xff0c;\u7f16\u5199\u4e00\u4e2a\u6848\u4f8b\u6765\u8fdb\u884c\u529f\u80fd\u6d4b\u8bd5\u3002<\/p>\n<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"464\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418221302-6802ce6e67e0f.png\" width=\"510\" \/><\/p>\n<p>\u5f00\u542f\u670d\u52a1\u548c\u5173\u95ed\u670d\u52a1\u4ee3\u7801\u5f88\u7b80\u5355&#xff0c;\u5c31\u662f\u8c03\u7528ModbusTCPServer\u53ca\u5176\u4e2d\u7684\u5bf9\u5e94\u65b9\u6cd5\u5373\u53ef\u3002<\/p>\n<p>private ModbusTCPServer modbusTCPServer &#061; new ModbusTCPServer();<br \/>\nprivate void btn_Start_Click(object sender, EventArgs e)<br \/>\n{<br \/>\n    if (this.btn_Start.Text &#061;&#061; &#034;\u5f00\u542f\u670d\u52a1&#034;)<br \/>\n    {<br \/>\n        try<br \/>\n        {<br \/>\n            int port &#061; Convert.ToInt32(this.txt_Port.Text);<br \/>\n            modbusTCPServer.StartServer(this.txt_IP.Text, port);<br \/>\n            AddLog(&#034;\u5f00\u542f\u670d\u52a1\u6210\u529f&#034;);<br \/>\n            this.btn_Start.Text &#061; &#034;\u5173\u95ed\u670d\u52a1&#034;;<br \/>\n        }<br \/>\n        catch (Exception ex)<br \/>\n        {<br \/>\n            AddLog(&#034;\u5f00\u542f\u670d\u52a1\u5931\u8d25&#xff1a;&#034; &#043; ex.Message);<br \/>\n        }<br \/>\n    }<br \/>\n    else<br \/>\n    {<br \/>\n        modbusTCPServer.StopServer();<br \/>\n        this.btn_Start.Text &#061; &#034;\u5f00\u542f\u670d\u52a1&#034;;<br \/>\n    }<br \/>\n}<\/p>\n<p>\u670d\u52a1\u5f00\u542f\u540e&#xff0c;\u53ef\u4ee5\u901a\u8fc7\u6309\u94ae\u5411\u6307\u5b9a\u5bc4\u5b58\u5668\u4e2d\u5199\u5165\u6570\u636e&#xff0c;\u8fd9\u91cc\u5df2\u7ecf\u5c01\u88c5\u597d\u4e86\u65b9\u6cd5&#xff0c;\u76f4\u63a5\u8c03\u7528\u5373\u53ef\u3002<\/p>\n<p> private void btn_WriteFloat_Click(object sender, EventArgs e)<br \/>\n {<br \/>\n     int address &#061; Convert.ToInt32(this.txt_Address.Text);<br \/>\n     float value &#061; Convert.ToSingle(this.txt_Value.Text);<br \/>\n     modbusTCPServer.SetHoldingRegisterFloatValue(address, value);<br \/>\n     AddLog(&#034;\u5199\u5165\u5730\u5740&#xff1a;&#034; &#043; address &#043; &#034;  \u6d6e\u70b9\u6570&#xff1a;&#034; &#043; value);<br \/>\n }<br \/>\n private void btn_WriteUShort_Click(object sender, EventArgs e)<br \/>\n {<br \/>\n     int address &#061; Convert.ToInt32(this.txt_Address.Text);<br \/>\n     ushort value &#061; Convert.ToUInt16(this.txt_Value.Text);<br \/>\n     modbusTCPServer.SetHoldingRegisteUShortValue(address, value);<br \/>\n     AddLog(&#034;\u5199\u5165\u5730\u5740&#xff1a;&#034; &#043; address &#043; &#034;  \u6574\u6570&#xff1a;&#034; &#043; value);<br \/>\n }<\/p>\n<p>\u6700\u7ec8\u5b9e\u73b0\u6548\u679c\u5982\u4e0b\u6240\u793a&#xff1a;<\/p>\n<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"455\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418221302-6802ce6e8acdf.png\" width=\"496\" \/><\/p>\n<p>\u7528Modbus Poll\u8f6f\u4ef6\u8bfb\u53d6\u7ed3\u5982\u4e0b&#xff1a;<\/p>\n<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"449\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418221302-6802ce6eadf1c.png\" width=\"628\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1k\u6b21\uff0c\u70b9\u8d5e8\u6b21\uff0c\u6536\u85cf11\u6b21\u3002\u5927\u5bb6\u597d\uff01\u6211\u662f\u4ed8\u5de5\u3002\u901a\u900f\uff01\u7ec8\u4e8e\u628aModbusRTU\u5f04\u660e\u767d\u4e86\u8fd9\u6837\u770b\u6765\uff0cModbusTCP\u534f\u8bae\u592a\u7b80\u5355\u4e86\u592a\u7b80\u5355\u4e86\uff01C#\u8f7b\u677e\u5b9e\u73b0Modbus\u901a\u4fe1\u524d\u9762\u7ed9\u5927\u5bb6\u4ecb\u7ecd\u4e86\u4e00\u7cfb\u5217\u5173\u4e8eModbus\u548cModbusTCP\u7684\u77e5\u8bc6\uff0c\u4e3b\u8981\u9488\u5bf9\u7684\u662fModbusTCP\u5ba2\u6237\u7aef\u3002\u5728\u5b9e\u9645\u5f00\u53d1\u8fc7\u7a0b\u4e2d\uff0c\u6709\u53ef\u80fd\u4f1a\u9700\u8981\u5f00\u653e\u6570\u636e\u63a5\u53e3\u7ed9PLC\u6216\u7b2c\u4e09\u65b9\u5382\u5bb6\u3002\u4eca\u5929\u7ed9\u5927\u5bb6\u5206\u4eab\u4e00\u4e0b\uff0c\u5982\u4f55\u57fa\u4e8eC#\u6765ModbusTCP\u670d\u52a1\u5668\u63a5\u53e3\u3002\u4e00\u3001NModbus4ModbusTCP\u670d\u52a1\u5668\u7684\u672c\u8d28\u5c31\u662fTCP\u670d\u52a1\u5668\uff0c\u6839\u636e\u8bc6\u522bModbusTCP\u8bf7\u6c42\u62a5\u6587\uff0c\u8fd4\u56de\u5bf9\u5e94\u7684_c# modbus tcp<\/p>\n","protected":false},"author":2,"featured_media":22626,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[55,1743,1742,190,43],"topic":[],"class_list":["post-22630","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-c","tag-modbustcp","tag-1742","tag-190","tag-43"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>C#\u8f7b\u677e\u5b9e\u73b0ModbusTCP\u670d\u52a1\u5668\u63a5\u53e3 - \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\/22630.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"C#\u8f7b\u677e\u5b9e\u73b0ModbusTCP\u670d\u52a1\u5668\u63a5\u53e3 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1k\u6b21\uff0c\u70b9\u8d5e8\u6b21\uff0c\u6536\u85cf11\u6b21\u3002\u5927\u5bb6\u597d\uff01\u6211\u662f\u4ed8\u5de5\u3002\u901a\u900f\uff01\u7ec8\u4e8e\u628aModbusRTU\u5f04\u660e\u767d\u4e86\u8fd9\u6837\u770b\u6765\uff0cModbusTCP\u534f\u8bae\u592a\u7b80\u5355\u4e86\u592a\u7b80\u5355\u4e86\uff01C#\u8f7b\u677e\u5b9e\u73b0Modbus\u901a\u4fe1\u524d\u9762\u7ed9\u5927\u5bb6\u4ecb\u7ecd\u4e86\u4e00\u7cfb\u5217\u5173\u4e8eModbus\u548cModbusTCP\u7684\u77e5\u8bc6\uff0c\u4e3b\u8981\u9488\u5bf9\u7684\u662fModbusTCP\u5ba2\u6237\u7aef\u3002\u5728\u5b9e\u9645\u5f00\u53d1\u8fc7\u7a0b\u4e2d\uff0c\u6709\u53ef\u80fd\u4f1a\u9700\u8981\u5f00\u653e\u6570\u636e\u63a5\u53e3\u7ed9PLC\u6216\u7b2c\u4e09\u65b9\u5382\u5bb6\u3002\u4eca\u5929\u7ed9\u5927\u5bb6\u5206\u4eab\u4e00\u4e0b\uff0c\u5982\u4f55\u57fa\u4e8eC#\u6765ModbusTCP\u670d\u52a1\u5668\u63a5\u53e3\u3002\u4e00\u3001NModbus4ModbusTCP\u670d\u52a1\u5668\u7684\u672c\u8d28\u5c31\u662fTCP\u670d\u52a1\u5668\uff0c\u6839\u636e\u8bc6\u522bModbusTCP\u8bf7\u6c42\u62a5\u6587\uff0c\u8fd4\u56de\u5bf9\u5e94\u7684_c# modbus tcp\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/22630.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-04-18T22:13:03+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418221302-6802ce6e4ae34.png\" \/>\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=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/22630.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/22630.html\",\"name\":\"C#\u8f7b\u677e\u5b9e\u73b0ModbusTCP\u670d\u52a1\u5668\u63a5\u53e3 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-04-18T22:13:03+00:00\",\"dateModified\":\"2025-04-18T22:13:03+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/22630.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/22630.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/22630.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"C#\u8f7b\u677e\u5b9e\u73b0ModbusTCP\u670d\u52a1\u5668\u63a5\u53e3\"}]},{\"@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":"C#\u8f7b\u677e\u5b9e\u73b0ModbusTCP\u670d\u52a1\u5668\u63a5\u53e3 - \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\/22630.html","og_locale":"zh_CN","og_type":"article","og_title":"C#\u8f7b\u677e\u5b9e\u73b0ModbusTCP\u670d\u52a1\u5668\u63a5\u53e3 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1k\u6b21\uff0c\u70b9\u8d5e8\u6b21\uff0c\u6536\u85cf11\u6b21\u3002\u5927\u5bb6\u597d\uff01\u6211\u662f\u4ed8\u5de5\u3002\u901a\u900f\uff01\u7ec8\u4e8e\u628aModbusRTU\u5f04\u660e\u767d\u4e86\u8fd9\u6837\u770b\u6765\uff0cModbusTCP\u534f\u8bae\u592a\u7b80\u5355\u4e86\u592a\u7b80\u5355\u4e86\uff01C#\u8f7b\u677e\u5b9e\u73b0Modbus\u901a\u4fe1\u524d\u9762\u7ed9\u5927\u5bb6\u4ecb\u7ecd\u4e86\u4e00\u7cfb\u5217\u5173\u4e8eModbus\u548cModbusTCP\u7684\u77e5\u8bc6\uff0c\u4e3b\u8981\u9488\u5bf9\u7684\u662fModbusTCP\u5ba2\u6237\u7aef\u3002\u5728\u5b9e\u9645\u5f00\u53d1\u8fc7\u7a0b\u4e2d\uff0c\u6709\u53ef\u80fd\u4f1a\u9700\u8981\u5f00\u653e\u6570\u636e\u63a5\u53e3\u7ed9PLC\u6216\u7b2c\u4e09\u65b9\u5382\u5bb6\u3002\u4eca\u5929\u7ed9\u5927\u5bb6\u5206\u4eab\u4e00\u4e0b\uff0c\u5982\u4f55\u57fa\u4e8eC#\u6765ModbusTCP\u670d\u52a1\u5668\u63a5\u53e3\u3002\u4e00\u3001NModbus4ModbusTCP\u670d\u52a1\u5668\u7684\u672c\u8d28\u5c31\u662fTCP\u670d\u52a1\u5668\uff0c\u6839\u636e\u8bc6\u522bModbusTCP\u8bf7\u6c42\u62a5\u6587\uff0c\u8fd4\u56de\u5bf9\u5e94\u7684_c# modbus tcp","og_url":"https:\/\/www.wsisp.com\/helps\/22630.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-04-18T22:13:03+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418221302-6802ce6e4ae34.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/22630.html","url":"https:\/\/www.wsisp.com\/helps\/22630.html","name":"C#\u8f7b\u677e\u5b9e\u73b0ModbusTCP\u670d\u52a1\u5668\u63a5\u53e3 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-04-18T22:13:03+00:00","dateModified":"2025-04-18T22:13:03+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/22630.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/22630.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/22630.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"C#\u8f7b\u677e\u5b9e\u73b0ModbusTCP\u670d\u52a1\u5668\u63a5\u53e3"}]},{"@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\/22630","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=22630"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/22630\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/22626"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=22630"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=22630"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=22630"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=22630"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}