{"id":1327,"date":"2014-01-23T15:34:58","date_gmt":"2014-01-23T15:34:58","guid":{"rendered":"https:\/\/ibex.tech\/resources\/?p=1327"},"modified":"2022-02-18T15:05:16","modified_gmt":"2022-02-18T15:05:16","slug":"function-16-write-multiple-registers","status":"publish","type":"post","link":"https:\/\/ibex.tech\/resources\/geek-area\/communications\/modbus\/function-16-write-multiple-registers","title":{"rendered":"Function 16 Write Multiple Registers"},"content":{"rendered":"<h4>\nModbus RTU Function 16&nbsp;&#39;Preset Multiple Registers&#39;<br \/>\n<\/h4>\n<p>\nTo write 3&nbsp;words (48&nbsp;bits) to 3 consecutive&nbsp;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 (0x10)<br \/>\nByte 2 Start Register Number (high byte)<br \/>\nByte 3 Start Register Number (low byte)<br \/>\nByte 4 Number of registers to write(high byte)<br \/>\nByte 5 Number of registers to write (low byte)<br \/>\nByte 6 Number of data bytes&nbsp;that&nbsp;follow(3 registers x 2 bytes each = 6)<br \/>\nByte 7&nbsp;Data0<br \/>\nByte 8&nbsp;Data1<br \/>\nByte 9&nbsp;Data2\u200b<br \/>\nByte 10&nbsp;Data\u200b3<br \/>\nByte 11&nbsp;Data4<br \/>\nByte 12&nbsp;Data5<br \/>\nByte 13&nbsp;CRC of bytes 1 to 6 (high byte)<br \/>\nByte 14&nbsp;CRC of bytes 1 to 6 (low byte)\n<\/p>\n<p>\nThe response:\n<\/p>\n<p style=\"margin-left: 40px;\">\nByte 0 Modbus Device Address<br \/>\nByte 1 Function Code \/ Message Type (0x10)<br \/>\nByte 2 Start Register Number (high byte)<br \/>\nByte 3 Start Register Number (low byte)<br \/>\nByte 4 The number of registers written&nbsp;(high byte)<br \/>\nByte 5&nbsp;The number of registers written&nbsp;(low byte)<br \/>\nByte 6&nbsp;CRC of bytes 1 to 6 (high byte)<br \/>\nByte 7&nbsp;CRC of bytes 1 to 6 (low byte)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Modbus RTU Function 16&nbsp;&#39;Preset Multiple Registers&#39; To write 3&nbsp;words (48&nbsp;bits) to 3 consecutive&nbsp;registers you send the following: Byte 0 Modbus Device Address (1 to 247) Byte 1 Function Code \/ Message Type (0x10) Byte 2 Start Register Number (high byte) Byte 3 Start Register Number (low byte) Byte 4 Number of registers to write(high byte) [&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-1327","post","type-post","status-publish","format-standard","hentry","category-modbus"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/resources\/wp-json\/wp\/v2\/posts\/1327","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=1327"}],"version-history":[{"count":3,"href":"https:\/\/ibex.tech\/resources\/wp-json\/wp\/v2\/posts\/1327\/revisions"}],"predecessor-version":[{"id":1333,"href":"https:\/\/ibex.tech\/resources\/wp-json\/wp\/v2\/posts\/1327\/revisions\/1333"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/resources\/wp-json\/wp\/v2\/media?parent=1327"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/resources\/wp-json\/wp\/v2\/categories?post=1327"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/resources\/wp-json\/wp\/v2\/tags?post=1327"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}