{"id":4979,"date":"2024-10-03T18:01:01","date_gmt":"2024-10-03T10:01:01","guid":{"rendered":""},"modified":"2024-10-03T18:01:01","modified_gmt":"2024-10-03T10:01:01","slug":"plc\u8fde\u63a5485_plc\u8fde\u63a5485","status":"publish","type":"post","link":"https:\/\/mushiming.com\/4979.html","title":{"rendered":"plc\u8fde\u63a5485_plc\u8fde\u63a5485"},"content":{"rendered":"<p style=\"margin-left:.0001pt;text-align:justify;\">Q0\u4f5c\u4e3aModbus RTU Master\uff08\u4e3b\u7ad9\uff09\uff0c\u98ce\u5411\u6807\u3001\u4e09\u8f74\u6447\u6746\u4f5c\u4e3aModbus RTU Server\uff08\u4ece\u7ad9\uff09\u3002<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify;\">\n<ol>\n<li style=\"text-align:justify;\">\u5728CODESYS\u4e2d\u914d\u7f6eModbus RTU\u4e3b\u7ad9\uff0c\u53f3\u51fb\u201cDevice\u201d\uff0c\u9009\u62e9\u201c\u6dfb\u52a0\u8bbe\u5907\u201d\uff0c\u5728\u5f39\u51fa\u5bf9\u8bdd\u6846\u4e2d\u9009\u62e9\u6742\u9879\u4e0b\u7684ModbusRtuMaster,\u9009\u62e9\u201c\u6dfb\u52a0\u8bbe\u5907\u201d\u3002<\/li>\n<\/ol>\n<p style=\"margin-left:.0001pt;text-align:justify;\"><img decoding=\"async\" src=\"https:\/\/img-blog.csdnimg.cn\/20210923112633536.png\" =\"\" =\"\" alt=\"plc\u8fde\u63a5485_plc\u8fde\u63a5485 (https:\/\/mushiming.com\/) \u7b2c1\u5f20\" title=\"plc\u8fde\u63a5485_plc\u8fde\u63a5485 \u7b2c1\u5f20-\u7a46\u4e16\u660e\u535a\u5ba2\" ><\/p>\n<p style=\"text-align:justify;\">\u5de6\u4fa7\u76ee\u5f55\u6811\u4e0b\u53ef\u770b\u5230\u5982\u4e0a\u56fe\u9ec4\u8272\u8bbe\u5907\uff0c\u5373\u4e3aModbusRTU\u4e3b\u7ad9\u3002\u4f46\u662f\u9488\u5bf9\u540c\u4e00\u53f0PAC\uff0c\u6682\u65f6\u53ea\u652f\u6301\u4e00\u4e2a\u4e3b\u7ad9\u548c\u4e00\u4e2a\u4ece\u7ad9<\/p>\n<p style=\"text-align:justify;\">2.\u4e3b\u7ad9\u53c2\u6570\u8bbe\u7f6e\uff1a\u6839\u636e\u901a\u8baf\u534f\u8bae\u8bbe\u7f6e\u53c2\u6570\uff0c\u5982\u4e0b\u56fe\uff0c\u4e3b\u7ad9\u5730\u5740\u4e3a1\uff08Q0 CPU\u7aef\u5b50\u4e0a\u901a\u8baf\u53e3\u4e3a1\uff0c\u7f51\u53e3\u4e3a2\uff09\uff0c\u6ce2\u7279\u73879600\uff0c\u6570\u636e\u4f4d8\uff0c\u505c\u6b62\u4f4d1\uff0c\u65e0\u6821\u9a8c\u3002Framespace\uff1a\u7528\u4e8e\u8bbe\u7f6e\u8fde\u7eed\u53d1\u9001\u65f6\u62a5\u6587\u5e27\u4e4b\u95f4\u7684\u95f4\u9694\u65f6\u95f4<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify;\"><img decoding=\"async\" src=\"https:\/\/img-blog.csdnimg.cn\/20210923112633548.png\" =\"\" =\"\" alt=\"plc\u8fde\u63a5485_plc\u8fde\u63a5485 (https:\/\/mushiming.com\/) \u7b2c2\u5f20\" title=\"plc\u8fde\u63a5485_plc\u8fde\u63a5485 \u7b2c2\u5f20-\u7a46\u4e16\u660e\u535a\u5ba2\" ><\/p>\n<p style=\"text-align:justify;\">3.\u5728Modbus RTU\u4e3b\u7ad9\u4e2d\u914d\u7f6eModbus RTU\u4ece\u7ad9\uff0c\u53f3\u51fb\u201cModbusRtuMaster\u201d\uff0c\u9009\u62e9\u201c\u6dfb\u52a0\u8bbe\u5907\u201d\uff0c\u5728\u5f39\u51fa\u5bf9\u8bdd\u6846\u4e2d\u9009\u62e9\u6742\u9879\u4e0b\u7684ModbusRtuSlave,\u9009\u62e9\u201c\u6dfb\u52a0\u8bbe\u5907\u201d<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify;\"><img decoding=\"async\" src=\"https:\/\/img-blog.csdnimg.cn\/20210923112633555.png\" =\"\" =\"\" alt=\"plc\u8fde\u63a5485_plc\u8fde\u63a5485 (https:\/\/mushiming.com\/) \u7b2c3\u5f20\" title=\"plc\u8fde\u63a5485_plc\u8fde\u63a5485 \u7b2c3\u5f20-\u7a46\u4e16\u660e\u535a\u5ba2\" ><\/p>\n<p style=\"text-align:justify;\">4.\u4ece\u7ad9\u53c2\u6570\u8bbe\u7f6e\uff0c\u4ece\u7ad9\u5730\u5740\u4f4d1\uff0c\u76f8\u5e94\u8d85\u65f6\u9ed8\u8ba4\u3002<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify;\"><img decoding=\"async\" src=\"https:\/\/img-blog.csdnimg.cn\/20210923112633564.png\" =\"\" =\"\" alt=\"plc\u8fde\u63a5485_plc\u8fde\u63a5485 (https:\/\/mushiming.com\/) \u7b2c4\u5f20\" title=\"plc\u8fde\u63a5485_plc\u8fde\u63a5485 \u7b2c4\u5f20-\u7a46\u4e16\u660e\u535a\u5ba2\" ><\/p>\n<ol>\n<li style=\"text-align:justify;\">\u5728Modbus RTU\u4ece\u7ad9\u4e2d\u914d\u7f6e\u8f93\u5165\u548c\u8f93\u51fa\u901a\u9053\uff0c\u53f3\u51fb\u201cModbusRtuSlave\u201d\uff0c\u9009\u62e9\u201c\u6dfb\u52a0\u8bbe\u5907\u201d\uff0c\u5728\u5f39\u51fa\u5bf9\u8bdd\u6846\u4e2d\u9009\u62e9\u6742\u9879\u4e0b\u7684ModbusSlaveReadChannel\u548cModbusSlaveWriteChannel,\u9009\u62e9\u201c\u6dfb\u52a0\u8bbe\u5907\u201d<\/li>\n<\/ol>\n<p style=\"margin-left:.0001pt;text-align:justify;\"><img decoding=\"async\" src=\"https:\/\/img-blog.csdnimg.cn\/20210923112633631.png\" =\"\" =\"\" alt=\"plc\u8fde\u63a5485_plc\u8fde\u63a5485 (https:\/\/mushiming.com\/) \u7b2c5\u5f20\" title=\"plc\u8fde\u63a5485_plc\u8fde\u63a5485 \u7b2c5\u5f20-\u7a46\u4e16\u660e\u535a\u5ba2\" ><\/p>\n<ol>\n<li style=\"text-align:justify;\">\u901a\u9053\u53c2\u6570\u8bbe\u7f6e\u3002<\/li>\n<\/ol>\n<p style=\"margin-left:.0001pt;text-align:justify;\">FunctionCode:\u529f\u80fd\u7801ModbusWriteChannel\u53ef\u90091.Write Single Coil(5) 2.Write Single Register(6) 3.Write Multiple Coils(15) 4.Write Multiple Registers(16);ModbusReadChannel\u53ef\u90091.Read Coils(1) 2.Read Discrete Inputs(2) 3.Read Holding Registers(3) 4.Read Input Registers(4)<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify;\">Addr:\u5355\u4e2a\u7ebf\u5708\/\u5bc4\u5b58\u5668\u5730\u5740\u6216\u591a\u4e2a\u7ebf\u5708\/\u5bc4\u5b58\u5668\u7684\u8d77\u59cb\u5730\u5740<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify;\">Length\uff1a\u7ebf\u5708\/\u5bc4\u5b58\u5668\u6570\u91cf\uff0c\u6700\u591a160\u4e2a\u7ebf\u5708\u300110\u4e2a\u5bc4\u5b58\u5668<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify;\">Trigger\uff1a\u9009\u62e9\u901a\u9053\u89e6\u53d1\u7c7b\u578b\uff0c\u53ef\u9009Cycle\u548cRisingEdge\uff1bCycle\u4e3a\u5faa\u73af\u89e6\u53d1\uff0c\u5faa\u73af\u65f6\u95f4\u4e3aCycleTime\u8bbe\u5b9a\u7684\u65f6\u95f4\uff1bRisingEdge\u4e3a\u4e0a\u5347\u6cbf\u89e6\u53d1\uff0c\u89e6\u53d1\u53d8\u91cf\u4ea7\u751f\u4e0a\u5347\u6cbf\u65f6\u53d1\u9001\u4e00\u6b21<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify;\">\n<p style=\"margin-left:.0001pt;text-align:justify;\"><img decoding=\"async\" src=\"https:\/\/img-blog.csdnimg.cn\/20210923112633588.png\" =\"\" =\"\" alt=\"plc\u8fde\u63a5485_plc\u8fde\u63a5485 (https:\/\/mushiming.com\/) \u7b2c6\u5f20\" title=\"plc\u8fde\u63a5485_plc\u8fde\u63a5485 \u7b2c6\u5f20-\u7a46\u4e16\u660e\u535a\u5ba2\" ><\/p>\n<ol>\n<li style=\"text-align:justify;\">\u6570\u636e\u6620\u5c04<\/li>\n<\/ol>\n<p style=\"margin-left:.0001pt;text-align:justify;\"><img decoding=\"async\" src=\"https:\/\/img-blog.csdnimg.cn\/20210923112633634.png\" =\"\" =\"\" alt=\"plc\u8fde\u63a5485_plc\u8fde\u63a5485 (https:\/\/mushiming.com\/) \u7b2c7\u5f20\" title=\"plc\u8fde\u63a5485_plc\u8fde\u63a5485 \u7b2c7\u5f20-\u7a46\u4e16\u660e\u535a\u5ba2\" ><\/p>\n<p style=\"margin-left:.0001pt;text-align:justify;\"><img decoding=\"async\" src=\"https:\/\/img-blog.csdnimg.cn\/20210923112633632.png\" =\"\" =\"\" alt=\"plc\u8fde\u63a5485_plc\u8fde\u63a5485 (https:\/\/mushiming.com\/) \u7b2c8\u5f20\" title=\"plc\u8fde\u63a5485_plc\u8fde\u63a5485 \u7b2c8\u5f20-\u7a46\u4e16\u660e\u535a\u5ba2\" ><\/p>\n<p style=\"margin-left:.0001pt;text-align:justify;\">\u65e2\u53ef\u7528\u547d\u540d\u7684\u53d8\u91cf\u505a\u6570\u636e\u5904\u7406\u3002<\/p>\n<ol>\n<li style=\"text-align:justify;\"><\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"plc\u8fde\u63a5485_plc\u8fde\u63a5485Q0\u4f5c\u4e3aModbusRTUMaster\uff08\u4e3b\u7ad9\uff09\uff0c\u98ce\u5411\u6807\u3001\u4e09\u8f74\u6447\u6746\u4f5c\u4e3aModbusRTUServer\uff08\u4ece\u7ad9\uff09","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"_links":{"self":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/posts\/4979"}],"collection":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/comments?post=4979"}],"version-history":[{"count":0,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/posts\/4979\/revisions"}],"wp:attachment":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/media?parent=4979"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/categories?post=4979"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/tags?post=4979"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}