{"id":42520,"date":"2023-10-02T17:32:58","date_gmt":"2023-10-02T09:32:58","guid":{"rendered":"\/\/www.dealsbon.com\/?p=42520"},"modified":"2023-10-02T17:32:58","modified_gmt":"2023-10-02T09:32:58","slug":"qkyzyykzhjksbdkyk","status":"publish","type":"post","link":"\/\/www.dealsbon.com\/blog\/42520.html","title":{"rendered":"QModbus\u5e93\uff1a\u4e00\u79cd\u7528\u4e8e\u63a7\u5236\u548c\u76d1\u63a7\u8bbe\u5907\u7684\u5f00\u6e90\u5e93"},"content":{"rendered":"
QModbus\u662f\u4e00\u4e2a\u5f00\u6e90\u5e93\uff0c\u7528\u4e8e\u63a7\u5236\u548c\u76d1\u63a7\u73b0\u5b9e\u4e16\u754c\u4e2d\u7684\u8bbe\u5907\uff0c\u5305\u62ecPLC\u3001\u6a21\u62df\u91cf\u4f20\u611f\u5668\u3001\u5f00\u5173\u91cf\u8f93\u5165\/\u8f93\u51fa\u7b49\u3002\u5b83\u4f7f\u7528Qt\u6846\u67b6\uff0c\u652f\u6301\u591a\u79cd\u901a\u4fe1\u534f\u8bae\uff0c\u5305\u62ecModbus RTU\u548cModbus TCP\uff0c\u5e76\u4e14\u53ef\u4ee5\u8f7b\u677e\u5730\u5728Linux\u3001Windows\u548cMac OS X\u4e0a\u7f16\u8bd1\u548c\u4f7f\u7528\u3002QModbus\u5e93\u63d0\u4f9b\u4e86\u4e00\u79cd\u5b9e\u73b0Modbus\u534f\u8bae\u7684\u7b80\u5355\u65b9\u6cd5\uff0c\u53ef\u4ee5\u8282\u7701\u65f6\u95f4\u548c\u91d1\u94b1\uff0c\u5e76\u4e14\u53ef\u4ee5\u8f7b\u677e\u5730\u4e0eQt\u5e94\u7528\u7a0b\u5e8f\u96c6\u6210\u3002<\/p>\n
QModbus\u652f\u6301\u591a\u79cdModbus\u901a\u4fe1\u534f\u8bae\uff0c\u5305\u62ecModbus RTU\uff0cModbus ASCII\uff0cModbus TCP\uff0cModbus UDP\u548cModbus RTU over TCP\u3002\u5b83\u53ef\u4ee5\u4f7f\u7528\u4efb\u4f55Modbus\u8bbe\u5907\uff0c\u5305\u62ecPLC\uff0c\u6a21\u62df\u91cf\u4f20\u611f\u5668\uff0c\u5f00\u5173\u91cf\u8f93\u5165\/\u8f93\u51fa\u7b49\u3002<\/p>\n
QModbus\u5e93\u53ef\u4ee5\u5728Linux\uff0cWindows\u548cMac OS X\u4e0a\u7f16\u8bd1\u548c\u4f7f\u7528\uff0c\u56e0\u6b64\u53ef\u4ee5\u8f7b\u677e\u5730\u4e0eQt\u5e94\u7528\u7a0b\u5e8f\u96c6\u6210\u3002\u5b83\u8fd8\u53ef\u4ee5\u5728\u591a\u79cd\u786c\u4ef6\u5e73\u53f0\u4e0a\u8fd0\u884c\uff0c\u5305\u62ecARM\uff0cx86\u548cMIPS\u3002<\/p>\n
QModbus\u5e93\u652f\u6301Modbus\u52a0\u5bc6\uff0c\u4ee5\u786e\u4fdd\u901a\u4fe1\u7684\u5b89\u5168\u6027\u3002\u5b83\u8fd8\u652f\u6301\u5ba2\u6237\u7aef\u8ba4\u8bc1\uff0c\u4ee5\u786e\u4fdd\u53ea\u6709\u6388\u6743\u7684\u5ba2\u6237\u7aef\u53ef\u4ee5\u8bbf\u95eeModbus\u670d\u52a1\u5668\u3002<\/p>\n
\u8981\u4f7f\u7528QModbus\u5e93\uff0c\u9996\u5148\u9700\u8981\u4eceGitHub\u4e0b\u8f7d\u6e90\u4ee3\u7801\uff0c\u7136\u540e\u6839\u636e\u64cd\u4f5c\u7cfb\u7edf\u7c7b\u578b\u5b89\u88c5Qt\u5e93\uff0c\u6700\u540e\u4f7f\u7528Qt Creator\u7f16\u8bd1\u548c\u5b89\u88c5QModbus\u5e93\u3002<\/p>\n
\u8981\u521b\u5efaModbus\u5ba2\u6237\u7aef\uff0c\u9996\u5148\u9700\u8981\u521b\u5efa\u4e00\u4e2aQModbus\u5b9e\u4f8b\uff0c\u7136\u540e\u4f7f\u7528connectToHost()\u65b9\u6cd5\u8fde\u63a5\u5230Modbus\u670d\u52a1\u5668\uff0c\u6700\u540e\u4f7f\u7528read()\u548cwrite()\u65b9\u6cd5\u8bfb\u53d6\u548c\u5199\u5165\u6570\u636e\u3002<\/p>\n
\u8981\u521b\u5efaModbus\u670d\u52a1\u5668\uff0c\u9996\u5148\u9700\u8981\u521b\u5efa\u4e00\u4e2aQModbusServer\u5b9e\u4f8b\uff0c\u7136\u540e\u4f7f\u7528listen()\u65b9\u6cd5\u76d1\u542c\u6307\u5b9a\u7684\u7aef\u53e3\uff0c\u6700\u540e\u4f7f\u7528read()\u548cwrite()\u65b9\u6cd5\u8bfb\u53d6\u548c\u5199\u5165\u6570\u636e\u3002<\/p>\n
QModbus\u5e93\u662f\u4e00\u4e2a\u5f00\u6e90\u5e93\uff0c\u7528\u4e8e\u63a7\u5236\u548c\u76d1\u63a7\u73b0\u5b9e\u4e16\u754c\u4e2d\u7684\u8bbe\u5907\u3002<\/strong>\u5b83\u4f7f\u7528Qt\u6846\u67b6\uff0c\u652f\u6301\u591a\u79cd\u901a\u4fe1\u534f\u8bae\uff0c\u5305\u62ecModbus RTU\u548cModbus TCP\uff0c\u5e76\u4e14\u53ef\u4ee5\u8f7b\u677e\u5730\u5728Linux\u3001Windows\u548cMac OS X\u4e0a\u7f16\u8bd1\u548c\u4f7f\u7528\u3002QModbus\u5e93\u63d0\u4f9b\u4e86\u4e00\u79cd\u5b9e\u73b0Modbus\u534f\u8bae\u7684\u7b80\u5355\u65b9\u6cd5\uff0c\u53ef\u4ee5\u8282\u7701\u65f6\u95f4\u548c\u91d1\u94b1\uff0c\u5e76\u4e14\u53ef\u4ee5\u8f7b\u677e\u5730\u4e0eQt\u5e94\u7528\u7a0b\u5e8f\u96c6\u6210\u3002<\/p>\n","protected":false},"excerpt":{"rendered":" QModbus\u662f\u4e00\u4e2a\u5f00\u6e90\u5e93\uff0c\u7528\u4e8e\u63a7\u5236\u548c\u76d1\u63a7\u73b0\u5b9e\u4e16\u754c\u4e2d\u7684\u8bbe\u5907\uff0c\u5305\u62ecPLC\u3001\u6a21\u62df\u91cf\u4f20\u611f\u5668\u3001\u5f00\u5173\u91cf\u8f93\u5165\/\u8f93\u51fa\u7b49\u3002\u5b83\u4f7f\u7528Qt\u6846\u67b6\uff0c\u652f\u6301\u591a\u79cd\u901a\u4fe1\u534f\u8bae\uff0c\u5305\u62ecModbusRTU\u548cMo<\/p>\n","protected":false},"author":1,"featured_media":4132,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"default","ast-global-header-display":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","footnotes":""},"categories":[36],"tags":[78],"class_list":["post-42520","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog","tag-m-3"],"_links":{"self":[{"href":"\/\/www.dealsbon.com\/wp-json\/wp\/v2\/posts\/42520"}],"collection":[{"href":"\/\/www.dealsbon.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"\/\/www.dealsbon.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"\/\/www.dealsbon.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"\/\/www.dealsbon.com\/wp-json\/wp\/v2\/comments?post=42520"}],"version-history":[{"count":0,"href":"\/\/www.dealsbon.com\/wp-json\/wp\/v2\/posts\/42520\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"\/\/www.dealsbon.com\/wp-json\/wp\/v2\/media\/4132"}],"wp:attachment":[{"href":"\/\/www.dealsbon.com\/wp-json\/wp\/v2\/media?parent=42520"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"\/\/www.dealsbon.com\/wp-json\/wp\/v2\/categories?post=42520"},{"taxonomy":"post_tag","embeddable":true,"href":"\/\/www.dealsbon.com\/wp-json\/wp\/v2\/tags?post=42520"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}