{"id":45267,"date":"2025-06-23T09:46:25","date_gmt":"2025-06-23T01:46:25","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/45267.html"},"modified":"2025-06-23T09:46:25","modified_gmt":"2025-06-23T01:46:25","slug":"modbus-tcp-%e6%9c%8d%e5%8a%a1%e5%99%a8%ef%bc%9aw5500io-m-%e5%ae%9e%e7%8e%b0%e8%b6%85%e6%a0%87%e6%95%b0%e6%8d%ae%e9%82%ae%e4%bb%b6%e5%91%8a%e8%ad%a6","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/45267.html","title":{"rendered":"Modbus TCP \u670d\u52a1\u5668\uff1aW5500io-M \u5b9e\u73b0\u8d85\u6807\u6570\u636e\u90ae\u4ef6\u544a\u8b66"},"content":{"rendered":"<p id=\"main-toc\">\u76ee\u5f55<\/p>\n<p id=\"1%20%E5%89%8D%E8%A8%80-toc\" style=\"margin-left:0px\">1 \u524d\u8a00<\/p>\n<p id=\"2%20%E9%A1%B9%E7%9B%AE%E7%8E%AF%E5%A2%83-toc\" style=\"margin-left:0px\">2 \u9879\u76ee\u73af\u5883<\/p>\n<p id=\"2.1%20%E7%A1%AC%E4%BB%B6%E7%8E%AF%E5%A2%83-toc\" style=\"margin-left:40px\">2.1 \u786c\u4ef6\u73af\u5883<\/p>\n<p id=\"2.2%20%E8%BD%AF%E4%BB%B6%E7%8E%AF%E5%A2%83-toc\" style=\"margin-left:40px\">2.2 \u8f6f\u4ef6\u73af\u5883<\/p>\n<p id=\"3%20%E7%A1%AC%E4%BB%B6%E8%BF%9E%E6%8E%A5%E5%92%8C%E6%96%B9%E6%A1%88-toc\" style=\"margin-left:0px\">3 \u786c\u4ef6\u8fde\u63a5\u548c\u65b9\u6848<\/p>\n<p id=\"3.3%20W5500%E7%A1%AC%E4%BB%B6%E8%BF%9E%E6%8E%A5-toc\" style=\"margin-left:40px\">3.3 W5500\u786c\u4ef6\u8fde\u63a5<\/p>\n<p id=\"3.4%20%E6%96%B9%E6%A1%88%E5%9B%BE%E7%A4%BA-toc\" style=\"margin-left:40px\">3.4 \u65b9\u6848\u56fe\u793a<\/p>\n<p id=\"4%20%E4%BE%8B%E7%A8%8B%E4%BF%AE%E6%94%B9-toc\" style=\"margin-left:0px\">4 \u4f8b\u7a0b\u4fee\u6539<\/p>\n<p id=\"5%20%E9%85%8D%E7%BD%AE%E8%BF%9E%E6%8E%A5-toc\" style=\"margin-left:0px\">5 \u914d\u7f6e\u8fde\u63a5<\/p>\n<p id=\"5.1%20%E4%B8%B2%E5%8F%A3%E6%89%93%E5%8D%B0-toc\" style=\"margin-left:40px\">5.1 \u4e32\u53e3\u6253\u5370<\/p>\n<p id=\"5.2%20Modbus%20Master%20Suite-toc\" style=\"margin-left:40px\">5.2 Modbus Master Suite<\/p>\n<p id=\"6%20%E5%8F%91%E9%80%81%E6%95%B0%E6%8D%AE-toc\" style=\"margin-left:0px\">6 \u53d1\u9001\u6570\u636e<\/p>\n<p id=\"7%20%E6%95%88%E6%9E%9C%E5%B1%95%E7%A4%BA%E5%B9%B6%E8%A7%A3%E6%9E%90-toc\" style=\"margin-left:0px\">7 \u6548\u679c\u5c55\u793a\u5e76\u89e3\u6790<\/p>\n<p id=\"8%20%E6%80%BB%E7%BB%93-toc\" style=\"margin-left:0px\">8 \u603b\u7ed3<\/p>\n<hr id=\"hr-toc\" \/>\n<h2 id=\"1%20%E5%89%8D%E8%A8%80\" style=\"margin-left:0pt;text-align:left\"><span style=\"color:#1a1a1a\">1 \u524d\u8a00<\/span><\/h2>\n<p style=\"margin-left:0;margin-right:0;text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Modbus\u662f\u4e00\u79cd\u4e32\u884c\u901a\u4fe1\u534f\u8bae&#xff0c;\u6700\u521d\u4e3a\u5de5\u4e1a\u81ea\u52a8\u5316\u9886\u57df\u8bbe\u8ba1&#xff0c;\u56e0\u5176\u7b80\u5355\u3001\u5f00\u653e\u3001\u6613\u4e8e\u5b9e\u73b0\u800c\u6210\u4e3a\u5de5\u4e1a\u7535\u5b50\u8bbe\u5907\u95f4\u901a\u4fe1\u7684\u4e8b\u5b9e\u6807\u51c6<\/span><\/p>\n<p style=\"margin-left:0;margin-right:0;text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Modbus \u7684\u5de5\u4f5c\u539f\u7406\u56f4\u7ed5\u7740\u4e09\u4e2a\u6838\u5fc3\u90e8\u5206&#xff1a;\u4e3b\u7ad9&#xff08;Master&#xff09;\u3001\u4ece\u7ad9&#xff08;Slave&#xff09; \u548c \u5bc4\u5b58\u5668&#xff08;Registers&#xff09;\u3002\u4e3b\u7ad9\u8d1f\u8d23\u5411\u7279\u5b9a\u4ece\u7ad9\u53d1\u9001\u6570\u636e\u8bf7\u6c42\u6216\u5199\u5165\u547d\u4ee4&#xff0c;\u4ece\u7ad9\u5219\u5904\u7406\u8fd9\u4e9b\u547d\u4ee4&#xff08;\u8bfb\u53d6\u6216\u4fee\u6539\u81ea\u8eab\u5bc4\u5b58\u5668\u6570\u636e&#xff09;\u5e76\u5411\u4e3b\u7ad9\u8fd4\u56de\u54cd\u5e94\u3002\u8fd9\u79cd\u4e3b\u7ad9\u8f6e\u8be2\u3001\u4ece\u7ad9\u54cd\u5e94\u7684\u540c\u6b65\u6a21\u5f0f&#xff0c;\u4f7f\u5176\u975e\u5e38\u9002\u5408\u4e8e\u5de5\u4e1a\u8bbe\u5907\u7684\u72b6\u6001\u76d1\u63a7\u548c\u63a7\u5236\u3002<\/span><\/p>\n<p style=\"margin-left:0;margin-right:0;text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0SMTP (Simple Mail Transfer Protocol) \u662f\u4e00\u79cd\u7535\u5b50\u90ae\u4ef6\u4f20\u8f93\u534f\u8bae&#xff0c;\u57fa\u4e8e TCP\/IP&#xff0c;\u91c7\u7528\u5ba2\u6237\u7aef-\u670d\u52a1\u5668\u6a21\u578b\u548c\u5b58\u50a8\u8f6c\u53d1\u673a\u5236&#xff0c;\u4e13\u7528\u4e8e\u7535\u5b50\u90ae\u4ef6\u7684\u53d1\u9001\u4e0e\u4f20\u8f93\u3002<\/span><\/p>\n<p style=\"margin-left:0;margin-right:0;text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0SMTP \u7684\u5de5\u4f5c\u539f\u7406\u56f4\u7ed5\u7740\u4e09\u4e2a\u6838\u5fc3\u90e8\u5206&#xff1a;\u53d1\u9001\u65b9 SMTP \u5ba2\u6237\u7aef\u3001\u63a5\u6536\u65b9 SMTP \u670d\u52a1\u5668 \u548c \u547d\u4ee4\/\u54cd\u5e94\u673a\u5236\u3002\u53d1\u9001\u65b9\u5ba2\u6237\u7aef\u8fde\u63a5\u670d\u52a1\u5668&#xff0c;\u901a\u8fc7\u6587\u672c\u547d\u4ee4&#xff08;\u5982 MAIL FROM, RCPT TO, DATA&#xff09;\u6307\u5b9a\u53d1\u4ef6\u4eba\u3001\u6536\u4ef6\u4eba\u5e76\u4f20\u8f93\u90ae\u4ef6\u5185\u5bb9&#xff1b;\u63a5\u6536\u65b9\u670d\u52a1\u5668\u5904\u7406\u547d\u4ee4\u3001\u9a8c\u8bc1\u4fe1\u606f&#xff0c;\u5e76\u5c06\u90ae\u4ef6\u5b58\u5165\u76ee\u6807\u90ae\u7bb1\u6216\u8f6c\u53d1\u3002\u8fd9\u79cd\u57fa\u4e8e\u547d\u4ee4\u5e8f\u5217\u7684\u6a21\u5f0f&#xff0c;\u786e\u4fdd\u4e86\u7535\u5b50\u90ae\u4ef6\u5728\u4e92\u8054\u7f51\u4e0a\u7684\u53ef\u9760\u4f20\u8f93<\/span><\/p>\n<p style=\"margin-left:0;margin-right:0;text-align:center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"184\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250623014620-6858b1ecb45f6.jpg\" width=\"175\" \/><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"212\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250623014620-6858b1eccd5b2.png\" width=\"178\" \/><\/p>\n<p style=\"margin-left:0;margin-right:0;text-align:justify\"><span style=\"color:#000000\">W5500io-M<\/span><span style=\"background-color:#ffffff\"><span style=\"color:#333333\"> \u662f\u709c\u4e16\u63a8\u51fa\u7684\u9ad8\u6027\u80fdSPI\u8f6c\u4ee5\u592a\u7f51\u6a21\u5757&#xff0c;\u5177\u6709\u4ee5\u4e0b\u7279\u70b9&#xff1a;<\/span><\/span><\/p>\n<ul>\n<li style=\"text-align:left\"><span style=\"background-color:#ffffff\"><span style=\"color:#1c1f23\">\u6781\u7b80\u8bbe\u8ba1&#xff1a;\u96c6\u6210MAC\u3001PHY\u300132KB\u7f13\u5b58\u53caRJ45\u7f51\u53e3&#xff0c;\u901a\u8fc74\u7ebfSPI\u63a5\u53e3\u76f4\u8fde\u4e3b\u63a7&#xff0c;3.3V\u4f9b\u7535&#xff0c;\u7d27\u51d1\u5c3a\u5bf8\u9002\u914d\u5d4c\u5165\u5f0f\u573a\u666f \u3002 <\/span><\/span><\/li>\n<li style=\"text-align:left\"><span style=\"background-color:#ffffff\"><span style=\"color:#1c1f23\">\u7b80\u5355\u6613\u7528&#xff1a;\u7528\u6237\u65e0\u9700\u518d\u79fb\u690d\u590d\u6742\u7684TCP\/IP\u534f\u8bae\u6808\u5230MCU\u4e2d&#xff0c;\u53ef\u76f4\u63a5\u57fa\u4e8e\u5e94\u7528\u5c42\u6570\u636e\u505a\u5f00\u53d1\u3002<\/span><\/span><\/li>\n<li style=\"text-align:left\"><span style=\"background-color:#ffffff\"><span style=\"color:#1c1f23\">\u8d44\u6599\u4e30\u5bcc&#xff1a;\u63d0\u4f9b\u4e30\u5bcc\u7684MCU\u5e94\u7528\u4f8b\u7a0b\u548c\u786c\u4ef6\u53c2\u8003\u8bbe\u8ba1&#xff0c;\u53ef\u76f4\u63a5\u53c2\u8003\u4f7f\u7528&#xff0c;\u5927\u5927\u7f29\u77ed\u7814\u53d1\u65f6\u95f4&#xff0c;\u786c\u4ef6\u517c\u5bb9W5100<\/span><\/span><span style=\"background-color:#ffffff\"><span style=\"color:#1c1f23\">S<\/span><\/span><span style=\"background-color:#ffffff\"><span style=\"color:#1c1f23\">io<\/span><\/span><span style=\"background-color:#ffffff\"><span style=\"color:#1c1f23\">-M\u6a21\u7ec4&#xff0c;\u65b9\u4fbf\u65b9\u6848\u5f00\u53d1\u4e0e\u8fed\u4ee3\u3002<\/span><\/span><\/li>\n<li style=\"text-align:left\"><span style=\"background-color:#ffffff\"><span style=\"color:#1c1f23\">\u5e94\u7528\u5e7f\u6cdb&#xff1a;\u5728\u5de5\u4e1a\u63a7\u5236\u3001\u667a\u80fd\u7535\u7f51\u3001\u5145\u7535\u6869\u3001\u5b89\u9632\u6d88\u9632\u3001\u65b0\u80fd\u6e90\u3001\u50a8\u80fd\u7b49\u9886\u57df\u90fd\u6709\u5e7f\u6cdb\u5e94\u7528\u3002<\/span><\/span><\/li>\n<\/ul>\n<p style=\"margin-left:0;margin-right:0;text-align:left\"><span style=\"color:#333333\">\u4ea7\u54c1\u94fe\u63a5&#xff1a;<\/span>\u5546\u54c1\u8be6\u60c5<\/p>\n<h2 id=\"2%20%E9%A1%B9%E7%9B%AE%E7%8E%AF%E5%A2%83\" style=\"margin-left:0pt;text-align:left\"><span style=\"color:#1a1a1a\">2 \u9879\u76ee\u73af\u5883<\/span><\/h2>\n<h3 id=\"2.1%20%E7%A1%AC%E4%BB%B6%E7%8E%AF%E5%A2%83\" style=\"margin-left:0pt;text-align:left\"><span style=\"color:#1a1a1a\">2.1 \u786c\u4ef6\u73af\u5883<\/span><\/h3>\n<li style=\"text-align:left\"><span style=\"color:#333333\">W5500io-M<\/span><\/li>\n<li style=\"text-align:left\"><span style=\"color:#333333\">STM32F103VCT6 EVB<\/span><\/li>\n<li style=\"text-align:left\"><span style=\"color:#333333\">\u7f51\u7edc\u8fde\u63a5\u7ebf<\/span><\/li>\n<li style=\"text-align:left\"><span style=\"color:#333333\">\u675c\u90a6\u7ebf\u82e5\u5e72<\/span><\/li>\n<li style=\"text-align:left\"><span style=\"color:#333333\">\u4ea4\u6362\u673a\u6216\u8def\u7531\u5668<\/span><\/li>\n<h3 id=\"2.2%20%E8%BD%AF%E4%BB%B6%E7%8E%AF%E5%A2%83\" style=\"margin-left:0pt;text-align:left\"><span style=\"color:#1a1a1a\">2.2 \u8f6f\u4ef6\u73af\u5883<\/span><\/h3>\n<li style=\"text-align:left\"><span style=\"background-color:#ffffff\"><span style=\"color:#333333\">\u90ae\u7bb1<\/span><\/span><\/li>\n<li style=\"text-align:left\"><span style=\"color:#333333\">Modbus Master Suite<\/span><\/li>\n<li style=\"text-align:left\">\u98de\u601d\u521b\u4e32\u53e3\u52a9\u624b<\/li>\n<li style=\"text-align:left\"><span style=\"background-color:#ffffff\"><span style=\"color:#333333\">\u4f8b\u7a0b\u8fde\u63a5<\/span><\/span><span style=\"color:#333333\">:<\/span>https:\/\/www.w5500.com\/w5500.html<\/li>\n<h2 id=\"3%20%E7%A1%AC%E4%BB%B6%E8%BF%9E%E6%8E%A5%E5%92%8C%E6%96%B9%E6%A1%88\" style=\"margin-left:0pt;text-align:left\"><span style=\"color:#1a1a1a\">3<\/span> <span style=\"color:#1a1a1a\">\u786c\u4ef6\u8fde\u63a5\u548c\u65b9\u6848<\/span><\/h2>\n<h3 id=\"3.3%20W5500%E7%A1%AC%E4%BB%B6%E8%BF%9E%E6%8E%A5\" style=\"margin-left:0pt;text-align:left\"><span style=\"color:#1a1a1a\">3.3 W5500\u786c\u4ef6\u8fde\u63a5<\/span><\/h3>\n<p>  <span style=\"background-color:#fafafa\"><span style=\"color:#000000\">\/\/W5500_SCS&#8212;&gt;STM32_GPIOD7\/*W5500\u7684\u7247\u9009\u5f15\u811a*\/<\/span><br \/>\n<span style=\"color:#000000\">\/\/W5500_SCLK&#8212;&gt;STM32_GPIOB13\/*W5500\u7684\u65f6\u949f\u5f15\u811a*\/<\/span><br \/>\n<span style=\"color:#000000\">\/\/W5500_MISO&#8212;&gt;STM32_GPIOB14\/*W5500\u7684MISO\u5f15\u811a*\/ <\/span><br \/>\n<span style=\"color:#000000\">\/\/W5500_MOSI&#8212;&gt;STM32_GPIOB15\/*W5500\u7684MOSI\u5f15\u811a*\/ <\/span><br \/>\n<span style=\"color:#000000\">\/\/W5500_RESET&#8212;&gt;STM32_GPIOD8\/*W5500\u7684RESET\u5f15\u811a*\/ <\/span><br \/>\n<span style=\"color:#000000\">\/\/W5500_INT&#8212;&gt;STM32_GPIOD9\/*W5500\u7684INT\u5f15\u811a*\/<\/span><\/span> <\/p>\n<h3 id=\"3.4%20%E6%96%B9%E6%A1%88%E5%9B%BE%E7%A4%BA\" style=\"margin-left:0pt;text-align:left\"><span style=\"color:#1a1a1a\">3.4 \u65b9\u6848\u56fe\u793a<\/span><\/h3>\n<p style=\"margin-left:0;margin-right:0;text-align:center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"294\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250623014620-6858b1ecdcb03.png\" width=\"714\" \/><\/p>\n<p style=\"margin-left:0;margin-right:0;text-align:center\">\n<h2 id=\"4%20%E4%BE%8B%E7%A8%8B%E4%BF%AE%E6%94%B9\" style=\"margin-left:0pt;text-align:left\"><span style=\"color:#1a1a1a\">4<\/span> <span style=\"color:#1a1a1a\">\u4f8b\u7a0b\u4fee\u6539<\/span><\/h2>\n<p style=\"margin-left:0;margin-right:0;text-align:left\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u9700\u8981\u4e0b\u8f7d<\/span><span style=\"color:#333333\">Modbus_TCP_Server<\/span><span style=\"color:#333333\">\u548c<\/span><span style=\"color:#333333\">SMTP<\/span><span style=\"color:#333333\">\u7684<\/span><span style=\"color:#333333\">\u4f8b\u7a0b<\/span><span style=\"color:#333333\">&#xff0c;<\/span><span style=\"color:#333333\">\u7136\u540e<\/span><span style=\"color:#333333\">\u8fdb\u884c<\/span><span style=\"color:#333333\">\u4fee\u6539<\/span><span style=\"color:#333333\">&#xff0c;<\/span><span style=\"color:#333333\">\u4f8b\u7a0b<\/span><span style=\"color:#333333\">\u4e0b\u8f7d<\/span><span style=\"color:#333333\">\u4e0a\u65b9<\/span><span style=\"color:#333333\">\u8f6f\u4ef6<\/span><span style=\"color:#333333\">\u73af\u5883<\/span><span style=\"color:#333333\">\u91cc\u9762<\/span><span style=\"color:#333333\">\u63d0\u4f9b<\/span><span style=\"color:#333333\">\u7684<\/span><span style=\"color:#333333\">\u6709<\/span><span style=\"color:#333333\">\u94fe\u63a5<\/span><span style=\"color:#333333\">&#xff0c;<\/span><span style=\"color:#333333\">\u81ea\u884c<\/span><span style=\"color:#333333\">\u4e0b\u8f7d<\/span><span style=\"color:#333333\">\u5373\u53ef<\/span><\/p>\n<p style=\"text-align:left\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&#xff08;1&#xff09;\u4e0b\u8f7d\u597d<\/span><span style=\"color:#333333\">\u4e4b\u540e<\/span><span style=\"color:#333333\">\u6253\u5f00<\/span><span style=\"color:#333333\">Modbus_TCP_Server<\/span><span style=\"color:#333333\">\u4f8b\u7a0b<\/span><span style=\"color:#333333\">&#xff0c;<\/span><span style=\"color:#333333\">\u7136\u540e<\/span><span style=\"color:#333333\">\u628a<\/span><span style=\"color:#333333\">S<\/span><span style=\"color:#333333\">M<\/span><span style=\"color:#333333\">T<\/span><span style=\"color:#333333\">P<\/span><span style=\"color:#333333\">\u4f8b\u7a0b<\/span><span style=\"color:#333333\">\u4e2d\u7684<\/span><span style=\"color:#333333\">d<\/span><span style=\"color:#333333\">n<\/span><span style=\"color:#333333\">s<\/span><span style=\"color:#333333\">.<\/span><span style=\"color:#333333\">c<\/span> <span style=\"color:#333333\">d<\/span><span style=\"color:#333333\">n<\/span><span style=\"color:#333333\">s<\/span><span style=\"color:#333333\">.<\/span><span style=\"color:#333333\">h<\/span><span style=\"color:#333333\">\u548c<\/span><span style=\"color:#333333\">s<\/span><span style=\"color:#333333\">m<\/span><span style=\"color:#333333\">t<\/span><span style=\"color:#333333\">p<\/span><span style=\"color:#333333\">.<\/span><span style=\"color:#333333\">c<\/span> <span style=\"color:#333333\">s<\/span><span style=\"color:#333333\">m<\/span><span style=\"color:#333333\">t<\/span><span style=\"color:#333333\">p<\/span><span style=\"color:#333333\">.<\/span><span style=\"color:#333333\">h<\/span><span style=\"color:#333333\">\u4ee5\u53ca<\/span><span style=\"color:#333333\">do<\/span><span style=\"color:#333333\">_<\/span><span style=\"color:#333333\">dns<\/span><span style=\"color:#333333\">.<\/span><span style=\"color:#333333\">c<\/span><span style=\"color:#333333\">\u548c<\/span><span style=\"color:#333333\">do<\/span><span style=\"color:#333333\">_<\/span><span style=\"color:#333333\">d<\/span><span style=\"color:#333333\">n<\/span><span style=\"color:#333333\">s<\/span><span style=\"color:#333333\">.<\/span><span style=\"color:#333333\">h<\/span><span style=\"color:#333333\">\u6587\u4ef6<\/span><span style=\"color:#333333\">\u52a0\u5165<\/span><span style=\"color:#333333\">\u5230<\/span><span style=\"color:#333333\">Modbus_TCP_Server<\/span><span style=\"color:#333333\">\u4f8b\u7a0b<\/span><span style=\"color:#333333\">\u4e2d<\/span><span style=\"color:#333333\">\u53bb<\/span><\/p>\n<p style=\"margin-left:0;margin-right:0;text-align:center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"404\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250623014620-6858b1ecec2a7.png\" width=\"329\" \/><\/p>\n<p style=\"text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&#xff08;2&#xff09;\u6587\u4ef6\u8def\u5f84<\/span><span style=\"color:#333333\">\u8fdb\u884c<\/span><span style=\"color:#333333\">\u6dfb\u52a0<\/span><\/p>\n<p style=\"margin-left:0;margin-right:0;text-align:center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"1175\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250623014621-6858b1ed09b59.png\" width=\"2266\" \/><\/p>\n<p style=\"text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&#xff08;3&#xff09;\u5728user<\/span><span style=\"color:#333333\">_<\/span><span style=\"color:#333333\">m<\/span><span style=\"color:#333333\">a<\/span><span style=\"color:#333333\">i<\/span><span style=\"color:#333333\">n<\/span><span style=\"color:#333333\">.<\/span><span style=\"color:#333333\">h<\/span><span style=\"color:#333333\">\u7684<\/span><span style=\"color:#333333\">\u7b2c<\/span><span style=\"color:#333333\">5<\/span><span style=\"color:#333333\">\u884c<\/span><span style=\"color:#333333\">\u6dfb\u52a0<\/span><span style=\"color:#333333\">\u4e00\u8def<\/span><span style=\"color:#333333\">S<\/span><span style=\"color:#333333\">M<\/span><span style=\"color:#333333\">T<\/span><span style=\"color:#333333\">P<\/span><span style=\"color:#333333\">\u6240<\/span><span style=\"color:#333333\">\u9700\u8981<\/span><span style=\"color:#333333\">\u4f7f\u7528<\/span><span style=\"color:#333333\">\u7684<\/span><span style=\"color:#333333\">socket<\/span><\/p>\n<p>  <span style=\"background-color:#fafafa\"><span style=\"color:#000000\">#ifndef __USER_MAIN_H__<\/span><br \/>\n<span style=\"color:#000000\">#define __USER_MAIN_H__<\/span><\/p>\n<p><span style=\"color:#000000\">#define SOCKET_ID 0<\/span><br \/>\n<span style=\"color:#000000\">#define SMTP_SOCKET_ID 1<\/span><br \/>\n<span style=\"color:#000000\">#define ETHERNET_BUF_MAX_SIZE (1024 * 2)<\/span><br \/>\n<span style=\"color:#708090\">\/**<\/span><br \/>\n<span style=\"color:#708090\"> * &#064;brief   User Run Program<\/span><br \/>\n<span style=\"color:#708090\"> * &#064;param   none<\/span><br \/>\n<span style=\"color:#708090\"> * &#064;return  none<\/span><br \/>\n<span style=\"color:#708090\"> *\/<\/span><br \/>\n<span style=\"color:#0077aa\">void<\/span> <span style=\"color:#dd4a68\">user_run<\/span><span style=\"color:#999999\">(<\/span><span style=\"color:#0077aa\">void<\/span><span style=\"color:#999999\">);<\/span><br \/>\n<span style=\"color:#000000\">#endif<\/span><br \/>\n<\/span> <\/p>\n<p style=\"text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&#xff08;4&#xff09;\u6253\u5f00user_main.<\/span><span style=\"color:#333333\">c<\/span><span style=\"color:#333333\">&#xff0c;<\/span><span style=\"color:#333333\">\u5728<\/span><span style=\"color:#333333\">while<\/span><span style=\"color:#333333\">&#xff08;<\/span><span style=\"color:#333333\">1<\/span><span style=\"color:#333333\">&#xff09;<\/span><span style=\"color:#333333\">\u4e2d<\/span><span style=\"color:#333333\">\u6dfb\u52a0<\/span><span style=\"color:#333333\">do_smtp<\/span><span style=\"color:#333333\">\u51fd\u6570<\/span><span style=\"color:#333333\">&#xff0c;<\/span><span style=\"color:#333333\">\u5e76\u4e14<\/span><span style=\"color:#333333\">\u628a<\/span><span style=\"color:#333333\">S<\/span><span style=\"color:#333333\">O<\/span><span style=\"color:#333333\">C<\/span><span style=\"color:#333333\">K<\/span><span style=\"color:#333333\">E<\/span><span style=\"color:#333333\">T<\/span> <span style=\"color:#333333\">I<\/span><span style=\"color:#333333\">D<\/span> <span style=\"color:#333333\">\u66ff\u6362\u4e3a<\/span><span style=\"color:#333333\">\u6211\u4eec<\/span><span style=\"color:#333333\">\u5b9a\u4e49\u7684<\/span><span style=\"color:#333333\">S<\/span><span style=\"color:#333333\">M<\/span><span style=\"color:#333333\">T<\/span><span style=\"color:#333333\">P<\/span> <span style=\"color:#333333\">S<\/span><span style=\"color:#333333\">O<\/span><span style=\"color:#333333\">C<\/span><span style=\"color:#333333\">K<\/span><span style=\"color:#333333\">E<\/span><span style=\"color:#333333\">T<\/span> <span style=\"color:#333333\">I<\/span><span style=\"color:#333333\">D<\/span><\/p>\n<p>  <span style=\"background-color:#fafafa\">  <span style=\"color:#0077aa\">while<\/span> <span style=\"color:#999999\">(<\/span><span style=\"color:#990055\">1<\/span><span style=\"color:#999999\">)<\/span><br \/>\n  <span style=\"color:#999999\">{<\/span><br \/>\n    <span style=\"color:#dd4a68\">do_Modbus<\/span><span style=\"color:#999999\">(<\/span><span style=\"color:#000000\">SOCKET_ID<\/span><span style=\"color:#999999\">);<\/span><\/p>\n<p><span style=\"color:#dd4a68\">do_smtp<\/span><span style=\"color:#999999\">(<\/span><span style=\"color:#000000\">SMTP_SOCKET_ID<\/span><span style=\"color:#999999\">,<\/span><span style=\"color:#000000\"> ethernet_buf<\/span><span style=\"color:#999999\">,<\/span><span style=\"color:#000000\"> smtp_server_ip<\/span><span style=\"color:#999999\">);<\/span><br \/>\n<span style=\"color:#999999\">}<\/span> <\/span> <\/p>\n<p style=\"margin-left:0;margin-right:0;text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0(5<\/span><span style=\"color:#333333\">)<\/span> <span style=\"color:#333333\">\u6211\u4eec<\/span><span style=\"color:#333333\">\u627e\u5230<\/span><span style=\"color:#333333\">mb<\/span><span style=\"color:#333333\">.<\/span><span style=\"color:#333333\">c<\/span><span style=\"color:#333333\">\u6765<\/span><span style=\"color:#333333\">\u4fee\u6539<\/span><span style=\"color:#333333\">\u89e3\u6790<\/span><span style=\"color:#333333\">M<\/span><span style=\"color:#333333\">od<\/span><span style=\"color:#333333\">bus<\/span><span style=\"color:#333333\">\u6570\u636e<\/span><span style=\"color:#333333\">\u7684<\/span><span style=\"color:#333333\">\u51fd\u6570<\/span><span style=\"color:#333333\">&#xff0c;<\/span><span style=\"color:#333333\">\u7531\u4e8e<\/span><span style=\"color:#333333\">M<\/span><span style=\"color:#333333\">odbus<\/span> <span style=\"color:#333333\">tcp<\/span><span style=\"color:#333333\">\u4e0d\u9700\u8981\u8981<\/span><span style=\"color:#333333\">crc<\/span><span style=\"color:#333333\">\u6821\u9a8c<\/span><span style=\"color:#333333\">&#xff0c;<\/span><span style=\"color:#333333\">\u6240\u4ee5<\/span><span style=\"color:#333333\">\u5728<\/span><span style=\"color:#333333\">\u7b2c<\/span><span style=\"color:#333333\">3<\/span><span style=\"color:#333333\">\u884c<\/span><span style=\"color:#333333\">\u6dfb\u52a0<\/span><span style=\"color:#333333\">\u4e00\u4e2a<\/span><span style=\"color:#333333\">\u957f\u5ea6<\/span><span style=\"color:#333333\">\u6761\u4ef6<\/span><span style=\"color:#333333\">&#xff0c;<\/span><span style=\"color:#333333\">\u518d<\/span><span style=\"color:#333333\">\u5728<\/span><span style=\"color:#333333\">\u4ee3\u7801<\/span><span style=\"color:#333333\">\u91cc\u6dfb\u52a0<\/span><span style=\"color:#333333\">\u4e00\u4e2a<\/span><span style=\"color:#333333\">\u89e3\u6790<\/span><span style=\"color:#333333\">\u5199<\/span><span style=\"color:#333333\">\u5355\u4e2a<\/span><span style=\"color:#333333\">\u5bc4\u5b58\u5668<\/span><span style=\"color:#333333\">\u7684<\/span><span style=\"color:#333333\">else<\/span> <span style=\"color:#333333\">of<\/span><span style=\"color:#333333\">\u7684<\/span><span style=\"color:#333333\">\u51fd\u6570<\/span><span style=\"color:#333333\">&#xff0c;<\/span><span style=\"color:#333333\">\u6dfb\u52a0<\/span><span style=\"color:#333333\">\u5728<\/span><span style=\"color:#333333\">2<\/span><span style=\"color:#333333\">1<\/span><span style=\"color:#333333\">\u884c<\/span><span style=\"color:#333333\">&#xff0c;<\/span><span style=\"color:#333333\">\u91cc\u9762<\/span><span style=\"color:#333333\">\u89e3\u6790<\/span><span style=\"color:#333333\">\u4f20\u56de<\/span><span style=\"color:#333333\">\u7684<\/span><span style=\"color:#333333\">\u6d53\u5ea6<\/span><span style=\"color:#333333\">\u503c<\/span><span style=\"color:#333333\">&#xff0c;<\/span><span style=\"color:#333333\">\u5982\u679c<\/span><span style=\"color:#333333\">\u6d53\u5ea6<\/span><span style=\"color:#333333\">\u8fc7\u9ad8<\/span><span style=\"color:#333333\">&#xff0c;<\/span><span style=\"color:#333333\">\u6253\u5370<\/span><span style=\"color:#333333\">\u51fa<\/span><span style=\"color:#333333\">\u6d53\u5ea6<\/span><span style=\"color:#333333\">&#xff0c;<\/span><span style=\"color:#333333\">\u6b64\u65f6<\/span><span style=\"color:#333333\">A<\/span><span style=\"color:#333333\">value<\/span><span style=\"color:#333333\">\u5df2\u7ecf<\/span><span style=\"color:#333333\">\u88ab<\/span><span style=\"color:#333333\">\u8d4b\u503c<\/span><span style=\"color:#333333\">\u3002<\/span><\/p>\n<p>  <span style=\"background-color:#fafafa\"><span style=\"color:#0077aa\">void<\/span> <span style=\"color:#dd4a68\">mbTCPtoEVB<\/span><span style=\"color:#999999\">(<\/span><span style=\"color:#0077aa\">uint8_t<\/span><span style=\"color:#000000\"> sn<\/span><span style=\"color:#999999\">)<\/span><br \/>\n<span style=\"color:#999999\">{<\/span><br \/>\n<span style=\"color:#0077aa\">if<\/span> <span style=\"color:#999999\">(<\/span><span style=\"color:#dd4a68\">MBtcp2evbFrame<\/span><span style=\"color:#999999\">()<\/span> <span style=\"color:#9a6e3a\">!&#061;<\/span> <span style=\"color:#990055\">0<\/span> <span style=\"color:#9a6e3a\">&amp;&amp;<\/span><span style=\"color:#000000\"> recv_len <\/span><span style=\"color:#9a6e3a\">&gt;&#061;<\/span> <span style=\"color:#990055\">12<\/span><span style=\"color:#999999\">)<\/span> <span style=\"color:#708090\">\/\/ Frame received complete<\/span><br \/>\n<span style=\"color:#999999\">{<\/span><br \/>\n<span style=\"color:#0077aa\">if<\/span> <span style=\"color:#999999\">(<\/span><span style=\"color:#000000\">pucASCIIBufferCur<\/span><span style=\"color:#999999\">[<\/span><span style=\"color:#990055\">0<\/span><span style=\"color:#999999\">]<\/span> <span style=\"color:#9a6e3a\">&#061;&#061;<\/span> <span style=\"color:#990055\">0x01<\/span><span style=\"color:#999999\">)<\/span> <span style=\"color:#708090\">\/\/ Check whether the device address is 0x01<\/span><br \/>\n<span style=\"color:#999999\">{<\/span><br \/>\n<span style=\"color:#0077aa\">if<\/span> <span style=\"color:#999999\">((<\/span><span style=\"color:#0077aa\">uint8_t<\/span><span style=\"color:#999999\">)<\/span><span style=\"color:#000000\">pucASCIIBufferCur<\/span><span style=\"color:#999999\">[<\/span><span style=\"color:#990055\">1<\/span><span style=\"color:#999999\">]<\/span> <span style=\"color:#9a6e3a\">&#061;&#061;<\/span> <span style=\"color:#990055\">0x05<\/span><span style=\"color:#999999\">)<\/span> <span style=\"color:#708090\">\/\/ Write to a single device<\/span><br \/>\n<span style=\"color:#999999\">{<\/span><br \/>\n<span style=\"color:#0077aa\">if<\/span> <span style=\"color:#999999\">((<\/span><span style=\"color:#0077aa\">uint8_t<\/span><span style=\"color:#999999\">)<\/span><span style=\"color:#000000\">pucASCIIBufferCur<\/span><span style=\"color:#999999\">[<\/span><span style=\"color:#990055\">4<\/span><span style=\"color:#999999\">]<\/span> <span style=\"color:#9a6e3a\">&#061;&#061;<\/span> <span style=\"color:#990055\">0xff<\/span><span style=\"color:#999999\">)<\/span><br \/>\n<span style=\"color:#999999\">{<\/span><br \/>\n<span style=\"color:#dd4a68\">LED_ON<\/span><span style=\"color:#999999\">();<\/span><br \/>\n<span style=\"color:#dd4a68\">printf<\/span><span style=\"color:#999999\">(<\/span><span style=\"color:#669900\">&#034;LED ON\\\\r\\\\n&#034;<\/span><span style=\"color:#999999\">);<\/span><br \/>\n<span style=\"color:#999999\">}<\/span><br \/>\n<span style=\"color:#0077aa\">else<\/span> <span style=\"color:#0077aa\">if<\/span> <span style=\"color:#999999\">((<\/span><span style=\"color:#0077aa\">uint8_t<\/span><span style=\"color:#999999\">)<\/span><span style=\"color:#000000\">pucASCIIBufferCur<\/span><span style=\"color:#999999\">[<\/span><span style=\"color:#990055\">4<\/span><span style=\"color:#999999\">]<\/span> <span style=\"color:#9a6e3a\">&#061;&#061;<\/span> <span style=\"color:#990055\">0x00<\/span><span style=\"color:#999999\">)<\/span><br \/>\n<span style=\"color:#999999\">{<\/span><br \/>\n<span style=\"color:#dd4a68\">LED_OFF<\/span><span style=\"color:#999999\">();<\/span><br \/>\n<span style=\"color:#dd4a68\">printf<\/span><span style=\"color:#999999\">(<\/span><span style=\"color:#669900\">&#034;LED OFF\\\\r\\\\n&#034;<\/span><span style=\"color:#999999\">);<\/span><br \/>\n<span style=\"color:#999999\">}<\/span><br \/>\n<span style=\"color:#dd4a68\">send<\/span><span style=\"color:#999999\">(<\/span><span style=\"color:#000000\">sn<\/span><span style=\"color:#999999\">,<\/span><span style=\"color:#000000\"> recv_data<\/span><span style=\"color:#999999\">,<\/span><span style=\"color:#000000\"> recv_len<\/span><span style=\"color:#999999\">);<\/span><br \/>\n<span style=\"color:#999999\">}<\/span><br \/>\n<span style=\"color:#0077aa\">else<\/span> <span style=\"color:#0077aa\">if<\/span><span style=\"color:#999999\">((<\/span><span style=\"color:#0077aa\">uint8_t<\/span><span style=\"color:#999999\">)<\/span><span style=\"color:#000000\">pucASCIIBufferCur<\/span><span style=\"color:#999999\">[<\/span><span style=\"color:#990055\">1<\/span><span style=\"color:#999999\">]<\/span> <span style=\"color:#9a6e3a\">&#061;&#061;<\/span> <span style=\"color:#990055\">0x06<\/span><span style=\"color:#999999\">)<\/span><br \/>\n<span style=\"color:#999999\">{<\/span><br \/>\n<span style=\"color:#000000\">Avalue <\/span><span style=\"color:#9a6e3a\">&#061;<\/span> <span style=\"color:#999999\">((<\/span><span style=\"color:#0077aa\">uint16_t<\/span><span style=\"color:#999999\">)<\/span><span style=\"color:#000000\">pucASCIIBufferCur<\/span><span style=\"color:#999999\">[<\/span><span style=\"color:#990055\">4<\/span><span style=\"color:#999999\">]<\/span> <span style=\"color:#9a6e3a\">&lt;&lt;<\/span> <span style=\"color:#990055\">8<\/span><span style=\"color:#999999\">)<\/span> <span style=\"color:#9a6e3a\">|<\/span><span style=\"color:#000000\"> pucASCIIBufferCur<\/span><span style=\"color:#999999\">[<\/span><span style=\"color:#990055\">5<\/span><span style=\"color:#999999\">];<\/span><br \/>\n                <span style=\"color:#0077aa\">if<\/span> <span style=\"color:#999999\">(<\/span><span style=\"color:#000000\">Avalue <\/span><span style=\"color:#9a6e3a\">&gt;<\/span> <span style=\"color:#990055\">30<\/span><span style=\"color:#999999\">)<\/span><br \/>\n                <span style=\"color:#999999\">{<\/span><br \/>\n                    <span style=\"color:#dd4a68\">printf<\/span><span style=\"color:#999999\">(<\/span><span style=\"color:#669900\">&#034;Alert: Concentration too high%u &gt; 30\\\\r\\\\n&#034;<\/span><span style=\"color:#999999\">,<\/span><span style=\"color:#000000\"> Avalue<\/span><span style=\"color:#999999\">);<\/span><br \/>\n                <span style=\"color:#999999\">}<\/span><br \/>\n<span style=\"color:#dd4a68\">send<\/span><span style=\"color:#999999\">(<\/span><span style=\"color:#000000\">sn<\/span><span style=\"color:#999999\">,<\/span><span style=\"color:#000000\"> recv_data<\/span><span style=\"color:#999999\">,<\/span><span style=\"color:#000000\"> recv_len<\/span><span style=\"color:#999999\">);<\/span><br \/>\n<span style=\"color:#999999\">}<\/span><br \/>\n<span style=\"color:#0077aa\">else<\/span> <span style=\"color:#0077aa\">if<\/span> <span style=\"color:#999999\">((<\/span><span style=\"color:#0077aa\">uint8_t<\/span><span style=\"color:#999999\">)<\/span><span style=\"color:#000000\">pucASCIIBufferCur<\/span><span style=\"color:#999999\">[<\/span><span style=\"color:#990055\">1<\/span><span style=\"color:#999999\">]<\/span> <span style=\"color:#9a6e3a\">&#061;&#061;<\/span> <span style=\"color:#990055\">0x01<\/span><span style=\"color:#999999\">)<\/span> <span style=\"color:#708090\">\/\/ Read Write to a single device<\/span><br \/>\n<span style=\"color:#999999\">{<\/span><br \/>\n<span style=\"color:#0077aa\">if<\/span> <span style=\"color:#999999\">(<\/span><span style=\"color:#000000\">recv_data<\/span><span style=\"color:#999999\">[<\/span><span style=\"color:#000000\">recv_len <\/span><span style=\"color:#9a6e3a\">&#8211;<\/span> <span style=\"color:#990055\">1<\/span><span style=\"color:#999999\">]<\/span> <span style=\"color:#9a6e3a\">!&#061;<\/span> <span style=\"color:#990055\">0x01<\/span><span style=\"color:#999999\">)<\/span><br \/>\n<span style=\"color:#999999\">{<\/span><br \/>\n<span style=\"color:#dd4a68\">printf<\/span><span style=\"color:#999999\">(<\/span><span style=\"color:#669900\">&#034;len error!%x\\\\r\\\\n&#034;<\/span><span style=\"color:#999999\">,<\/span><span style=\"color:#000000\"> recv_data<\/span><span style=\"color:#999999\">[<\/span><span style=\"color:#000000\">recv_len <\/span><span style=\"color:#9a6e3a\">&#8211;<\/span> <span style=\"color:#990055\">1<\/span><span style=\"color:#999999\">]);<\/span><br \/>\n<span style=\"color:#999999\">}<\/span><br \/>\n<span style=\"color:#0077aa\">else<\/span><br \/>\n<span style=\"color:#999999\">{<\/span><br \/>\n<span style=\"color:#dd4a68\">printf<\/span><span style=\"color:#999999\">(<\/span><span style=\"color:#669900\">&#034;Read OK!\\\\r\\\\n&#034;<\/span><span style=\"color:#999999\">);<\/span><br \/>\n<span style=\"color:#000000\">send_data<\/span><span style=\"color:#999999\">[<\/span><span style=\"color:#990055\">0<\/span><span style=\"color:#999999\">]<\/span> <span style=\"color:#9a6e3a\">&#061;<\/span><span style=\"color:#000000\"> recv_data<\/span><span style=\"color:#999999\">[<\/span><span style=\"color:#990055\">0<\/span><span style=\"color:#999999\">];<\/span><br \/>\n<span style=\"color:#000000\">send_data<\/span><span style=\"color:#999999\">[<\/span><span style=\"color:#990055\">1<\/span><span style=\"color:#999999\">]<\/span> <span style=\"color:#9a6e3a\">&#061;<\/span><span style=\"color:#000000\"> recv_data<\/span><span style=\"color:#999999\">[<\/span><span style=\"color:#990055\">1<\/span><span style=\"color:#999999\">];<\/span><br \/>\n<span style=\"color:#000000\">send_data<\/span><span style=\"color:#999999\">[<\/span><span style=\"color:#990055\">2<\/span><span style=\"color:#999999\">]<\/span> <span style=\"color:#9a6e3a\">&#061;<\/span><span style=\"color:#000000\"> recv_data<\/span><span style=\"color:#999999\">[<\/span><span style=\"color:#990055\">2<\/span><span style=\"color:#999999\">];<\/span><br \/>\n<span style=\"color:#000000\">send_data<\/span><span style=\"color:#999999\">[<\/span><span style=\"color:#990055\">3<\/span><span style=\"color:#999999\">]<\/span> <span style=\"color:#9a6e3a\">&#061;<\/span><span style=\"color:#000000\"> recv_data<\/span><span style=\"color:#999999\">[<\/span><span style=\"color:#990055\">3<\/span><span style=\"color:#999999\">];<\/span><br \/>\n<span style=\"color:#000000\">send_data<\/span><span style=\"color:#999999\">[<\/span><span style=\"color:#990055\">4<\/span><span style=\"color:#999999\">]<\/span> <span style=\"color:#9a6e3a\">&#061;<\/span> <span style=\"color:#990055\">0x00<\/span><span style=\"color:#999999\">;<\/span><br \/>\n<span style=\"color:#000000\">send_data<\/span><span style=\"color:#999999\">[<\/span><span style=\"color:#990055\">5<\/span><span style=\"color:#999999\">]<\/span> <span style=\"color:#9a6e3a\">&#061;<\/span> <span style=\"color:#990055\">0x04<\/span><span style=\"color:#999999\">;<\/span><br \/>\n<span style=\"color:#000000\">send_data<\/span><span style=\"color:#999999\">[<\/span><span style=\"color:#990055\">6<\/span><span style=\"color:#999999\">]<\/span> <span style=\"color:#9a6e3a\">&#061;<\/span> <span style=\"color:#990055\">0x01<\/span><span style=\"color:#999999\">;<\/span><br \/>\n<span style=\"color:#000000\">send_data<\/span><span style=\"color:#999999\">[<\/span><span style=\"color:#990055\">7<\/span><span style=\"color:#999999\">]<\/span> <span style=\"color:#9a6e3a\">&#061;<\/span> <span style=\"color:#990055\">0x01<\/span><span style=\"color:#999999\">;<\/span><br \/>\n<span style=\"color:#000000\">send_data<\/span><span style=\"color:#999999\">[<\/span><span style=\"color:#990055\">8<\/span><span style=\"color:#999999\">]<\/span> <span style=\"color:#9a6e3a\">&#061;<\/span> <span style=\"color:#990055\">0x01<\/span><span style=\"color:#999999\">;<\/span><br \/>\n<span style=\"color:#000000\">send_data<\/span><span style=\"color:#999999\">[<\/span><span style=\"color:#990055\">9<\/span><span style=\"color:#999999\">]<\/span> <span style=\"color:#9a6e3a\">&#061;<\/span> <span style=\"color:#9a6e3a\">~<\/span><span style=\"color:#dd4a68\">HAL_GPIO_ReadPin<\/span><span style=\"color:#999999\">(<\/span><span style=\"color:#000000\">LED_GPIO_Port<\/span><span style=\"color:#999999\">,<\/span><span style=\"color:#000000\"> LED_Pin<\/span><span style=\"color:#999999\">);<\/span><br \/>\n<span style=\"color:#000000\">send_len <\/span><span style=\"color:#9a6e3a\">&#061;<\/span> <span style=\"color:#990055\">10<\/span><span style=\"color:#999999\">;<\/span><br \/>\n<span style=\"color:#dd4a68\">send<\/span><span style=\"color:#999999\">(<\/span><span style=\"color:#000000\">sn<\/span><span style=\"color:#999999\">,<\/span><span style=\"color:#000000\"> send_data<\/span><span style=\"color:#999999\">,<\/span><span style=\"color:#000000\"> send_len<\/span><span style=\"color:#999999\">);<\/span><br \/>\n<span style=\"color:#dd4a68\">memset<\/span><span style=\"color:#999999\">(<\/span><span style=\"color:#000000\">send_data<\/span><span style=\"color:#999999\">,<\/span> <span style=\"color:#990055\">0<\/span><span style=\"color:#999999\">,<\/span><span style=\"color:#000000\"> send_len<\/span><span style=\"color:#999999\">);<\/span><br \/>\n<span style=\"color:#999999\">}<\/span><br \/>\n<span style=\"color:#999999\">}<\/span><br \/>\n<span style=\"color:#999999\">}<\/span><br \/>\n<span style=\"color:#0077aa\">else<\/span><br \/>\n<span style=\"color:#999999\">{<\/span><br \/>\n<span style=\"color:#dd4a68\">printf<\/span><span style=\"color:#999999\">(<\/span><span style=\"color:#669900\">&#034;error code!\\\\r\\\\n&#034;<\/span><span style=\"color:#999999\">);<\/span><br \/>\n<span style=\"color:#999999\">}<\/span><br \/>\n<span style=\"color:#999999\">}<\/span><br \/>\n<span style=\"color:#0077aa\">else<\/span><br \/>\n<span style=\"color:#999999\">{<\/span><br \/>\n<span style=\"color:#dd4a68\">printf<\/span><span style=\"color:#999999\">(<\/span><span style=\"color:#669900\">&#034;address error!\\\\r\\\\n&#034;<\/span><span style=\"color:#999999\">);<\/span><br \/>\n<span style=\"color:#999999\">}<\/span><br \/>\n<span style=\"color:#999999\">}<\/span><\/span> <\/p>\n<p style=\"text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&#xff08;6&#xff09;\u628a\u5b9a\u4e49\u7684<\/span><span style=\"color:#333333\">A<\/span><span style=\"color:#333333\">value<\/span><span style=\"color:#333333\">\u5728<\/span><span style=\"color:#333333\">mb<\/span><span style=\"color:#333333\">.<\/span><span style=\"color:#333333\">h<\/span><span style=\"color:#333333\">\u4e2d<\/span><span style=\"color:#333333\">\u7b2c<\/span><span style=\"color:#333333\">1<\/span><span style=\"color:#333333\">1<\/span><span style=\"color:#333333\">\u884c<\/span><span style=\"color:#333333\">\u8fdb\u884c<\/span><span style=\"color:#333333\">\u4f20\u51fa<\/span><\/p>\n<p>  <span style=\"background-color:#fafafa\"><span style=\"color:#000000\">#ifndef _MB_H_<\/span><br \/>\n<span style=\"color:#000000\">#define _MB_H_<\/span><\/p>\n<p><span style=\"color:#708090\">\/**<\/span><br \/>\n<span style=\"color:#708090\"> * &#064;brief Parse Modbus TCP instructions and process them accordingly<\/span><br \/>\n<span style=\"color:#708090\"> *<\/span><br \/>\n<span style=\"color:#708090\"> * According to the given sequence number, the Modbus TCP data is converted into an EVB instruction and processed accordingly.<\/span><br \/>\n<span style=\"color:#708090\"> *<\/span><br \/>\n<span style=\"color:#708090\"> * &#064;param sn socket number<\/span><br \/>\n<span style=\"color:#708090\"> *\/<\/span><br \/>\n<span style=\"color:#0077aa\">extern<\/span>  <span style=\"color:#0077aa\">uint16_t<\/span><span style=\"color:#000000\"> Avalue<\/span><span style=\"color:#999999\">;<\/span><br \/>\n<span style=\"color:#0077aa\">void<\/span> <span style=\"color:#dd4a68\">mbTCPtoEVB<\/span><span style=\"color:#999999\">(<\/span><span style=\"color:#0077aa\">uint8_t<\/span><span style=\"color:#000000\"> sn<\/span><span style=\"color:#999999\">);<\/span><\/p>\n<p><span style=\"color:#000000\">#endif<\/span><\/span> <\/p>\n<p style=\"text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&#xff08;7&#xff09;\u6b64\u65f6\u56de\u5230<\/span><span style=\"color:#333333\">while<\/span><span style=\"color:#333333\">(<\/span><span style=\"color:#333333\">1<\/span><span style=\"color:#333333\">)<\/span><span style=\"color:#333333\">\u4e2d<\/span><span style=\"color:#333333\">&#xff0c;<\/span><span style=\"color:#333333\">\u52a0\u5165<\/span><span style=\"color:#333333\">\u6761\u4ef6<\/span><span style=\"color:#333333\">\u5224\u65ad<\/span><span style=\"color:#333333\">&#xff0c;<\/span><span style=\"color:#333333\">\u7136\u540e<\/span><span style=\"color:#333333\">\u518d<\/span><span style=\"color:#333333\">\u6267\u884c<\/span><span style=\"color:#333333\">\u53d1\u9001\u4fe1\u606f<\/span><span style=\"color:#333333\">\u7684<\/span><span style=\"color:#333333\">\u64cd\u4f5c<\/span><\/p>\n<p>  <span style=\"background-color:#fafafa\">  <span style=\"color:#0077aa\">while<\/span> <span style=\"color:#999999\">(<\/span><span style=\"color:#990055\">1<\/span><span style=\"color:#999999\">)<\/span><br \/>\n  <span style=\"color:#999999\">{<\/span><br \/>\n    <span style=\"color:#dd4a68\">do_Modbus<\/span><span style=\"color:#999999\">(<\/span><span style=\"color:#000000\">SOCKET_ID<\/span><span style=\"color:#999999\">);<\/span><br \/>\n<span style=\"color:#0077aa\">if<\/span><span style=\"color:#999999\">(<\/span><span style=\"color:#000000\">Avalue<\/span><span style=\"color:#9a6e3a\">&gt;<\/span><span style=\"color:#990055\">30<\/span><span style=\"color:#999999\">){<\/span><br \/>\n<span style=\"color:#dd4a68\">do_smtp<\/span><span style=\"color:#999999\">(<\/span><span style=\"color:#000000\">SMTP_SOCKET_ID<\/span><span style=\"color:#999999\">,<\/span><span style=\"color:#000000\"> ethernet_buf<\/span><span style=\"color:#999999\">,<\/span><span style=\"color:#000000\"> smtp_server_ip<\/span><span style=\"color:#999999\">);}<\/span><br \/>\n<span style=\"color:#999999\">}<\/span> <\/span> <\/p>\n<p style=\"margin-left:0;margin-right:0;text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0(8<\/span><span style=\"color:#333333\">)<\/span><span style=\"color:#333333\">\u5728<\/span><span style=\"color:#333333\">stmp<\/span><span style=\"color:#333333\">.<\/span><span style=\"color:#333333\">c<\/span><span style=\"color:#333333\">\u4e2d<\/span><span style=\"color:#333333\">\u4fee\u6539<\/span><span style=\"color:#333333\">\u63a5\u6536<\/span><span style=\"color:#333333\">\u90ae\u4ef6<\/span><span style=\"color:#333333\">\u7684<\/span><span style=\"color:#333333\">\u90ae\u7bb1<\/span><span style=\"color:#333333\">\u4ee5\u53ca<\/span><span style=\"color:#333333\">\u90ae\u4ef6<\/span><span style=\"color:#333333\">\u7684<\/span><span style=\"color:#333333\">\u4e3b\u9898<\/span><span style=\"color:#333333\">\u53ca<\/span><span style=\"color:#333333\">\u5185\u5bb9<\/span><span style=\"color:#333333\">&#xff0c;<\/span><span style=\"color:#333333\">\u5728<\/span><span style=\"color:#333333\">\u7b2c<\/span><span style=\"color:#333333\">1<\/span><span style=\"color:#333333\">5<\/span><span style=\"color:#333333\">\u884c<\/span><span style=\"color:#333333\">\u4fee\u6539<\/span><span style=\"color:#333333\">\u63a5\u6536<\/span><span style=\"color:#333333\">\u90ae\u4ef6<\/span><span style=\"color:#333333\">\u7684<\/span><span style=\"color:#333333\">\u90ae\u7bb1<\/span><span style=\"color:#333333\">\u8d26\u53f7<\/span><span style=\"color:#333333\">&#xff0c;<\/span><span style=\"color:#333333\">\u5728<\/span><span style=\"color:#333333\">\u7b2c<\/span><span style=\"color:#333333\">7<\/span><span style=\"color:#333333\">\u884c<\/span><span style=\"color:#333333\">\u548c<\/span><span style=\"color:#333333\">\u7b2c<\/span><span style=\"color:#333333\">1<\/span><span style=\"color:#333333\">3<\/span><span style=\"color:#333333\">\u884c<\/span><span style=\"color:#333333\">\u53ef\u4ee5\u4fee\u6539<\/span><span style=\"color:#333333\">\u53d1\u4ef6<\/span><span style=\"color:#333333\">\u90ae\u7bb1<\/span><span style=\"color:#333333\">\u767b\u5f55<\/span><span style=\"color:#333333\">\u5730\u5740<\/span><span style=\"color:#333333\">\u548c<\/span><span style=\"color:#333333\">\u53d1\u4ef6\u4eba<\/span><span style=\"color:#333333\">\u90ae\u7bb1<\/span><span style=\"color:#333333\">&#xff0c;<\/span><span style=\"color:#333333\">\u5728<\/span><span style=\"color:#333333\">\u7b2c<\/span><span style=\"color:#333333\">1<\/span><span style=\"color:#333333\">0<\/span><span style=\"color:#333333\">\u884c<\/span><span style=\"color:#333333\">\u4fee\u6539<\/span><span style=\"color:#333333\">\u90ae\u7bb1<\/span><span style=\"color:#333333\">\u767b\u5f55<\/span><span style=\"color:#333333\">\u5bc6\u7801<\/span><span style=\"color:#333333\">&#xff0c;<\/span><span style=\"color:#333333\">\u5728<\/span><span style=\"color:#333333\">\u7b2c<\/span><span style=\"color:#333333\">2<\/span><span style=\"color:#333333\">1<\/span><span style=\"color:#333333\">\u884c<\/span><span style=\"color:#333333\">\u548c<\/span><span style=\"color:#333333\">\u7b2c<\/span><span style=\"color:#333333\">2<\/span><span style=\"color:#333333\">2<\/span><span style=\"color:#333333\">\u884c<\/span><span style=\"color:#333333\">\u4fee\u6539<\/span><span style=\"color:#333333\">\u90ae\u4ef6<\/span><span style=\"color:#333333\">\u7684<\/span><span style=\"color:#333333\">\u4e3b\u9898<\/span><span style=\"color:#333333\">\u548c<\/span><span style=\"color:#333333\">\u5185\u5bb9<\/span><span style=\"color:#333333\">\u3002<\/span><span style=\"color:#333333\">\u7cfb\u7edf\u4e2d\u901a\u8fc7126\u90ae\u7bb1\u670d\u52a1\u5668\u5411\u6307\u5b9aQQ\u90ae\u7bb1\u53d1\u9001\u8b66\u62a5\u90ae\u4ef6\u3002<\/span><span style=\"color:#333333\">\u9996\u5148\u901a\u8fc7HELO\u547d\u4ee4\u5efa\u7acb\u8fde\u63a5&#xff0c;\u7136\u540e\u4f7f\u7528AUTH LOGIN\u8fdb\u884cBase64\u7f16\u7801\u7684\u7528\u6237\u540d\u5bc6\u7801\u8ba4\u8bc1&#xff0c;\u63a5\u7740\u8bbe\u7f6e\u53d1\u4ef6\u4eba(MAIL FROM)\u548c\u6536\u4ef6\u4eba(RCPT TO\u5730\u5740\u4e3a232&#043;&#043;&#043;&#043;16&#064;qq.com<\/span><span style=\"color:#333333\">&#xff09;<\/span><span style=\"color:#333333\">&#xff0c;\u518d\u901a\u8fc7DATA\u547d\u4ee4\u4f20\u8f93\u90ae\u4ef6\u5185\u5bb9\u3002\u90ae\u4ef6\u4e3b\u9898\u4e3a&#034;Breaking In&#034;&#xff0c;\u6b63\u6587\u5185\u5bb9\u662f&#034;Excessive gas concentration&#034;&#xff0c;\u6700\u540e\u4ee5\\\\r\\\\n.\\\\r\\\\n\u7ed3\u675f\u4f20\u8f93\u3002<\/span><\/p>\n<p>  <span style=\"background-color:#fafafa\"><span style=\"color:#000000\">#define ETHERNET_MAX_BUF_SIZE (1024 * 2)<\/span><br \/>\n<span style=\"color:#0077aa\">uint8_t<\/span><span style=\"color:#000000\"> Mail_Send_OK<\/span><span style=\"color:#999999\">;<\/span><br \/>\n<span style=\"color:#0077aa\">char<\/span><span style=\"color:#000000\"> hello<\/span><span style=\"color:#999999\">[<\/span><span style=\"color:#990055\">50<\/span><span style=\"color:#999999\">]<\/span> <span style=\"color:#9a6e3a\">&#061;<\/span> <span style=\"color:#669900\">&#034;HELO localhost&#034;<\/span><span style=\"color:#999999\">;<\/span>                       <span style=\"color:#708090\">\/\/ Identity command<\/span><br \/>\n<span style=\"color:#0077aa\">char<\/span><span style=\"color:#000000\"> hello_reply<\/span><span style=\"color:#999999\">[]<\/span> <span style=\"color:#9a6e3a\">&#061;<\/span> <span style=\"color:#669900\">&#034;250 OK&#034;<\/span><span style=\"color:#999999\">;<\/span>                           <span style=\"color:#708090\">\/\/ Id successfully responded<\/span><br \/>\n<span style=\"color:#0077aa\">char<\/span><span style=\"color:#000000\"> AUTH<\/span><span style=\"color:#999999\">[<\/span><span style=\"color:#990055\">50<\/span><span style=\"color:#999999\">]<\/span> <span style=\"color:#9a6e3a\">&#061;<\/span> <span style=\"color:#669900\">&#034;AUTH LOGIN&#034;<\/span><span style=\"color:#999999\">;<\/span>                            <span style=\"color:#708090\">\/\/ Authentication request<\/span><br \/>\n<span style=\"color:#0077aa\">char<\/span><span style=\"color:#000000\"> AUTH_reply<\/span><span style=\"color:#999999\">[]<\/span> <span style=\"color:#9a6e3a\">&#061;<\/span> <span style=\"color:#669900\">&#034;334 dXNlcm5hbWU6&#034;<\/span><span style=\"color:#999999\">;<\/span>                  <span style=\"color:#708090\">\/\/ The authentication request was successfully sent<\/span><br \/>\n<span style=\"color:#0077aa\">char<\/span><span style=\"color:#000000\"> name_126<\/span><span style=\"color:#999999\">[<\/span><span style=\"color:#990055\">100<\/span><span style=\"color:#999999\">]<\/span> <span style=\"color:#9a6e3a\">&#061;<\/span> <span style=\"color:#669900\">&#034;wiznethk&#064;126.com&#034;<\/span><span style=\"color:#999999\">;<\/span>                 <span style=\"color:#708090\">\/\/ 126 Login email address<\/span><br \/>\n<span style=\"color:#0077aa\">char<\/span><span style=\"color:#000000\"> base64name_126<\/span><span style=\"color:#999999\">[<\/span><span style=\"color:#990055\">200<\/span><span style=\"color:#999999\">];<\/span>                                <span style=\"color:#708090\">\/\/ 126 base64 encoding of the login mailbox name<\/span><br \/>\n<span style=\"color:#0077aa\">char<\/span><span style=\"color:#000000\"> name_reply<\/span><span style=\"color:#999999\">[]<\/span> <span style=\"color:#9a6e3a\">&#061;<\/span> <span style=\"color:#669900\">&#034;334 UGFzc3dvcmQ6&#034;<\/span><span style=\"color:#999999\">;<\/span>                  <span style=\"color:#708090\">\/\/ The login name was sent successfully<\/span><br \/>\n<span style=\"color:#0077aa\">char<\/span><span style=\"color:#000000\"> password_126<\/span><span style=\"color:#999999\">[<\/span><span style=\"color:#990055\">50<\/span><span style=\"color:#999999\">]<\/span> <span style=\"color:#9a6e3a\">&#061;<\/span> <span style=\"color:#669900\">&#034;ZPURADLGRUPQLVBK&#034;<\/span><span style=\"color:#999999\">;<\/span>              <span style=\"color:#708090\">\/\/ 126 Email login password<\/span><br \/>\n<span style=\"color:#0077aa\">char<\/span><span style=\"color:#000000\"> base64password_126<\/span><span style=\"color:#999999\">[<\/span><span style=\"color:#990055\">100<\/span><span style=\"color:#999999\">];<\/span>                            <span style=\"color:#708090\">\/\/ base64 123 Password for logging in to the mailbox<\/span><br \/>\n<span style=\"color:#0077aa\">char<\/span><span style=\"color:#000000\"> password_reply<\/span><span style=\"color:#999999\">[]<\/span> <span style=\"color:#9a6e3a\">&#061;<\/span> <span style=\"color:#669900\">&#034;235 Authentication successful&#034;<\/span><span style=\"color:#999999\">;<\/span> <span style=\"color:#708090\">\/\/ Login successful response<\/span><br \/>\n<span style=\"color:#0077aa\">char<\/span><span style=\"color:#000000\"> from<\/span><span style=\"color:#999999\">[]<\/span> <span style=\"color:#9a6e3a\">&#061;<\/span> <span style=\"color:#669900\">&#034;wiznethk&#064;126.com&#034;<\/span><span style=\"color:#999999\">;<\/span>                        <span style=\"color:#708090\">\/\/ Sender email<\/span><br \/>\n<span style=\"color:#0077aa\">char<\/span><span style=\"color:#000000\"> from_reply<\/span><span style=\"color:#999999\">[]<\/span> <span style=\"color:#9a6e3a\">&#061;<\/span> <span style=\"color:#669900\">&#034;250 Mail OK&#034;<\/span><span style=\"color:#999999\">;<\/span><br \/>\n<span style=\"color:#0077aa\">char<\/span><span style=\"color:#000000\"> to<\/span><span style=\"color:#999999\">[]<\/span> <span style=\"color:#9a6e3a\">&#061;<\/span> <span style=\"color:#669900\">&#034;232&#043;&#043;&#043;&#043;16&#064;qq.com&#034;<\/span><span style=\"color:#999999\">;<\/span> <span style=\"color:#708090\">\/\/ Recipient email address<\/span><br \/>\n<span style=\"color:#0077aa\">char<\/span><span style=\"color:#000000\"> to_reply<\/span><span style=\"color:#999999\">[]<\/span> <span style=\"color:#9a6e3a\">&#061;<\/span> <span style=\"color:#669900\">&#034;250 Mail OK&#034;<\/span><span style=\"color:#999999\">;<\/span><span style=\"color:#000000\">\u00b7    <\/span><br \/>\n<span style=\"color:#0077aa\">char<\/span><span style=\"color:#000000\"> data_init<\/span><span style=\"color:#999999\">[<\/span><span style=\"color:#990055\">10<\/span><span style=\"color:#999999\">]<\/span> <span style=\"color:#9a6e3a\">&#061;<\/span> <span style=\"color:#669900\">&#034;data&#034;<\/span><span style=\"color:#999999\">;<\/span>                 <span style=\"color:#708090\">\/\/ Request data transfer<\/span><br \/>\n<span style=\"color:#0077aa\">char<\/span><span style=\"color:#000000\"> data_reply<\/span><span style=\"color:#999999\">[]<\/span> <span style=\"color:#9a6e3a\">&#061;<\/span> <span style=\"color:#669900\">&#034;354&#034;<\/span><span style=\"color:#999999\">;<\/span>                   <span style=\"color:#708090\">\/\/ The request was successfully responded to HEAD<\/span><br \/>\n<span style=\"color:#0077aa\">char<\/span><span style=\"color:#000000\"> Cc<\/span><span style=\"color:#999999\">[]<\/span> <span style=\"color:#9a6e3a\">&#061;<\/span> <span style=\"color:#669900\">&#034;&#034;<\/span><span style=\"color:#999999\">;<\/span>                              <span style=\"color:#708090\">\/\/ Cc to email<\/span><br \/>\n<span style=\"color:#0077aa\">char<\/span><span style=\"color:#000000\"> subject<\/span><span style=\"color:#999999\">[]<\/span> <span style=\"color:#9a6e3a\">&#061;<\/span> <span style=\"color:#669900\">&#034;Breaking In&#034;<\/span><span style=\"color:#999999\">;<\/span>            <span style=\"color:#708090\">\/\/ subject<\/span><br \/>\n<span style=\"color:#0077aa\">char<\/span><span style=\"color:#000000\"> content<\/span><span style=\"color:#999999\">[]<\/span> <span style=\"color:#9a6e3a\">&#061;<\/span> <span style=\"color:#669900\">&#034;Excessive gas concentration&#034;<\/span><span style=\"color:#999999\">;<\/span>            <span style=\"color:#708090\">\/\/ text part<\/span><br \/>\n<span style=\"color:#0077aa\">char<\/span><span style=\"color:#000000\"> mime_reply<\/span><span style=\"color:#999999\">[]<\/span> <span style=\"color:#9a6e3a\">&#061;<\/span> <span style=\"color:#669900\">&#034;250 Mail OK queued as&#034;<\/span><span style=\"color:#999999\">;<\/span> <span style=\"color:#708090\">\/\/ The email was sent successfully<\/span><br \/>\n<span style=\"color:#0077aa\">char<\/span><span style=\"color:#000000\"> mailfrom<\/span><span style=\"color:#999999\">[<\/span><span style=\"color:#990055\">50<\/span><span style=\"color:#999999\">]<\/span> <span style=\"color:#9a6e3a\">&#061;<\/span> <span style=\"color:#669900\">&#034;MAIL FROM:&lt;&gt;&#034;<\/span><span style=\"color:#999999\">;<\/span><br \/>\n<span style=\"color:#0077aa\">char<\/span><span style=\"color:#000000\"> rcptto<\/span><span style=\"color:#999999\">[<\/span><span style=\"color:#990055\">50<\/span><span style=\"color:#999999\">]<\/span> <span style=\"color:#9a6e3a\">&#061;<\/span> <span style=\"color:#669900\">&#034;rcpt to:&lt;&gt;&#034;<\/span><span style=\"color:#999999\">;<\/span><br \/>\n<span style=\"color:#0077aa\">char<\/span><span style=\"color:#000000\"> mime<\/span><span style=\"color:#999999\">[<\/span><span style=\"color:#990055\">200<\/span><span style=\"color:#999999\">]<\/span> <span style=\"color:#9a6e3a\">&#061;<\/span> <span style=\"color:#669900\">&#034;From:\\\\r\\\\n&#034;<\/span><span style=\"color:#999999\">;<\/span><br \/>\n<span style=\"color:#0077aa\">char<\/span><span style=\"color:#000000\"> mime1<\/span><span style=\"color:#999999\">[<\/span><span style=\"color:#990055\">50<\/span><span style=\"color:#999999\">]<\/span> <span style=\"color:#9a6e3a\">&#061;<\/span> <span style=\"color:#669900\">&#034;To:\\\\r\\\\n&#034;<\/span><span style=\"color:#999999\">;<\/span><br \/>\n<span style=\"color:#0077aa\">char<\/span><span style=\"color:#000000\"> mime2<\/span><span style=\"color:#999999\">[<\/span><span style=\"color:#990055\">50<\/span><span style=\"color:#999999\">]<\/span> <span style=\"color:#9a6e3a\">&#061;<\/span> <span style=\"color:#669900\">&#034;Cc:\\\\r\\\\n&#034;<\/span><span style=\"color:#999999\">;<\/span><br \/>\n<span style=\"color:#0077aa\">char<\/span><span style=\"color:#000000\"> mime3<\/span><span style=\"color:#999999\">[<\/span><span style=\"color:#990055\">50<\/span><span style=\"color:#999999\">]<\/span> <span style=\"color:#9a6e3a\">&#061;<\/span> <span style=\"color:#669900\">&#034;Subject:\\\\r\\\\n&#034;<\/span><span style=\"color:#999999\">;<\/span><br \/>\n<span style=\"color:#0077aa\">char<\/span><span style=\"color:#000000\"> mime4<\/span><span style=\"color:#999999\">[<\/span><span style=\"color:#990055\">50<\/span><span style=\"color:#999999\">]<\/span> <span style=\"color:#9a6e3a\">&#061;<\/span> <span style=\"color:#669900\">&#034;MIME-Version:1.0\\\\r\\\\nContent-Type:text\/plain\\\\r\\\\n\\\\r\\\\n&#034;<\/span><span style=\"color:#999999\">;<\/span><br \/>\n<span style=\"color:#0077aa\">char<\/span><span style=\"color:#000000\"> mime5<\/span><span style=\"color:#999999\">[<\/span><span style=\"color:#990055\">50<\/span><span style=\"color:#999999\">]<\/span> <span style=\"color:#9a6e3a\">&#061;<\/span> <span style=\"color:#669900\">&#034;\\\\r\\\\n.\\\\r\\\\n&#034;<\/span><span style=\"color:#999999\">;<\/span><\/span> <\/p>\n<p style=\"margin-left:0;margin-right:0;text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0(9<\/span><span style=\"color:#333333\">)<\/span> <span style=\"color:#333333\">\u5728<\/span><span style=\"color:#333333\">stmp<\/span><span style=\"color:#333333\">.<\/span><span style=\"color:#333333\">c<\/span><span style=\"color:#333333\">\u7684<\/span><span style=\"color:#333333\">\u6700\u540e<\/span><span style=\"color:#333333\">&#xff0c;<\/span><span style=\"color:#333333\">\u53d1\u9001\u6210\u529f<\/span><span style=\"color:#333333\">\u540e<\/span><span style=\"color:#333333\">\u4f1a<\/span><span style=\"color:#333333\">\u8fdb\u5165<\/span><span style=\"color:#333333\">\u4e00\u4e2a<\/span><span style=\"color:#333333\">\u7a7a<\/span><span style=\"color:#333333\">\u5faa\u73af<\/span><span style=\"color:#333333\">&#xff0c;<\/span><span style=\"color:#333333\">\u4f1a<\/span><span style=\"color:#333333\">\u5bfc\u81f4<\/span><span style=\"color:#333333\">\u5728\u8fd9\u91cc<\/span><span style=\"color:#333333\">\u51fa\u4e0d\u53bb<\/span><span style=\"color:#333333\">&#xff0c;<\/span><span style=\"color:#333333\">\u53ef\u4ee5<\/span><span style=\"color:#333333\">\u628a<\/span><span style=\"color:#333333\">while<\/span><span style=\"color:#333333\">(<\/span><span style=\"color:#333333\">1<\/span><span style=\"color:#333333\">)<\/span><span style=\"color:#333333\">\u7684<\/span><span style=\"color:#333333\">\u7a7a\u5faa\u73af<\/span><span style=\"color:#333333\">\u53bb\u9664<\/span><span style=\"color:#333333\">&#xff0c;<\/span><span style=\"color:#333333\">\u7136\u540e<\/span><span style=\"color:#333333\">\u5728\u91cc\u9762\u6dfb\u52a0\u4e00\u4e2a\u5ef6\u65f6&#xff0c;<\/span><span style=\"color:#333333\">\u5f53<\/span><span style=\"color:#333333\">\u90ae\u4ef6<\/span><span style=\"color:#333333\">\u53d1\u9001<\/span><span style=\"color:#333333\">\u6210\u529f<\/span><span style=\"color:#333333\">&#xff0c;<\/span><span style=\"color:#333333\">\u4ee3\u8868<\/span><span style=\"color:#333333\">\u6d53\u5ea6<\/span><span style=\"color:#333333\">\u5df2\u7ecf<\/span><span style=\"color:#333333\">\u8d85\u8fc7<\/span><span style=\"color:#333333\">\u6807\u51c6<\/span><span style=\"color:#333333\">&#xff0c;<\/span><span style=\"color:#333333\">\u5982\u679c<\/span><span style=\"color:#333333\">\u4e0d\u52a0<\/span><span style=\"color:#333333\">\u5ef6\u65f6<\/span><span style=\"color:#333333\">&#xff0c;<\/span><span style=\"color:#333333\">\u4f1a<\/span><span style=\"color:#333333\">\u6301\u7eed<\/span><span style=\"color:#333333\">\u53d1\u9001<\/span><span style=\"color:#333333\">\u8b66\u544a<\/span><span style=\"color:#333333\">\u4fe1\u606f<\/span><span style=\"color:#333333\">&#xff0c;<\/span><span style=\"color:#333333\">\u8bf7\u6839\u636e<\/span><span style=\"color:#333333\">\u81ea\u5df1<\/span><span style=\"color:#333333\">\u9700\u8981<\/span><span style=\"color:#333333\">\u6dfb\u52a0<\/span><span style=\"color:#333333\">\u5ef6\u65f6<\/span><span style=\"color:#333333\">\u3002<\/span><\/p>\n<p>  <span style=\"background-color:#fafafa\">  <span style=\"color:#0077aa\">case<\/span><span style=\"color:#000000\"> SOCK_CLOSED<\/span><span style=\"color:#9a6e3a\">:<\/span><br \/>\n    <span style=\"color:#dd4a68\">socket<\/span><span style=\"color:#999999\">(<\/span><span style=\"color:#000000\">sn<\/span><span style=\"color:#999999\">,<\/span><span style=\"color:#000000\"> Sn_MR_TCP<\/span><span style=\"color:#999999\">,<\/span><span style=\"color:#000000\"> anyport<\/span><span style=\"color:#9a6e3a\">&#043;&#043;<\/span><span style=\"color:#999999\">,<\/span> <span style=\"color:#990055\">0x00<\/span><span style=\"color:#999999\">);<\/span><br \/>\n    <span style=\"color:#0077aa\">break<\/span><span style=\"color:#999999\">;<\/span><br \/>\n  <span style=\"color:#0077aa\">default<\/span><span style=\"color:#9a6e3a\">:<\/span><br \/>\n    <span style=\"color:#0077aa\">break<\/span><span style=\"color:#999999\">;<\/span><br \/>\n  <span style=\"color:#999999\">}<\/span><br \/>\n<span style=\"color:#0077aa\">if<\/span><span style=\"color:#999999\">(<\/span><span style=\"color:#000000\">Mail_Send_OK<\/span><span style=\"color:#999999\">)<\/span><br \/>\n<span style=\"color:#999999\">{<\/span><br \/>\n       <span style=\"color:#708090\">\/\/ while(1){<\/span><br \/>\n<span style=\"color:#dd4a68\">HAL_Delay<\/span><span style=\"color:#999999\">(<\/span><span style=\"color:#990055\">20000<\/span><span style=\"color:#999999\">);<\/span><br \/>\n       <span style=\"color:#708090\">\/\/ }<\/span><br \/>\n<span style=\"color:#999999\">}<\/span><br \/>\n<span style=\"color:#999999\">}<\/span><\/span> <\/p>\n<h2 id=\"5%20%E9%85%8D%E7%BD%AE%E8%BF%9E%E6%8E%A5\" style=\"margin-left:0pt;text-align:left\"><span style=\"color:#1a1a1a\">5<\/span> <span style=\"color:#1a1a1a\">\u914d\u7f6e<\/span><span style=\"color:#1a1a1a\">\u8fde\u63a5<\/span><\/h2>\n<h3 id=\"5.1%20%E4%B8%B2%E5%8F%A3%E6%89%93%E5%8D%B0\" style=\"margin-left:0pt;text-align:left\"><span style=\"color:#1a1a1a\">5.1 <\/span><span style=\"color:#1a1a1a\">\u4e32\u53e3<\/span><span style=\"color:#1a1a1a\">\u6253\u5370<\/span><\/h3>\n<p style=\"margin-left:0;margin-right:0;text-align:center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"580\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250623014622-6858b1ee5b78f.png\" width=\"564\" \/><\/p>\n<h3 id=\"5.2%20Modbus%20Master%20Suite\" style=\"margin-left:0pt;text-align:left\"><span style=\"color:#1a1a1a\">5.2 Modbus Master Suite<\/span><\/h3>\n<p style=\"margin-left:0;margin-right:0;text-align:left\"><span style=\"background-color:#ffffff\"><span style=\"color:#1c1f23\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Modbus Master Suite\u662f\u7528\u4e8eModbus\u534f\u8bae\u8bbe\u5907\u901a\u4fe1\u4ea4\u4e92\u7684\u5de5\u5177\u3002\u5b83\u652f\u6301\u591a\u79cdModbus\u534f\u8bae&#xff0c;\u80fd\u901a\u8fc7\u4e32\u53e3\u6216\u7f51\u7edc\u8fde\u63a5\u8bbe\u5907&#xff0c;\u53ef\u8bfb\u5199\u5404\u7c7b\u5bc4\u5b58\u5668\u6570\u636e&#xff0c;\u5177\u5907\u529f\u80fd\u7801\u6d4b\u8bd5\u3001\u6570\u636e\u8f6c\u6362\u4e0e\u6821\u9a8c\u7b49\u529f\u80fd\u3002<\/span><\/span><\/p>\n<p style=\"text-align:left\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&#xff08;1&#xff09;\u9996\u5148\u9700\u8981<\/span><span style=\"color:#333333\">\u5148\u70b9\u51fb<\/span><span style=\"color:#333333\">\u8bbe\u7f6e<\/span><span style=\"color:#333333\">&#xff0c;<\/span><span style=\"color:#333333\">\u518d<\/span><span style=\"color:#333333\">\u70b9\u51fb<\/span><span style=\"color:#333333\">\u8fde\u63a5\u8bbe\u7f6e<\/span><\/p>\n<p style=\"margin-left:0;margin-right:0;text-align:center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"765\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250623014622-6858b1ee76d6e.png\" width=\"1160\" \/><\/p>\n<p style=\"text-align:left\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&#xff08;2&#xff09;\u9009\u62e9M<\/span><span style=\"color:#333333\">odbus<\/span> <span style=\"color:#333333\">T<\/span><span style=\"color:#333333\">C<\/span><span style=\"color:#333333\">P<\/span><span style=\"color:#333333\">\/<\/span><span style=\"color:#333333\">I<\/span><span style=\"color:#333333\">P<\/span><span style=\"color:#333333\">\u8fde\u63a5<\/span><span style=\"color:#333333\">\u6a21\u5f0f<\/span><span style=\"color:#333333\">&#xff0c;<\/span><span style=\"color:#333333\">\u5730\u5740<\/span><span style=\"color:#333333\">\u548c\u7aef\u53e3\u53f7<\/span><span style=\"color:#333333\">\u586b\u5199<\/span><span style=\"color:#333333\">\u4e0a\u65b9<\/span><span style=\"color:#333333\">\u4e32\u53e3\u6253\u5370<\/span><span style=\"color:#333333\">\u7684<\/span><span style=\"color:#333333\">\u503c<\/span><span style=\"color:#333333\">&#xff0c;<\/span><span style=\"color:#333333\">\u70b9\u51fb<\/span><span style=\"color:#333333\">\u786e\u8ba4<\/span><span style=\"color:#333333\">&#xff0c;<\/span><span style=\"color:#333333\">\u5c31\u53ef\u4ee5<\/span><span style=\"color:#333333\">\u8fde\u63a5<\/span><span style=\"color:#333333\">\u6210\u529f<\/span><\/p>\n<p style=\"margin-left:0;margin-right:0;text-align:center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"774\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250623014622-6858b1eecf723.png\" width=\"1167\" \/><\/p>\n<p style=\"text-align:left\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&#xff08;3&#xff09;\u8fde\u63a5\u6210\u529f<\/span><span style=\"color:#333333\">\u540e<\/span><span style=\"color:#333333\">&#xff0c;<\/span><span style=\"color:#333333\">\u4e32\u53e3<\/span><span style=\"color:#333333\">\u4f1a<\/span><span style=\"color:#333333\">\u663e\u793a<\/span><span style=\"color:#333333\">\u8fde\u63a5<\/span><span style=\"color:#333333\">\u7684<\/span><span style=\"color:#333333\">\u4fe1\u606f<\/span><\/p>\n<p style=\"margin-left:0;margin-right:0;text-align:center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"558\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250623014623-6858b1ef2af4c.png\" width=\"561\" \/><\/p>\n<h2 id=\"6%20%E5%8F%91%E9%80%81%E6%95%B0%E6%8D%AE\" style=\"margin-left:0pt;text-align:left\"><span style=\"color:#1a1a1a\">6<\/span> <span style=\"color:#1a1a1a\">\u53d1\u9001\u6570\u636e<\/span><\/h2>\n<p style=\"text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&#xff08;1&#xff09;\u63a5\u4e0b\u6765\u6211\u4eec<\/span><span style=\"color:#333333\">\u5728<\/span><span style=\"color:#333333\">Modbus Master Suite<\/span><span style=\"color:#333333\">\u7aef<\/span><span style=\"color:#333333\">\u70b9\u51fb<\/span><span style=\"color:#333333\">\u529f\u80fd<\/span><span style=\"color:#333333\">&#xff0c;<\/span><span style=\"color:#333333\">\u7136\u540e<\/span><span style=\"color:#333333\">\u70b9\u51fb<\/span><span style=\"color:#333333\">\u5199<\/span><span style=\"color:#333333\">\u5355<\/span><span style=\"color:#333333\">\u5bc4\u5b58\u5668<\/span><\/p>\n<p style=\"margin-left:0;margin-right:0;text-align:center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"764\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250623014623-6858b1ef41aac.png\" width=\"1164\" \/><\/p>\n<p style=\"text-align:left\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&#xff08;2&#xff09;\u4f9d\u6b21\u586b\u5199<\/span><span style=\"color:#333333\">\u4ece\u673a<\/span><span style=\"color:#333333\">\u5730\u5740<\/span><span style=\"color:#333333\">\u3001<\/span><span style=\"color:#333333\">\u5bc4\u5b58\u5668<\/span><span style=\"color:#333333\">\u5730\u5740<\/span><span style=\"color:#333333\">\u4ee5\u53ca<\/span><span style=\"color:#333333\">\u5c06\u8981<\/span><span style=\"color:#333333\">\u5199\u5165<\/span><span style=\"color:#333333\">\u7684<\/span><span style=\"color:#333333\">\u6570\u503c<\/span><span style=\"color:#333333\">,<\/span><span style=\"color:#333333\">\u7136\u540e<\/span><span style=\"color:#333333\">\u70b9\u51fb<\/span><span style=\"color:#333333\">\u53d1\u9001<\/span><\/p>\n<p style=\"margin-left:0;margin-right:0;text-align:center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"770\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250623014623-6858b1ef8f7bd.png\" width=\"1164\" \/><\/p>\n<p style=\"text-align:left\"><span style=\"color:#333333\">\u00a0 \u00a0 \u00a0 \u00a0 &#xff08;3&#xff09;\u6b64\u65f6\u6211\u4eec\u7684\u503c\u8bbe\u7f6e\u7684\u5c0f\u4e8e30,<\/span><span style=\"color:#333333\">\u4e32<\/span><span style=\"color:#333333\">\u53e3<\/span><span style=\"color:#333333\">\u5e76<\/span><span style=\"color:#333333\">\u672a<\/span><span style=\"color:#333333\">\u6253\u5370\u51fa<\/span><span style=\"color:#333333\">\u5f02\u5e38\u4fe1\u606f<\/span><\/p>\n<p style=\"margin-left:0;margin-right:0;text-align:center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"559\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250623014623-6858b1efde1b1.png\" width=\"562\" \/><\/p>\n<p style=\"text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&#xff08;4&#xff09;\u518d\u6b21\u8fdb\u884c<\/span><span style=\"color:#333333\">\u914d\u7f6e<\/span><span style=\"color:#333333\">&#xff0c;<\/span><span style=\"color:#333333\">\u6b64\u65f6<\/span><span style=\"color:#333333\">\u6211\u6ca1<\/span><span style=\"color:#333333\">\u4eec<\/span><span style=\"color:#333333\">\u628a<\/span><span style=\"color:#333333\">\u503c<\/span><span style=\"color:#333333\">\u589e\u52a0\u5230<\/span><span style=\"color:#333333\">3<\/span><span style=\"color:#333333\">2<\/span><span style=\"color:#333333\">&#xff0c;<\/span><span style=\"color:#333333\">\u7136\u540e<\/span><span style=\"color:#333333\">\u70b9\u51fb<\/span><span style=\"color:#333333\">\u53d1\u9001<\/span><span style=\"color:#333333\">\u3002<\/span><\/p>\n<p style=\"margin-left:0;margin-right:0;text-align:center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"769\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250623014624-6858b1f0007a6.png\" width=\"1166\" \/><\/p>\n<h2 id=\"7%20%E6%95%88%E6%9E%9C%E5%B1%95%E7%A4%BA%E5%B9%B6%E8%A7%A3%E6%9E%90\" style=\"margin-left:0pt;text-align:left\"><span style=\"color:#1a1a1a\">7<\/span> <span style=\"color:#1a1a1a\">\u6548\u679c\u5c55\u793a<\/span><span style=\"color:#1a1a1a\">\u5e76<\/span><span style=\"color:#1a1a1a\">\u89e3\u6790<\/span><\/h2>\n<p style=\"text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&#xff08;1&#xff09;\u6b64\u65f6&#xff0c;<\/span><span style=\"color:#333333\">\u6211\u4eec<\/span><span style=\"color:#333333\">\u53ef\u4ee5<\/span><span style=\"color:#333333\">\u770b\u5230<\/span><span style=\"color:#333333\">\u4e32\u53e3<\/span><span style=\"color:#333333\">\u6253\u5370\u51fa<\/span><span style=\"color:#333333\">\u6d53\u5ea6<\/span><span style=\"color:#333333\">\u6570\u503c<\/span><span style=\"color:#333333\">&#xff0c;<\/span><span style=\"color:#333333\">\u5e76\u4e14<\/span><span style=\"color:#333333\">\u663e\u793a<\/span><span style=\"color:#333333\">\u90ae\u4ef6<\/span><span style=\"color:#333333\">\u53d1\u9001<\/span><span style=\"color:#333333\">\u6210\u529f<\/span><\/p>\n<p style=\"margin-left:0;margin-right:0;text-align:center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"560\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250623014624-6858b1f04f77b.png\" width=\"566\" \/><\/p>\n<p style=\"text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&#xff08;2&#xff09;\u6253\u5f00\u90ae\u7bb1<\/span><span style=\"color:#333333\">&#xff0c;<\/span><span style=\"color:#333333\">\u6211\u4eec\u53ef\u4ee5<\/span><span style=\"color:#333333\">\u770b\u5230<\/span><span style=\"color:#333333\">&#xff0c;<\/span><span style=\"color:#333333\">\u6536\u5230\u4e86<\/span><span style=\"color:#333333\">\u6c14\u4f53<\/span><span style=\"color:#333333\">\u6d53\u5ea6<\/span><span style=\"color:#333333\">\u8fc7\u9ad8<\/span><span style=\"color:#333333\">\u7684<\/span><span style=\"color:#333333\">\u544a\u8b66<\/span><span style=\"color:#333333\">\u90ae\u4ef6<\/span><span style=\"color:#333333\">\u3002<\/span><\/p>\n<p style=\"margin-left:0;margin-right:0;text-align:center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"416\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250623014624-6858b1f0658a3.png\" width=\"1061\" \/><\/p>\n<p style=\"text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&#xff08;3&#xff09;\u518d\u6765\u770b\u4e00\u4e0b<\/span><span style=\"color:#333333\">\u521a\u624d<\/span><span style=\"color:#333333\">\u53d1\u7684<\/span><span style=\"color:#333333\">\u62a5\u6587<\/span><span style=\"color:#333333\">,<\/span><span style=\"color:#333333\">\u7531\u4e8e<\/span><span style=\"color:#333333\">\u8fd9<\/span><span style=\"color:#333333\">\u4e24\u6bb5<\/span><span style=\"color:#333333\">\u62a5\u6587<\/span><span style=\"color:#333333\">\u5dee\u522b<\/span><span style=\"color:#333333\">\u4e0d\u5927<\/span><span style=\"color:#333333\">&#xff0c;<\/span><span style=\"color:#333333\">\u6211\u5bf9<\/span><span style=\"color:#333333\">\u6d53\u5ea6<\/span><span style=\"color:#333333\">\u4e3a<\/span><span style=\"color:#333333\">3<\/span><span style=\"color:#333333\">2<\/span><span style=\"color:#333333\">\u7684<\/span><span style=\"color:#333333\">\u8fdb\u884c\u89e3\u6790<\/span><\/p>\n<p style=\"margin-left:0;margin-right:0;text-align:center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"502\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250623014624-6858b1f095851.png\" width=\"757\" \/><\/p>\n<table border=\"1\" cellspacing=\"0\">\n<tbody>\n<tr>\n<td colspan=\"1\" rowspan=\"1\" style=\"height:27px;vertical-align:middle;width:156px\">\n<p style=\"margin-left:0;margin-right:0;text-align:left\"><span style=\"color:#000000\">\u5b57\u8282\u8303\u56f4<\/span><span style=\"color:#000000\">(<\/span><span style=\"color:#000000\">\u5341\u516d\u8fdb\u5236<\/span><span style=\"color:#000000\">)<\/span><\/p>\n<\/td>\n<td colspan=\"1\" rowspan=\"1\" style=\"height:27px;vertical-align:middle;width:169px\">\n<p style=\"margin-left:0;margin-right:0;text-align:left\"><span style=\"color:#000000\">\u5b57\u6bb5\u540d\u79f0<\/span><\/p>\n<\/td>\n<td colspan=\"1\" rowspan=\"1\" style=\"height:27px;vertical-align:middle;width:147px\">\n<p style=\"margin-left:0;margin-right:0;text-align:left\"><span style=\"color:#000000\">\u5b57\u6bb5\u503c<\/span><span style=\"color:#000000\">(<\/span><span style=\"color:#000000\">\u5341\u516d\u8fdb\u5236<\/span><span style=\"color:#000000\">)<\/span><\/p>\n<\/td>\n<td colspan=\"1\" rowspan=\"1\" style=\"height:27px;vertical-align:middle;width:88px\">\n<p style=\"margin-left:0;margin-right:0;text-align:left\"><span style=\"color:#000000\">\u5341\u8fdb\u5236\u503c<\/span><\/p>\n<\/td>\n<td colspan=\"1\" rowspan=\"1\" style=\"height:27px;vertical-align:middle;width:542px\">\n<p style=\"margin-left:0;margin-right:0;text-align:left\"><span style=\"color:#000000\">\u542b\u4e49\u8bf4\u660e<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td colspan=\"1\" rowspan=\"1\" style=\"height:27px;vertical-align:middle;width:156px\">\n<p style=\"margin-left:0;margin-right:0;text-align:left\"><span style=\"color:#000000\">00 20<\/span><\/p>\n<\/td>\n<td colspan=\"1\" rowspan=\"1\" style=\"height:27px;vertical-align:middle;width:169px\">\n<p style=\"margin-left:0;margin-right:0;text-align:left\"><span style=\"color:#000000\">\u4e8b\u52a1\u6807\u8bc6\u7b26&#xff08;TID&#xff09;<\/span><\/p>\n<\/td>\n<td colspan=\"1\" rowspan=\"1\" style=\"height:27px;vertical-align:middle;width:147px\">\n<p style=\"margin-left:0;margin-right:0;text-align:left\"><span style=\"color:#000000\">00 20<\/span><\/p>\n<\/td>\n<td colspan=\"1\" rowspan=\"1\" style=\"height:27px;vertical-align:middle;width:88px\">\n<p style=\"margin-left:0;margin-right:0;text-align:left\"><span style=\"color:#000000\">32<\/span><\/p>\n<\/td>\n<td colspan=\"1\" rowspan=\"1\" style=\"height:27px;vertical-align:middle;width:542px\">\n<p style=\"margin-left:0;margin-right:0;text-align:left\"><span style=\"color:#000000\">\u4e3b\u7ad9\u81ea\u5b9a\u4e49\u7684\u4e8b\u52a1 ID&#xff08;\u4e0e\u62a5\u6587 1 \u4e0d\u540c&#xff0c;\u8bf4\u660e\u662f\u53e6\u4e00\u4e2a\u72ec\u7acb\u8bf7\u6c42&#xff09;<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td colspan=\"1\" rowspan=\"1\" style=\"height:27px;vertical-align:middle;width:156px\">\n<p style=\"margin-left:0;margin-right:0;text-align:left\"><span style=\"color:#000000\">00 00<\/span><\/p>\n<\/td>\n<td colspan=\"1\" rowspan=\"1\" style=\"height:27px;vertical-align:middle;width:169px\">\n<p style=\"margin-left:0;margin-right:0;text-align:left\"><span style=\"color:#000000\">\u534f\u8bae\u6807\u8bc6\u7b26&#xff08;PID&#xff09;<\/span><\/p>\n<\/td>\n<td colspan=\"1\" rowspan=\"1\" style=\"height:27px;vertical-align:middle;width:147px\">\n<p style=\"margin-left:0;margin-right:0;text-align:left\"><span style=\"color:#000000\">00 00<\/span><\/p>\n<\/td>\n<td colspan=\"1\" rowspan=\"1\" style=\"height:27px;vertical-align:middle;width:88px\">\n<p style=\"margin-left:0;margin-right:0;text-align:left\"><span style=\"color:#000000\">0<\/span><\/p>\n<\/td>\n<td colspan=\"1\" rowspan=\"1\" style=\"height:27px;vertical-align:middle;width:542px\">\n<p style=\"margin-left:0;margin-right:0;text-align:left\"><span style=\"color:#000000\">\u56fa\u5b9a\u4e3a <\/span><span style=\"color:#000000\">0<\/span><span style=\"color:#000000\">&#xff08;Modbus \u534f\u8bae\u6807\u8bc6&#xff09;<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td colspan=\"1\" rowspan=\"1\" style=\"height:39.2px;vertical-align:middle;width:156px\">\n<p style=\"margin-left:0;margin-right:0;text-align:left\"><span style=\"color:#000000\">00 06<\/span><\/p>\n<\/td>\n<td colspan=\"1\" rowspan=\"1\" style=\"height:39.2px;vertical-align:middle;width:169px\">\n<p style=\"margin-left:0;margin-right:0;text-align:left\"><span style=\"color:#000000\">\u957f\u5ea6&#xff08;LEN&#xff09;<\/span><\/p>\n<\/td>\n<td colspan=\"1\" rowspan=\"1\" style=\"height:39.2px;vertical-align:middle;width:147px\">\n<p style=\"margin-left:0;margin-right:0;text-align:left\"><span style=\"color:#000000\">00 06<\/span><\/p>\n<\/td>\n<td colspan=\"1\" rowspan=\"1\" style=\"height:39.2px;vertical-align:middle;width:88px\">\n<p style=\"margin-left:0;margin-right:0;text-align:left\"><span style=\"color:#000000\">6<\/span><\/p>\n<\/td>\n<td colspan=\"1\" rowspan=\"1\" style=\"height:39.2px;vertical-align:middle;width:542px\">\n<p style=\"margin-left:0;margin-right:0;text-align:left\"><span style=\"color:#000000\">\u540e\u7eed PDU \u5b57\u8282\u6570&#xff08;<\/span><span style=\"color:#000000\">\u5355\u5143\u6807\u8bc6\u7b26 &#043; \u529f\u80fd\u7801 &#043; \u6570\u636e<\/span><span style=\"color:#000000\"> \u5171 6 \u5b57\u8282&#xff09;<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td colspan=\"1\" rowspan=\"1\" style=\"height:27px;vertical-align:middle;width:156px\">\n<p style=\"margin-left:0;margin-right:0;text-align:left\"><span style=\"color:#000000\">01<\/span><\/p>\n<\/td>\n<td colspan=\"1\" rowspan=\"1\" style=\"height:27px;vertical-align:middle;width:169px\">\n<p style=\"margin-left:0;margin-right:0;text-align:left\"><span style=\"color:#000000\">\u5355\u5143\u6807\u8bc6\u7b26&#xff08;UID&#xff09;<\/span><\/p>\n<\/td>\n<td colspan=\"1\" rowspan=\"1\" style=\"height:27px;vertical-align:middle;width:147px\">\n<p style=\"margin-left:0;margin-right:0;text-align:left\"><span style=\"color:#000000\">01<\/span><\/p>\n<\/td>\n<td colspan=\"1\" rowspan=\"1\" style=\"height:27px;vertical-align:middle;width:88px\">\n<p style=\"margin-left:0;margin-right:0;text-align:left\"><span style=\"color:#000000\">1<\/span><\/p>\n<\/td>\n<td colspan=\"1\" rowspan=\"1\" style=\"height:27px;vertical-align:middle;width:542px\">\n<p style=\"margin-left:0;margin-right:0;text-align:left\"><span style=\"color:#000000\">\u76ee\u6807\u4ece\u7ad9\u5730\u5740&#xff08;\u4ecd\u4e3a <\/span><span style=\"color:#000000\">1<\/span><span style=\"color:#000000\"> &#xff0c;\u4e0e\u62a5\u6587 1 \u64cd\u4f5c\u540c\u4e00\u4ece\u7ad9&#xff09;<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td colspan=\"1\" rowspan=\"1\" style=\"height:27px;vertical-align:middle;width:156px\">\n<p style=\"margin-left:0;margin-right:0;text-align:left\"><span style=\"color:#000000\">06<\/span><\/p>\n<\/td>\n<td colspan=\"1\" rowspan=\"1\" style=\"height:27px;vertical-align:middle;width:169px\">\n<p style=\"margin-left:0;margin-right:0;text-align:left\"><span style=\"color:#000000\">\u529f\u80fd\u7801&#xff08;FC&#xff09;<\/span><\/p>\n<\/td>\n<td colspan=\"1\" rowspan=\"1\" style=\"height:27px;vertical-align:middle;width:147px\">\n<p style=\"margin-left:0;margin-right:0;text-align:left\"><span style=\"color:#000000\">06<\/span><\/p>\n<\/td>\n<td colspan=\"1\" rowspan=\"1\" style=\"height:27px;vertical-align:middle;width:88px\">\n<p style=\"margin-left:0;margin-right:0;text-align:left\"><span style=\"color:#000000\">6<\/span><\/p>\n<\/td>\n<td colspan=\"1\" rowspan=\"1\" style=\"height:27px;vertical-align:middle;width:542px\">\n<p style=\"margin-left:0;margin-right:0;text-align:left\"><span style=\"color:#333333\">\u5199\u5355\u4e2a\u4fdd\u6301\u5bc4\u5b58\u5668&#xff08;Preset Single Register&#xff09;<\/span><span style=\"color:#000000\">&#xff1a;\u4fee\u6539 1 \u4e2a\u4fdd\u6301\u5bc4\u5b58\u5668\u7684\u503c<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td colspan=\"1\" rowspan=\"1\" style=\"height:27px;vertical-align:middle;width:156px\">\n<p style=\"margin-left:0;margin-right:0;text-align:left\"><span style=\"color:#000000\">00 01<\/span><\/p>\n<\/td>\n<td colspan=\"1\" rowspan=\"1\" style=\"height:27px;vertical-align:middle;width:169px\">\n<p style=\"margin-left:0;margin-right:0;text-align:left\"><span style=\"color:#000000\">\u5bc4\u5b58\u5668\u5730\u5740<\/span><\/p>\n<\/td>\n<td colspan=\"1\" rowspan=\"1\" style=\"height:27px;vertical-align:middle;width:147px\">\n<p style=\"margin-left:0;margin-right:0;text-align:left\"><span style=\"color:#000000\">00 01<\/span><\/p>\n<\/td>\n<td colspan=\"1\" rowspan=\"1\" style=\"height:27px;vertical-align:middle;width:88px\">\n<p style=\"margin-left:0;margin-right:0;text-align:left\"><span style=\"color:#000000\">1<\/span><\/p>\n<\/td>\n<td colspan=\"1\" rowspan=\"1\" style=\"height:27px;vertical-align:middle;width:542px\">\n<p style=\"margin-left:0;margin-right:0;text-align:left\"><span style=\"color:#000000\">\u8981\u5199\u5165\u7684\u4fdd\u6301\u5bc4\u5b58\u5668\u8d77\u59cb\u5730\u5740&#xff08;\u4e0e\u62a5\u6587 1 \u76f8\u540c&#xff0c;\u64cd\u4f5c\u540c\u4e00\u5bc4\u5b58\u5668\u5730\u5740&#xff09;<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td colspan=\"1\" rowspan=\"1\" style=\"height:27px;vertical-align:middle;width:156px\">\n<p style=\"margin-left:0;margin-right:0;text-align:left\"><span style=\"color:#000000\">00 20<\/span><\/p>\n<\/td>\n<td colspan=\"1\" rowspan=\"1\" style=\"height:27px;vertical-align:middle;width:169px\">\n<p style=\"margin-left:0;margin-right:0;text-align:left\"><span style=\"color:#000000\">\u5199\u5165\u503c<\/span><\/p>\n<\/td>\n<td colspan=\"1\" rowspan=\"1\" style=\"height:27px;vertical-align:middle;width:147px\">\n<p style=\"margin-left:0;margin-right:0;text-align:left\"><span style=\"color:#000000\">00 20<\/span><\/p>\n<\/td>\n<td colspan=\"1\" rowspan=\"1\" style=\"height:27px;vertical-align:middle;width:88px\">\n<p style=\"margin-left:0;margin-right:0;text-align:left\"><span style=\"color:#000000\">32<\/span><\/p>\n<\/td>\n<td colspan=\"1\" rowspan=\"1\" style=\"height:27px;vertical-align:middle;width:542px\">\n<p style=\"margin-left:0;margin-right:0;text-align:left\"><span style=\"color:#000000\">\u8981\u5199\u5165\u5bc4\u5b58\u5668\u7684\u6570\u636e&#xff08;\u5341\u8fdb\u5236 <\/span><span style=\"color:#000000\">32<\/span><span style=\"color:#000000\"> &#xff0c;16 \u4f4d\u65e0\u7b26\u53f7\u6574\u6570&#xff09;<\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"margin-left:0;margin-right:0;text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u529f\u80fd\u603b\u7ed3&#xff1a;<\/span><\/p>\n<p style=\"margin-left:0;margin-right:0;text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u4e3b\u7ad9\u5411 \u4ece\u7ad9 ID &#061; 1 \u7684\u8bbe\u5907&#xff0c;\u53d1\u9001\u6307\u4ee4&#xff1a;\u5c06\u5730\u5740\u4e3a 1 \u7684\u4fdd\u6301\u5bc4\u5b58\u5668&#xff0c;\u5199\u5165\u503c 32\u3002<\/span><\/p>\n<h2 id=\"8%20%E6%80%BB%E7%BB%93\" style=\"margin-left:0pt;text-align:left\"><span style=\"color:#1a1a1a\">8<\/span> <span style=\"color:#1a1a1a\">\u603b\u7ed3<\/span><\/h2>\n<p style=\"margin-left:0;margin-right:0;text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u672c\u7cfb\u7edf\u901a\u8fc7 STM32 \u4e0e W5500 \u7684\u7ed3\u5408&#xff0c;\u5b9e\u73b0\u4e86 Modbus TCP \u670d\u52a1\u5668\u7684\u8f7b\u91cf\u5316\u90e8\u7f72&#xff0c;\u540c\u65f6\u901a\u8fc7 SMTP \u670d\u52a1\u6253\u901a\u4e86\u4f20\u611f\u5668\u6570\u636e\u4e0e\u8fdc\u7a0b\u544a\u8b66\u7684\u94fe\u8def\u3002\u65b9\u6848\u517c\u987e\u5de5\u4e1a\u901a\u4fe1\u7684\u7a33\u5b9a\u6027\u4e0e\u7269\u8054\u7f51\u5e94\u7528\u7684\u7075\u6d3b\u6027&#xff0c;\u53ef\u6839\u636e\u5b9e\u9645\u9700\u6c42\u8c03\u6574\u4f20\u611f\u5668\u9608\u503c\u3001\u90ae\u4ef6\u5185\u5bb9\u53ca\u786c\u4ef6\u63a5\u53e3&#xff0c;\u9002\u7528\u4e8e\u5bf9\u5b9e\u65f6\u6027\u548c\u53ef\u9760\u6027\u6709\u8981\u6c42\u7684\u5206\u5e03\u5f0f\u76d1\u6d4b\u573a\u666f\u3002\u611f\u8c22\u60a8\u7684\u89c2\u770b&#xff0c;\u5982\u60a8\u5bf9\u672c\u6587\u6709\u4e0d\u6e05\u695a\u7684\u5730\u65b9\u6216\u60f3\u4e86\u89e3\u66f4\u591a\u4ea7\u54c1\u4fe1\u606f\u7684&#xff0c;\u6b22\u8fce\u79c1\u4fe1\u6216\u5728\u8bc4\u8bba\u533a\u7559\u8a00&#xff0c;\u6211\u4eec\u4f1a\u53ca\u65f6\u56de\u590d\u60a8&#xff01;<\/span><\/p>\n<p style=\"margin-left:0;margin-right:0;text-align:left\">\n<p style=\"margin-left:0;margin-right:0;text-align:left\">\n<p style=\"margin-left:0;margin-right:0;text-align:left\">\n<p style=\"margin-left:0;margin-right:0;text-align:justify\">\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb705\u6b21\uff0c\u70b9\u8d5e24\u6b21\uff0c\u6536\u85cf22\u6b21\u3002\u672c\u6587\u4ecb\u7ecd\u4e86\u57fa\u4e8eSTM32F103VCT6\u548cW5500io-M\u6a21\u5757\u7684\u5de5\u4e1a\u7269\u8054\u7f51\u76d1\u63a7\u7cfb\u7edf\u5b9e\u73b0\u65b9\u6848\u3002\u7cfb\u7edf\u901a\u8fc7Modbus TCP\u534f\u8bae\u91c7\u96c6\u4f20\u611f\u5668\u6570\u636e\uff0c\u5f53\u6d53\u5ea6\u8d85\u8fc7\u9608\u503c(30)\u65f6\u81ea\u52a8\u89e6\u53d1SMTP\u90ae\u4ef6\u544a\u8b66\u3002<\/p>\n","protected":false},"author":2,"featured_media":45251,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[4282,4281,61,220,78],"topic":[],"class_list":["post-45267","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-w5500io-m","tag-4281","tag-61","tag-220","tag-78"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Modbus TCP \u670d\u52a1\u5668\uff1aW5500io-M \u5b9e\u73b0\u8d85\u6807\u6570\u636e\u90ae\u4ef6\u544a\u8b66 - \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\/45267.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Modbus TCP \u670d\u52a1\u5668\uff1aW5500io-M \u5b9e\u73b0\u8d85\u6807\u6570\u636e\u90ae\u4ef6\u544a\u8b66 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb705\u6b21\uff0c\u70b9\u8d5e24\u6b21\uff0c\u6536\u85cf22\u6b21\u3002\u672c\u6587\u4ecb\u7ecd\u4e86\u57fa\u4e8eSTM32F103VCT6\u548cW5500io-M\u6a21\u5757\u7684\u5de5\u4e1a\u7269\u8054\u7f51\u76d1\u63a7\u7cfb\u7edf\u5b9e\u73b0\u65b9\u6848\u3002\u7cfb\u7edf\u901a\u8fc7Modbus TCP\u534f\u8bae\u91c7\u96c6\u4f20\u611f\u5668\u6570\u636e\uff0c\u5f53\u6d53\u5ea6\u8d85\u8fc7\u9608\u503c(30)\u65f6\u81ea\u52a8\u89e6\u53d1SMTP\u90ae\u4ef6\u544a\u8b66\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/45267.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-06-23T01:46:25+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250623014620-6858b1ecb45f6.jpg\" \/>\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=\"5 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/45267.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/45267.html\",\"name\":\"Modbus TCP \u670d\u52a1\u5668\uff1aW5500io-M \u5b9e\u73b0\u8d85\u6807\u6570\u636e\u90ae\u4ef6\u544a\u8b66 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-06-23T01:46:25+00:00\",\"dateModified\":\"2025-06-23T01:46:25+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/45267.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/45267.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/45267.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Modbus TCP \u670d\u52a1\u5668\uff1aW5500io-M \u5b9e\u73b0\u8d85\u6807\u6570\u636e\u90ae\u4ef6\u544a\u8b66\"}]},{\"@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":"Modbus TCP \u670d\u52a1\u5668\uff1aW5500io-M \u5b9e\u73b0\u8d85\u6807\u6570\u636e\u90ae\u4ef6\u544a\u8b66 - \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\/45267.html","og_locale":"zh_CN","og_type":"article","og_title":"Modbus TCP \u670d\u52a1\u5668\uff1aW5500io-M \u5b9e\u73b0\u8d85\u6807\u6570\u636e\u90ae\u4ef6\u544a\u8b66 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb705\u6b21\uff0c\u70b9\u8d5e24\u6b21\uff0c\u6536\u85cf22\u6b21\u3002\u672c\u6587\u4ecb\u7ecd\u4e86\u57fa\u4e8eSTM32F103VCT6\u548cW5500io-M\u6a21\u5757\u7684\u5de5\u4e1a\u7269\u8054\u7f51\u76d1\u63a7\u7cfb\u7edf\u5b9e\u73b0\u65b9\u6848\u3002\u7cfb\u7edf\u901a\u8fc7Modbus TCP\u534f\u8bae\u91c7\u96c6\u4f20\u611f\u5668\u6570\u636e\uff0c\u5f53\u6d53\u5ea6\u8d85\u8fc7\u9608\u503c(30)\u65f6\u81ea\u52a8\u89e6\u53d1SMTP\u90ae\u4ef6\u544a\u8b66\u3002","og_url":"https:\/\/www.wsisp.com\/helps\/45267.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-06-23T01:46:25+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250623014620-6858b1ecb45f6.jpg"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"5 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/45267.html","url":"https:\/\/www.wsisp.com\/helps\/45267.html","name":"Modbus TCP \u670d\u52a1\u5668\uff1aW5500io-M \u5b9e\u73b0\u8d85\u6807\u6570\u636e\u90ae\u4ef6\u544a\u8b66 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-06-23T01:46:25+00:00","dateModified":"2025-06-23T01:46:25+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/45267.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/45267.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/45267.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"Modbus TCP \u670d\u52a1\u5668\uff1aW5500io-M \u5b9e\u73b0\u8d85\u6807\u6570\u636e\u90ae\u4ef6\u544a\u8b66"}]},{"@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\/45267","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=45267"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/45267\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/45251"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=45267"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=45267"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=45267"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=45267"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}