{"id":1322,"date":"2014-01-23T15:26:11","date_gmt":"2014-01-23T15:26:11","guid":{"rendered":"https:\/\/ibex.tech\/resources\/?p=1322"},"modified":"2022-02-18T15:05:16","modified_gmt":"2022-02-18T15:05:16","slug":"function-03-read-holding-registers","status":"publish","type":"post","link":"https:\/\/ibex.tech\/resources\/geek-area\/communications\/modbus\/function-03-read-holding-registers","title":{"rendered":"Function 03 Read Holding Registers"},"content":{"rendered":"<h4>\nModbus RTU Function 03 &#39;Read Holding Registers&#39;<br \/>\n<\/h4>\n<p>\nTo read a word (16 bits) from a register you send the following:\n<\/p>\n<p style=\"margin-left: 40px;\">\nByte 0 Modbus Device Address (1 to 247)<br \/>\nByte 1 Function Code \/ Message Type (0x03)<br \/>\nByte 2 Register Number (high byte)<br \/>\nByte 3 Register Number (low byte)<br \/>\nByte 4 Data Length (high byte, specified in Words) (1)<br \/>\nByte 5 Data Length (low byte)<br \/>\nByte 6 CRC of bytes 1 to 6 (high byte)<br \/>\nByte 7 CRC of bytes 1 to 6 (low byte)\n<\/p>\n<p>\nThe response is sent as follows:\n<\/p>\n<p style=\"margin-left: 40px;\">\nByte 0 Modbus Device Address<br \/>\nByte 1 Function Code \/ Message Type (0x03)<br \/>\nByte 2 Number of bytes returned (specified in bytes, 1 register x 2 bytes = 2)<br \/>\nByte 3 Data0<br \/>\nByte 4 Data1<br \/>\nByte 5 CRC of bytes 1 to 5 (high byte)<br \/>\nByte 6 CRC of bytes 1 to 5 (low byte)\n<\/p>\n<p>\n&nbsp;\n<\/p>\n<p>\nTo read 3 words (16 bits) from 3 registers you send the following:\n<\/p>\n<p style=\"margin-left: 40px;\">\nByte 0 Modbus Device Address (1 to 247)<br \/>\nByte 1 Function Code \/ Message Type (0x03)<br \/>\nByte 2 Register Number (high byte)<br \/>\nByte 3 Register Number (low byte)<br \/>\nByte 4 Data Length (high byte, specified in Words) (1)<br \/>\nByte 5 Data Length (low byte)<br \/>\nByte 6 CRC of bytes 1 to 6 (high byte)<br \/>\nByte 7 CRC of bytes 1 to 6 (low byte)\n<\/p>\n<p>\nThe response is sent as follows:\n<\/p>\n<p style=\"margin-left: 40px;\">\nByte 0 Modbus Device Address<br \/>\nByte 1 Function Code \/ Message Type (0x03)<br \/>\nByte 2 Number of bytes returned (specified in bytes, 3 registers x 2 bytes = 6)<br \/>\nByte 3 Data0<br \/>\nByte 4 Data1<br \/>\nByte 5 Data2\u200b<br \/>\nByte 6 Data3<br \/>\nByte 7 Data4<br \/>\nByte 8 Data5<br \/>\nByte 9 CRC of bytes 1 to 5 (high byte)<br \/>\nByte 10 CRC of bytes 1 to 5 (low byte)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Modbus RTU Function 03 &#39;Read Holding Registers&#39; To read a word (16 bits) from a register you send the following: Byte 0 Modbus Device Address (1 to 247) Byte 1 Function Code \/ Message Type (0x03) Byte 2 Register Number (high byte) Byte 3 Register Number (low byte) Byte 4 Data Length (high byte, specified [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[78],"tags":[],"class_list":["post-1322","post","type-post","status-publish","format-standard","hentry","category-modbus"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/resources\/wp-json\/wp\/v2\/posts\/1322","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibex.tech\/resources\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibex.tech\/resources\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibex.tech\/resources\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ibex.tech\/resources\/wp-json\/wp\/v2\/comments?post=1322"}],"version-history":[{"count":2,"href":"https:\/\/ibex.tech\/resources\/wp-json\/wp\/v2\/posts\/1322\/revisions"}],"predecessor-version":[{"id":1331,"href":"https:\/\/ibex.tech\/resources\/wp-json\/wp\/v2\/posts\/1322\/revisions\/1331"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/resources\/wp-json\/wp\/v2\/media?parent=1322"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/resources\/wp-json\/wp\/v2\/categories?post=1322"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/resources\/wp-json\/wp\/v2\/tags?post=1322"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}