{"id":42581,"date":"2023-09-29T02:11:51","date_gmt":"2023-09-28T18:11:51","guid":{"rendered":"https:\/\/www.techphant.cn\/?p=42581"},"modified":"2023-09-29T02:11:51","modified_gmt":"2023-09-28T18:11:51","slug":"cjymzms","status":"publish","type":"post","link":"https:\/\/www.techphant.cn\/blog\/42581.html","title":{"rendered":"CRC\u6821\u9a8cModbus\u600e\u4e48\u7b97"},"content":{"rendered":"

  Modbus\u662f\u4e00\u79cd\u901a\u7528\u5de5\u4e1a\u901a\u4fe1\u534f\u8bae\uff0c\u5b83\u4f7f\u7528CRC\u6821\u9a8c\u6765\u786e\u4fdd\u6570\u636e\u4f20\u8f93\u7684\u51c6\u786e\u6027\u3002CRC\u6821\u9a8c\u662f\u4e00\u79cd\u9519\u8bef\u68c0\u6d4b\u6280\u672f\uff0c\u5b83\u53ef\u4ee5\u68c0\u6d4b\u6570\u636e\u4e2d\u7684\u6f5c\u5728\u9519\u8bef\uff0c\u4ece\u800c\u4fdd\u8bc1\u6570\u636e\u4f20\u8f93\u7684\u51c6\u786e\u6027\u3002\u672c\u6587\u5c06\u8ba8\u8bbaModbus\u4f7f\u7528CRC\u6821\u9a8c\u7684\u539f\u7406\uff0c\u4ee5\u53ca\u5982\u4f55\u6b63\u786e\u8ba1\u7b97CRC\u6821\u9a8c\u503c\u3002<\/p>\n

CRC\u6821\u9a8c\u7684\u539f\u7406<\/h2>\n

  CRC\u6821\u9a8c\uff08Cyclic Redundancy Check\uff09\u662f\u4e00\u79cd\u9519\u8bef\u68c0\u6d4b\u6280\u672f\uff0c\u5b83\u53ef\u4ee5\u68c0\u6d4b\u6570\u636e\u4e2d\u7684\u6f5c\u5728\u9519\u8bef\uff0c\u4ece\u800c\u4fdd\u8bc1\u6570\u636e\u4f20\u8f93\u7684\u51c6\u786e\u6027\u3002CRC\u6821\u9a8c\u4f7f\u7528\u67d0\u79cd\u7b97\u6cd5\uff0c\u5c06\u539f\u59cb\u6570\u636e\u8f6c\u6362\u6210\u4e00\u4e2a\u79f0\u4e3aCRC\u6821\u9a8c\u7801\u7684\u6821\u9a8c\u503c\uff0c\u7136\u540e\u5c06\u6821\u9a8c\u7801\u4e0e\u539f\u59cb\u6570\u636e\u4e00\u8d77\u53d1\u9001\uff0c\u63a5\u6536\u65b9\u6536\u5230\u6570\u636e\u540e\uff0c\u4f7f\u7528\u76f8\u540c\u7684\u7b97\u6cd5\uff0c\u91cd\u65b0\u8ba1\u7b97\u51fa\u6821\u9a8c\u7801\uff0c\u5e76\u4e0e\u63a5\u6536\u5230\u7684\u6821\u9a8c\u7801\u8fdb\u884c\u6bd4\u8f83\uff0c\u5982\u679c\u76f8\u7b49\uff0c\u5219\u8bf4\u660e\u6570\u636e\u6ca1\u6709\u88ab\u7834\u574f\uff0c\u5426\u5219\uff0c\u8bf4\u660e\u6570\u636e\u53ef\u80fd\u5df2\u7ecf\u88ab\u7834\u574f\u3002<\/p>\n

Modbus\u4f7f\u7528CRC\u6821\u9a8c\u7684\u65b9\u5f0f<\/h2>\n

  Modbus\u4f7f\u7528CRC\u6821\u9a8c\u6765\u786e\u4fdd\u6570\u636e\u4f20\u8f93\u7684\u51c6\u786e\u6027\u3002Modbus\u534f\u8bae\u4e2d\uff0c\u6821\u9a8c\u7801\u662f\u4ee516\u4f4d\u7684\u5f62\u5f0f\u5b58\u5728\u7684\uff0c\u5b83\u7531\u4e24\u4e2a\u5b57\u8282\u7ec4\u6210\uff0c\u4e00\u4e2a\u5b57\u8282\u8868\u793a\u9ad8\u4f4d\uff0c\u4e00\u4e2a\u5b57\u8282\u8868\u793a\u4f4e\u4f4d\u3002\u6821\u9a8c\u7801\u7684\u8ba1\u7b97\u65b9\u5f0f\u4e3a\uff1a\u5c06\u539f\u59cb\u6570\u636e\u4ee58\u4f4d\u4e3a\u4e00\u7ec4\uff0c\u7ec4\u6210\u4e00\u4e2a\u5b57\u8282\u5e8f\u5217\uff0c\u7136\u540e\u5c06\u6bcf\u4e2a\u5b57\u8282\u4e0e\u4e00\u4e2a\u7279\u5b9a\u7684\u503c\uff08\u7531Modbus\u534f\u8bae\u89c4\u5b9a\uff09\u8fdb\u884c\u5f02\u6216\uff08XOR\uff09\u8fd0\u7b97\uff0c\u6700\u540e\u5f97\u5230\u7684\u7ed3\u679c\u5373\u4e3a\u6821\u9a8c\u7801\u3002<\/p>\n

CRC\u6821\u9a8c\u7684\u8ba1\u7b97\u65b9\u6cd5<\/h2>\n

  1. CRC\u6821\u9a8c\u7684\u57fa\u672c\u539f\u7406<\/h3>\n

  CRC\u6821\u9a8c\u7684\u57fa\u672c\u539f\u7406\u662f\uff1a\u5c06\u539f\u59cb\u6570\u636e\u4ee58\u4f4d\u4e3a\u4e00\u7ec4\uff0c\u7ec4\u6210\u4e00\u4e2a\u5b57\u8282\u5e8f\u5217\uff0c\u7136\u540e\u5c06\u6bcf\u4e2a\u5b57\u8282\u4e0e\u4e00\u4e2a\u7279\u5b9a\u7684\u503c\uff08\u7531Modbus\u534f\u8bae\u89c4\u5b9a\uff09\u8fdb\u884c\u5f02\u6216\uff08XOR\uff09\u8fd0\u7b97\uff0c\u6700\u540e\u5f97\u5230\u7684\u7ed3\u679c\u5373\u4e3a\u6821\u9a8c\u7801\u3002<\/p>\n

  2. CRC\u6821\u9a8c\u7684\u8ba1\u7b97\u6b65\u9aa4<\/h3>\n

  CRC\u6821\u9a8c\u7684\u8ba1\u7b97\u6b65\u9aa4\u5982\u4e0b\uff1a<\/p>\n

    \n
  1. \u5c06\u6821\u9a8c\u7801\u8bbe\u7f6e\u4e3a0xFFFF\uff1b<\/li>\n
  2. \u5c06\u539f\u59cb\u6570\u636e\u4ee58\u4f4d\u4e3a\u4e00\u7ec4\uff0c\u7ec4\u6210\u4e00\u4e2a\u5b57\u8282\u5e8f\u5217\uff1b<\/li>\n
  3. \u5c06\u6bcf\u4e2a\u5b57\u8282\u4e0e\u6821\u9a8c\u7801\u8fdb\u884c\u5f02\u6216\uff08XOR\uff09\u8fd0\u7b97\uff1b<\/li>\n
  4. \u5c06\u7ed3\u679c\u4e0e\u7279\u5b9a\u7684\u503c\uff08\u7531Modbus\u534f\u8bae\u89c4\u5b9a\uff09\u8fdb\u884c\u5f02\u6216\uff08XOR\uff09\u8fd0\u7b97\uff1b<\/li>\n
  5. \u5c06\u7ed3\u679c\u4f5c\u4e3a\u65b0\u7684\u6821\u9a8c\u7801\uff0c\u91cd\u590d\u4e0a\u8ff0\u6b65\u9aa4\uff0c\u76f4\u5230\u6240\u6709\u5b57\u8282\u90fd\u88ab\u5904\u7406\u5b8c\u6bd5\uff1b<\/li>\n
  6. \u6700\u540e\u5f97\u5230\u7684\u6821\u9a8c\u7801\u5373\u4e3aCRC\u6821\u9a8c\u7801\u3002<\/li>\n<\/ol>\n

    \u603b\u7ed3<\/h2>\n

      \u672c\u6587\u8ba8\u8bba\u4e86Modbus\u4f7f\u7528CRC\u6821\u9a8c\u7684\u539f\u7406\uff0c\u4ee5\u53ca\u5982\u4f55\u6b63\u786e\u8ba1\u7b97CRC\u6821\u9a8c\u503c\u3002<\/strong>Modbus\u4f7f\u7528CRC\u6821\u9a8c\u6765\u786e\u4fdd\u6570\u636e\u4f20\u8f93\u7684\u51c6\u786e\u6027\uff0c\u5b83\u4f7f\u7528\u67d0\u79cd\u7b97\u6cd5\uff0c\u5c06\u539f\u59cb\u6570\u636e\u8f6c\u6362\u6210\u4e00\u4e2a\u79f0\u4e3aCRC\u6821\u9a8c\u7801\u7684\u6821\u9a8c\u503c\uff0c\u7136\u540e\u5c06\u6821\u9a8c\u7801\u4e0e\u539f\u59cb\u6570\u636e\u4e00\u8d77\u53d1\u9001\uff0c\u63a5\u6536\u65b9\u6536\u5230\u6570\u636e\u540e\uff0c\u4f7f\u7528\u76f8\u540c\u7684\u7b97\u6cd5\uff0c\u91cd\u65b0\u8ba1\u7b97\u51fa\u6821\u9a8c\u7801\uff0c\u5e76\u4e0e\u63a5\u6536\u5230\u7684\u6821\u9a8c\u7801\u8fdb\u884c\u6bd4\u8f83\uff0c\u4ece\u800c\u786e\u4fdd\u6570\u636e\u7684\u51c6\u786e\u6027\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

    Modbus\u662f\u4e00\u79cd\u901a\u7528\u5de5\u4e1a\u901a\u4fe1\u534f\u8bae\uff0c\u5b83\u4f7f\u7528CRC\u6821\u9a8c\u6765\u786e\u4fdd\u6570\u636e\u4f20\u8f93\u7684\u51c6\u786e\u6027\u3002CRC\u6821\u9a8c\u662f\u4e00\u79cd\u9519\u8bef\u68c0\u6d4b\u6280\u672f\uff0c\u5b83\u53ef\u4ee5\u68c0\u6d4b\u6570\u636e\u4e2d\u7684\u6f5c\u5728\u9519\u8bef\uff0c\u4ece\u800c\u4fdd\u8bc1\u6570\u636e\u4f20\u8f93\u7684\u51c6\u786e\u6027\u3002\u672c\u6587\u5c06\u8ba8\u8bba<\/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-42581","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog","tag-m-3"],"_links":{"self":[{"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/posts\/42581","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/comments?post=42581"}],"version-history":[{"count":0,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/posts\/42581\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/media\/4132"}],"wp:attachment":[{"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/media?parent=42581"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/categories?post=42581"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/tags?post=42581"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}