{"id":11809,"date":"2023-02-15T12:09:55","date_gmt":"2023-02-15T04:09:55","guid":{"rendered":"https:\/\/www.modbus.cn\/?p=11809"},"modified":"2023-08-18T18:37:43","modified_gmt":"2023-08-18T10:37:43","slug":"ji-yu-c-kai-fa-de-modbus-rtu-tong-xin-xie-yi-feng-zhuang-bao","status":"publish","type":"post","link":"https:\/\/www.modbus.cn\/en\/11809.html","title":{"rendered":"\u57fa\u4e8eC#\u5f00\u53d1\u7684MODBUS RTU\u901a\u4fe1\u534f\u8bae\u5c01\u88c5\u5305"},"content":{"rendered":"<p class=\"wp-block-paragraph\">\u6839\u636e\u4f20\u5165\u7684\u53c2\u6570\uff0c\u521b\u5efa MODBUS RTU \u5b9e\u4f8b\uff1a<\/p>\r\n\r\n\r\n\r\n<div class=\"wp-block-codemirror-blocks-code-block code-block\">\r\n<pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csharp&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;TrpContentRestriction&quot;:{&quot;restriction_type&quot;:&quot;exclude&quot;,&quot;selected_languages&quot;:[],&quot;panel_open&quot;:true},&quot;language&quot;:&quot;C#&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;csharp&quot;}\">\/\/\/ &lt;summary&gt;\r\n\/\/\/ \u5efa\u7acb MODBUS RTU \u4e32\u53e3\u4e1a\u52a1\r\n\/\/\/ String comnum  =     \u4e32\u53e3\u53f7\r\n\/\/\/ int buad      =      \u4e32\u53e3\u7684\u6ce2\u7279\u7387\r\n\/\/\/ int dataLen   =      \u6570\u636e\u957f\u5ea6\r\n\/\/\/ String chklen    =      \u68c0\u9a8c\u4f4d\r\n\/\/\/ String stoplen   =      \u505c\u6b62\u4f4d\r\n\/\/\/ &lt;\/summary&gt;\r\npublic ModbusRTU_Lib(String comnum,int buad,int dataLen,string chklen,string stoplen,int scantime)\r\n<\/pre>\r\n<\/div>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">&nbsp;<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">\u6dfb\u52a0\u4e00\u4e2a MODBUS RTU \u626b\u63cf\u4ece\u7ad9\uff1a<\/p>\r\n\r\n\r\n\r\n<div class=\"wp-block-codemirror-blocks-code-block code-block\">\r\n<pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csharp&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;TrpContentRestriction&quot;:{&quot;restriction_type&quot;:&quot;exclude&quot;,&quot;selected_languages&quot;:[],&quot;panel_open&quot;:true},&quot;language&quot;:&quot;C#&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;csharp&quot;}\">\/\/\/ &lt;summary&gt;\r\n\/\/\/ \u6e05\u9664\u6240\u6709\u7684\u4ece\u7ad9\u5217\u8868\r\n\/\/\/ &lt;\/summary&gt;\r\npublic void clearAllModbusSalve()\r\n\r\n\/\/\/ &lt;summary&gt;\r\n\/\/\/ \u5220\u9664\u626b\u63cf\u5217\u8868\u4e2d\u7684\u6307\u5b9a\u4ece\u7ad9\r\n\/\/\/ &lt;\/summary&gt;\r\n\/\/\/ &lt;param name=\"whichAddr\"&gt;&lt;\/param&gt;\r\npublic void deletAllModbusSalve(int whichAddr)\r\n<\/pre>\r\n<\/div>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">\u6e05\u9664\u521b\u5efa\u7684 MODBUS RTU \u591a\u4ece\u7ad9\u626b\u63cf\u5217\u8868\uff1a<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">&nbsp;<\/p>\r\n\r\n\r\n\r\n<div class=\"wp-block-codemirror-blocks-code-block code-block\">\r\n<pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csharp&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;TrpContentRestriction&quot;:{&quot;restriction_type&quot;:&quot;exclude&quot;,&quot;selected_languages&quot;:[],&quot;panel_open&quot;:true},&quot;language&quot;:&quot;C#&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;csharp&quot;}\">\/\/\/ &lt;summary&gt;\r\n\/\/\/ \u589e\u52a0 MODBUS \u4ece\u7ad9\u626b\u63cf\u5217\u8868\r\n\/\/\/ &lt;\/summary&gt;\r\n\/\/\/ &lt;param name=\"xDeviceMdEnty\"&gt;&lt;\/param&gt;\r\npublic void addModbusSlaveScanList(DeviceMdEnty xDeviceMdEnty)\r\n<\/pre>\r\n<\/div>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">\u6253\u5f00\u4e00\u4e2a MODBUS\u00a0RTU\u00a0\u7684\u901a\u8baf\u4e32\u53e3<\/p>\r\n\r\n\r\n\r\n<div class=\"wp-block-codemirror-blocks-code-block code-block\">\r\n<pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csharp&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;TrpContentRestriction&quot;:{&quot;restriction_type&quot;:&quot;exclude&quot;,&quot;selected_languages&quot;:[],&quot;panel_open&quot;:true},&quot;language&quot;:&quot;C#&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;csharp&quot;}\">\/\/\/ &lt;summary&gt;\r\n\/\/\/ \u6253\u5f00\u4e32\u53e3\r\n\/\/\/ &lt;\/summary&gt;\r\n\/\/\/ &lt;returns&gt;&lt;\/returns&gt;\r\npublic Boolean openUartOfModbus()<\/pre>\r\n<\/div>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">\u5173\u95ed\u4e32\u53e3<\/p>\r\n\r\n\r\n\r\n<div class=\"wp-block-codemirror-blocks-code-block code-block\">\r\n<pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csharp&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;TrpContentRestriction&quot;:{&quot;restriction_type&quot;:&quot;exclude&quot;,&quot;selected_languages&quot;:[],&quot;panel_open&quot;:true},&quot;language&quot;:&quot;C#&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;csharp&quot;}\">\/\/\/ &lt;summary&gt;\r\n\/\/\/ \u5173\u95ed\u4e32\u53e3\r\n\/\/\/ &lt;\/summary&gt;\r\n\/\/\/ &lt;returns&gt;&lt;\/returns&gt;\r\npublic Boolean closeUartOfModbus()<\/pre>\r\n<\/div>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">\u542f\u52a8\u00a0MODBUS\u00a0RTU\u00a0\u7684\u5b9a\u65f6\u626b\u63cf\u4e1a\u52a1<\/p>\r\n\r\n\r\n\r\n<div class=\"wp-block-codemirror-blocks-code-block code-block\">\r\n<pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csharp&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;TrpContentRestriction&quot;:{&quot;restriction_type&quot;:&quot;exclude&quot;,&quot;selected_languages&quot;:[],&quot;panel_open&quot;:true},&quot;language&quot;:&quot;C#&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;csharp&quot;}\">\/\/\/ &lt;summary&gt;\r\n\/\/\/ \u542f\u52a8 MODBUS \u626b\u63cf\u4e1a\u52a1\r\n\/\/\/ &lt;\/summary&gt;\r\npublic void startModbusWork()<\/pre>\r\n<\/div>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">&nbsp;<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">\u53d1\u9001 MODBUS\u00a0RTU\u00a0\u6307\u4ee4<\/p>\r\n\r\n\r\n\r\n<div class=\"wp-block-codemirror-blocks-code-block code-block\">\r\n<pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csharp&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;TrpContentRestriction&quot;:{&quot;restriction_type&quot;:&quot;exclude&quot;,&quot;selected_languages&quot;:[],&quot;panel_open&quot;:true},&quot;language&quot;:&quot;C#&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;csharp&quot;}\">\u53d1\u9001\u6570\u636e\r\n*\r\nint slaveAddr = \u4ece\u7ad9\u5730\u5740\r\nint addrTe = \u8bfb\u5199\u7684\u542f\u59cb\u5730\u5740\r\nint cmdTe = \u529f\u80fd\u7801\r\nint lenTe =\u8bfb\u51fa\u6570\u636e\u957f\u5ea6\r\nbyte[] msgBuf = \u5f85\u5199\u5165\u7684\u6570\u636e\u7684\u7f13\u51b2\u671f\uff0c\u6bcf\u4e2a\u5b57\u5360 2BYTE\r\nint msgLen  = \u5199\u5165\u7684\u6570\u636e\u957f\u5ea6\r\nreturn :\r\n*   true = \u5df2\u53d1\u9001\u6570\u636e\uff0cfalse = \u672a\u53d1\u9001\r\n*\r\n*********************************************************************\/\r\n\/\/\/ &lt;summary&gt;\r\n\/\/\/\r\n\/\/\/ &lt;\/summary&gt;\r\npublic Boolean sendModbusMsg(int slaveAddr,int cmdTe, int addrTe, int lenTe, byte[]\r\nmsgBuf, int msgLen)<\/pre>\r\n<\/div>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">MODBUS\u00a0RTU\u00a0\u7684\u5b9e\u4f8b\u7684\u56de\u8c03\u65b9\u6cd5\uff0c\u8fd4\u56de\u6240\u6709\u4e32\u53e3\u6536\u5230\u7684\u6570\u636e<\/p>\r\n\r\n\r\n\r\n<div class=\"wp-block-codemirror-blocks-code-block code-block\">\r\n<pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csharp&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;TrpContentRestriction&quot;:{&quot;restriction_type&quot;:&quot;exclude&quot;,&quot;selected_languages&quot;:[],&quot;panel_open&quot;:true},&quot;language&quot;:&quot;C#&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;csharp&quot;}\">Result =  \"E00\"\uff1b\u8868\u793a\"\u521b\u5efa\u4e32\u53e3\u5931\u8d25:\"\r\nResult =  \"E01\"\uff1b\u8868\u793a\"\u4e32\u53e3\u53f7\u672a\u8bbe\u7f6e:\"\r\nResult =  \"E02\"\uff1b\u8868\u793a\"\u505c\u6b62\u4f4d\u53c2\u6570\u9519\u8bef:\"\r\nResult =  \"E03\"\uff1b\u8868\u793a\"\u6821\u9a8c\u4f4d\u53c2\u6570\u9519\u8bef:\"\r\nResult =  \"F00\"\uff1b\u8868\u793a\"\u6821\u9a8c\u4f4d\u53c2\u6570\u9519\u8bef:\"\r\nResult =  \"Y00\"\uff1b\u8868\u793a\"\u521b\u5efa\u4e32\u53e3\u6210\u529f:\"\r\nResult =  \"M00\"\uff1b\u8868\u793a\"\u63a5\u6536\u5230\u4e32\u53e3\u6570\u636e:\"<\/pre>\r\n<\/div>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">\u58f0\u660e\u5173\u4e8e\u4e8b\u4ef6\u7684\u59d4\u6258,\u53c2\u6570\u4e3a\u8981\u56de\u4f20\u7684\u6570\u636e\u7c7b\u578b,\u4e32\u53e3\u63a5\u6536\u6570\u636e<\/p>\r\n\r\n\r\n\r\n<div class=\"wp-block-codemirror-blocks-code-block code-block\">\r\n<pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csharp&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;TrpContentRestriction&quot;:{&quot;restriction_type&quot;:&quot;exclude&quot;,&quot;selected_languages&quot;:[],&quot;panel_open&quot;:true},&quot;language&quot;:&quot;C#&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;csharp&quot;}\">public delegate void ModbusRTU_EventHandler(string result, byte[] msg) ;<\/pre>\r\n<\/div>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">&nbsp;<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">MODBUS\u00a0RTU\u00a0\u7684\u5b9e\u4f8b\u7684\u56de\u8c03\u65b9\u6cd5\uff0c\u8fd4\u56de\u6240\u6709\u4e32\u53e3\u6536\u5230\u7684\u6570\u636e\u4e14\u7ecf\u8fc7\u5730\u5740\u548c\u6821\u9a8c\u7801\u9a8c\u8bc1\u7684<\/p>\r\n\r\n\r\n\r\n<div class=\"wp-block-codemirror-blocks-code-block code-block\">\r\n<pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csharp&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;TrpContentRestriction&quot;:{&quot;restriction_type&quot;:&quot;exclude&quot;,&quot;selected_languages&quot;:[],&quot;panel_open&quot;:true},&quot;language&quot;:&quot;C#&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;csharp&quot;}\">Result =  \"AE0\"\uff1b\u8868\u793a\"\u521b\u5efa\u4e32\u53e3\u5931\u8d25:\"\r\nResult =  \"CE0\"\uff1b\u8868\u793a\"\u4e32\u53e3\u53f7\u672a\u8bbe\u7f6e:\"\r\nResult =  \"DE0\"\uff1b\u8868\u793a\"\u505c\u6b62\u4f4d\u53c2\u6570\u9519\u8bef:\"\r\nResult =  \"D00\"\uff1b\u8868\u793a\"\u63a5\u6536\u5230\u6b63\u786e\u89e3\u6790\u7684\u4e32\u53e3\u6570\u636e:\"\r\nResult =  \"D01\"\uff1b\u8868\u793a\"\u529f\u80fd\u7801 0x01--\u6b63\u786e\u5e94\u7b54\u6570\u636e\uff01 :\"\r\nResult =  \"D02\"\uff1b\u8868\u793a\"\u529f\u80fd\u7801 0x02--\u6b63\u786e\u5e94\u7b54\u6570\u636e \uff01\"\r\nResult =  \"D03\"\uff1b\u8868\u793a\"\u529f\u80fd\u7801 0x03--\u6b63\u786e\u5e94\u7b54\u6570\u636e \uff01\"\r\nResult =  \"D04\"\uff1b\u8868\u793a\"\u529f\u80fd\u7801 0x04--\u6b63\u786e\u5e94\u7b54\u6570\u636e \uff01\"\r\nResult =  \"D05\"\uff1b\u8868\u793a\"\u529f\u80fd\u7801 0x05--\u6b63\u786e\u5e94\u7b54\u6570\u636e \uff01\"\r\nResult =  \"D06\"\uff1b\u8868\u793a\"\u529f\u80fd\u7801 0x06--\u6b63\u786e\u5e94\u7b54\u6570\u636e \uff01\"\r\nResult =  \"D0F\"\uff1b\u8868\u793a\"\u529f\u80fd\u7801 0x0F--\u6b63\u786e\u5e94\u7b54\u6570\u636e \uff01\"\r\nResult =  \"D10\"\uff1b\u8868\u793a\"\u529f\u80fd\u7801 0x10--\u6b63\u786e\u5e94\u7b54\u6570\u636e \uff01\"<\/pre>\r\n<\/div>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">&nbsp;<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">\u58f0\u660e\u5173\u4e8e\u4e8b\u4ef6\u7684\u59d4\u6258,\u53c2\u6570\u4e3a\u8981\u56de\u4f20\u7684\u6570\u636e\u7c7b\u578b,\u4e32\u53e3\u63a5\u6536\u6570\u636e\u5e76 MODBUS\u00a0\u9a8c\u8bc1<\/p>\r\n\r\n\r\n\r\n<div class=\"wp-block-codemirror-blocks-code-block code-block\">\r\n<pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csharp&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;TrpContentRestriction&quot;:{&quot;restriction_type&quot;:&quot;exclude&quot;,&quot;selected_languages&quot;:[],&quot;panel_open&quot;:true},&quot;language&quot;:&quot;C#&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;csharp&quot;}\">public delegate void ModbusRTU_DecodeHandler(string result, byte[] msg) ;<\/pre>\r\n<\/div>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">&nbsp;<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">\u5efa\u7acb 1 \u4e2a MODBUS RTU\u00a0\u4ece\u7ad9\u7684\u5217\u8868\uff1b<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">DLL\u00a0\u4f1a\u6839\u636e\u8bbe\u5907\u6570\u81ea\u52a8\u626b\u63cf\uff1b\u5bf9\u4e8e\u6ca1\u6709\u7684\u529f\u80fd\uff0c\u6307\u5b9a\u957f\u5ea6\u4e3a 0 \u5373\u53ef\uff1b\u5982 16 \u5165 16 \u51fa\u6570\u5b57\u91cf\u6a21\u5757\u5219\u53ef\u6307\u00a0\u5b9a\u8f93\u5165\u5bc4\u5b58\u5668\u548c\u4fdd\u6301\u5bc4\u5b58\u5668\u957f\u5ea6\u4e3a 0\u00a0<\/p>\r\n\r\n\r\n\r\n<div class=\"wp-block-codemirror-blocks-code-block code-block\">\r\n<pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csharp&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;TrpContentRestriction&quot;:{&quot;restriction_type&quot;:&quot;exclude&quot;,&quot;selected_languages&quot;:[],&quot;panel_open&quot;:true},&quot;language&quot;:&quot;C#&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;csharp&quot;}\">\/\/\/ &lt;summary&gt;\r\n\/\/\/ \u5efa\u7acb\u626b\u63cf\u5217\u8868\r\n\/\/\/ &lt;\/summary&gt;\r\n\/\/\/ &lt;param name=\"SlaveAddr\"&gt;\u8bbe\u7f6e\u5f53\u524d\u4ece\u7ad9\u7684\u7ad9\u53f7&lt;\/param&gt;\r\n\/\/\/ &lt;param name=\"CoilLen\"&gt;\u8bbe\u7f6e\u5f53\u524d\u4ece\u7ad9\u7684\u8f93\u51fa\u7ebf\u5708\u4e2a\u6570&lt;\/param&gt;        \/\/\/ &lt;param name=\"DiscLen\"&gt;\u8bbe\u7f6e\u5f53\u524d\u4ece\u7ad9\u7684\u8f93\u5165\u6570\u5b57\u91cf\u4e2a\u6570&lt;\/param&gt;      \/\/\/ &lt;param name=\"InputRegLen\"&gt;\u8bbe\u7f6e\u5f53\u524d\u4ece\u7ad9\u7684\u8f93\u5165\u5bc4\u5b58\u5668\u4e2a\u6570&lt;\/param&gt;  \/\/\/ &lt;param name=\"HoldingRegLen\"&gt;\u8bbe\u7f6e\u5f53\u524d\u4ece\u7ad9\u7684\u4fdd\u6301\u5bc4\u5b58\u5668\u4e2a\u6570&lt;\/param&gt;\r\npublic DeviceMdEnty(int SlaveAddr,  int CoilLen,  int DiscLen,  int InputRegLen,  int\r\nHoldingRegLen)<\/pre>\r\n<\/div>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">&nbsp;<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">&nbsp;<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">&nbsp;<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">&nbsp;<\/p>\r\n<span id=\"magicpostMarker\"><\/span>","protected":false},"excerpt":{"rendered":"<p>\u6839\u636e\u4f20\u5165\u7684\u53c2\u6570\uff0c\u521b\u5efa MODBUS RTU \u5b9e\u4f8b\uff1a &#038;nbs&#8230;<\/p>","protected":false},"author":1,"featured_media":27977,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","_members_access_role":[],"_members_access_error":""},"categories":[691],"tags":[1514,1512,1509,1511,1510,1513],"class_list":["post-11809","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-modbus-code-base","tag-paramgt","tag-summarygt","tag-summary","tag-1511","tag-1510","tag-1513"],"_links":{"self":[{"href":"https:\/\/www.modbus.cn\/en\/wp-json\/wp\/v2\/posts\/11809","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.modbus.cn\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.modbus.cn\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.modbus.cn\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.modbus.cn\/en\/wp-json\/wp\/v2\/comments?post=11809"}],"version-history":[{"count":0,"href":"https:\/\/www.modbus.cn\/en\/wp-json\/wp\/v2\/posts\/11809\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.modbus.cn\/en\/wp-json\/wp\/v2\/media\/27977"}],"wp:attachment":[{"href":"https:\/\/www.modbus.cn\/en\/wp-json\/wp\/v2\/media?parent=11809"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.modbus.cn\/en\/wp-json\/wp\/v2\/categories?post=11809"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.modbus.cn\/en\/wp-json\/wp\/v2\/tags?post=11809"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}