{"id":2272,"date":"2025-04-15T09:26:33","date_gmt":"2025-04-15T09:26:33","guid":{"rendered":"https:\/\/webprojects.cloud\/wordpress\/splatco\/?post_type=spl_knowledgebase&#038;p=2272"},"modified":"2025-06-11T05:37:04","modified_gmt":"2025-06-11T05:37:04","slug":"modbus-number-format","status":"publish","type":"spl_knowledgebase","link":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/communications-instructions\/modbus-instructions\/modbus-master-control-script-commands\/modbus-number-format\/","title":{"rendered":"MODBUS Number Format"},"content":{"rendered":"\n<p>MODBUS Master holding register commands allow the number format to be specified.&nbsp;<\/p>\n\n\n\n<p>The MODBUS standard says all registers must be 16 bits in length and must be in big endian format, meaning the first byte transmitted is the most significant byte.&nbsp; This is also the lowest SPLat RAM location as internally SPLat is also big endian.<\/p>\n\n\n\n<p>However some MODBUS slaves may use a different numbering format.&nbsp; Floating point numbers are especially confusing because they are not officially part of the MODBUS standard, yet are widely used.&nbsp; Specifying the Number Format value ensures the SPLat MODBUS Master will accept data from Slaves by other manufacturers.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><th>Value<\/th><th>Number Format<\/th><\/tr><tr><td>0<\/td><td>Byte<\/td><\/tr><tr><td>1<\/td><td>Word, big endian (standard)<\/td><\/tr><tr><td colspan=\"2\"><em>Values below are only supported on 32 bit controllers (black boards)<\/em><\/td><\/tr><tr><td>2<\/td><td>Byte, little endian (non-standard)<\/td><\/tr><tr><td>3<\/td><td>Word, little endian (non-standard)<\/td><\/tr><tr><td>4<\/td><td>big endian IEEE float (ABCD)<\/td><\/tr><tr><td>5<\/td><td>big endian, byte swapped IEEE float (BADC)<\/td><\/tr><tr><td>6<\/td><td>little endian IEEE float (DCBA)<\/td><\/tr><tr><td>7<\/td><td>little endian, byte swapped IEEE float (CDAB)<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>Formats 0 and 1 are supported on all SPLat controllers.&nbsp; However formats 2 thru 8 are only supported on SPLat 32 bit controllers (black boards).<\/p>\n\n\n\n<p>The number format value is used in the following Script Commands:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/communications-instructions\/modbus-instructions\/modbus-master-control-script-commands\/readhregs-3-slaveaddr-regaddr16-itemcount-spaddr16-numformat\/\">ReadHRegs<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/communications-instructions\/modbus-instructions\/modbus-master-control-script-commands\/presethreg-6-slaveaddr-regaddr16-spaddr16-spmode\/\">PresetHReg<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/communications-instructions\/modbus-instructions\/modbus-master-control-script-commands\/presetmultregs-16-slaveaddr-regaddr16-itemcount-spaddr16-spmode\/\">PresetMultRegs<\/a><\/li>\n<\/ul>\n\n\n\n<h6 class=\"wp-block-heading\">SPLat floating point<\/h6>\n\n\n\n<p>SPLat floating point isn&#8217;t IEEE.&nbsp; For historical reasons, some bit positions have been shuffled.&nbsp; Despite this you can still share SPLat floating point values with other controllers, here&#8217;s the guide:<\/p>\n\n\n\n<h6 class=\"wp-block-heading\">SPLat Master &lt;-&gt; SPLat Slave<\/h6>\n\n\n\n<p>If you want a SPLat MODBUS master and SPLat MODBUS slave to share floating point values, then treat them as 2 word registers.&nbsp; The MODBUS protocol will correctly transfer all 32 bits that constitute the float value.<\/p>\n\n\n\n<h6 class=\"wp-block-heading\">Foreign Master &lt;-&gt; SPLat Slave<\/h6>\n\n\n\n<p>On the SPLat slave, use the\u00a0<a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/floating-point-instructions\/fwtoieee-d21\/\">fWtoIEEE<\/a>\u00a0or\u00a0<a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/floating-point-instructions\/fwtoieeer-d21\/\">fWtoIEEER<\/a>\u00a0pair when saving your float to memory.\u00a0 This will put it into the format required by the foreign master.<\/p>\n\n\n\n<h6 class=\"wp-block-heading\">SPLat Master &lt;-&gt; Foreign Slave<\/h6>\n\n\n\n<p><strong>A)<\/strong>\u00a0If you&#8217;re using a SPLat 8 bit controller (green board), then MODBUS will be reading holding registers and placing the float into your master&#8217;s memory in IEEE format.\u00a0 You&#8217;ll have to use the\u00a0<a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/floating-point-instructions\/fieeetow-d21\/\">fIEEEtoW<\/a>\u00a0and\u00a0<a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/floating-point-instructions\/fieeetowr-d21\/\">fIEEEtoWR<\/a>\u00a0pair when reading the value from memory.\u00a0 When sending values to the slave your application must use the\u00a0<a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/floating-point-instructions\/fwtoieee-d21\/\">fWtoIEEE<\/a>\u00a0or\u00a0<a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/floating-point-instructions\/fwtoieeer-d21\/\">fWtoIEEER<\/a>\u00a0pair when savinf the floats to RAM.<\/p>\n\n\n\n<p>Both these techniques will also work with the SPLat 32 bit controllers (black boards) but there&#8217;s an easier method&#8230;<\/p>\n\n\n\n<p><strong>B)<\/strong>&nbsp;A SPLat 32 bit controller allows the float format to be specified in the number format field.&nbsp; This means the value written to SPLat RAM will already be converted to SPLat format, so fRecallW &amp; fRecallQ will work correctly.<\/p>\n\n\n\n<h6 class=\"wp-block-heading\">MODBUS IEEE floating point<\/h6>\n\n\n\n<p>IEEE single precision 32 bit floating point format can be converted on the fly by with SPLat 32 bit controllers (black boards).<\/p>\n\n\n\n<p>As floats are not officially supported by the MODBUS standard, everyone has implemented it differently.&nbsp; SPLat MODBUS master supports all 4 methods.&nbsp; To help clarify what each method means, we&#8217;ve used the letter ABCD where they mean this:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>A is bits 31:24<\/li>\n\n\n\n<li>B is bits 23:16<\/li>\n\n\n\n<li>C is bits 15:8<\/li>\n\n\n\n<li>D is bits 7:0<\/li>\n<\/ul>\n\n\n\n<p>Remember floats are 32 bits, this being 2 MODBUS registers.&nbsp; So using any of the floating point formats means your number of registers request must be an even number.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>MODBUS Master holding register commands allow the number format to be specified.&nbsp; The MODBUS standard says all registers must be 16 bits in length and&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":2271,"menu_order":0,"template":"","class_list":["post-2272","spl_knowledgebase","type-spl_knowledgebase","status-publish","hentry"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>MODBUS Number Format - SPLat Controls<\/title>\n<meta name=\"robots\" content=\"noindex, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"MODBUS Number Format - SPLat Controls\" \/>\n<meta property=\"og:description\" content=\"MODBUS Master holding register commands allow the number format to be specified.&nbsp; The MODBUS standard says all registers must be 16 bits in length and...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/communications-instructions\/modbus-instructions\/modbus-master-control-script-commands\/modbus-number-format\/\" \/>\n<meta property=\"og:site_name\" content=\"SPLat Controls\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-11T05:37:04+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/communications-instructions\/modbus-instructions\/modbus-master-control-script-commands\/modbus-number-format\/\",\"url\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/communications-instructions\/modbus-instructions\/modbus-master-control-script-commands\/modbus-number-format\/\",\"name\":\"MODBUS Number Format - SPLat Controls\",\"isPartOf\":{\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/#website\"},\"datePublished\":\"2025-04-15T09:26:33+00:00\",\"dateModified\":\"2025-06-11T05:37:04+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/communications-instructions\/modbus-instructions\/modbus-master-control-script-commands\/modbus-number-format\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/communications-instructions\/modbus-instructions\/modbus-master-control-script-commands\/modbus-number-format\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/communications-instructions\/modbus-instructions\/modbus-master-control-script-commands\/modbus-number-format\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Programming reference\",\"item\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Instructions arranged by function\",\"item\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Communications instructions\",\"item\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/communications-instructions\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"MODBUS Instructions\",\"item\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/communications-instructions\/modbus-instructions\/\"},{\"@type\":\"ListItem\",\"position\":6,\"name\":\"ModBus Master control script commands\",\"item\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/communications-instructions\/modbus-instructions\/modbus-master-control-script-commands\/\"},{\"@type\":\"ListItem\",\"position\":7,\"name\":\"MODBUS Number Format\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/#website\",\"url\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/\",\"name\":\"SPLat Controls\",\"description\":\"OEM Embedded Machine Controllers\",\"publisher\":{\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/#organization\",\"name\":\"SPLat Controls\",\"url\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2024\/10\/logo.svg\",\"contentUrl\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2024\/10\/logo.svg\",\"caption\":\"SPLat Controls\"},\"image\":{\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"MODBUS Number Format - SPLat Controls","robots":{"index":"noindex","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"og_locale":"en_US","og_type":"article","og_title":"MODBUS Number Format - SPLat Controls","og_description":"MODBUS Master holding register commands allow the number format to be specified.&nbsp; The MODBUS standard says all registers must be 16 bits in length and...","og_url":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/communications-instructions\/modbus-instructions\/modbus-master-control-script-commands\/modbus-number-format\/","og_site_name":"SPLat Controls","article_modified_time":"2025-06-11T05:37:04+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/communications-instructions\/modbus-instructions\/modbus-master-control-script-commands\/modbus-number-format\/","url":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/communications-instructions\/modbus-instructions\/modbus-master-control-script-commands\/modbus-number-format\/","name":"MODBUS Number Format - SPLat Controls","isPartOf":{"@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/#website"},"datePublished":"2025-04-15T09:26:33+00:00","dateModified":"2025-06-11T05:37:04+00:00","breadcrumb":{"@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/communications-instructions\/modbus-instructions\/modbus-master-control-script-commands\/modbus-number-format\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/communications-instructions\/modbus-instructions\/modbus-master-control-script-commands\/modbus-number-format\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/communications-instructions\/modbus-instructions\/modbus-master-control-script-commands\/modbus-number-format\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webprojects.cloud\/wordpress\/splatco\/"},{"@type":"ListItem","position":2,"name":"Programming reference","item":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/"},{"@type":"ListItem","position":3,"name":"Instructions arranged by function","item":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/"},{"@type":"ListItem","position":4,"name":"Communications instructions","item":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/communications-instructions\/"},{"@type":"ListItem","position":5,"name":"MODBUS Instructions","item":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/communications-instructions\/modbus-instructions\/"},{"@type":"ListItem","position":6,"name":"ModBus Master control script commands","item":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/communications-instructions\/modbus-instructions\/modbus-master-control-script-commands\/"},{"@type":"ListItem","position":7,"name":"MODBUS Number Format"}]},{"@type":"WebSite","@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/#website","url":"https:\/\/webprojects.cloud\/wordpress\/splatco\/","name":"SPLat Controls","description":"OEM Embedded Machine Controllers","publisher":{"@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/webprojects.cloud\/wordpress\/splatco\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/#organization","name":"SPLat Controls","url":"https:\/\/webprojects.cloud\/wordpress\/splatco\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/#\/schema\/logo\/image\/","url":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2024\/10\/logo.svg","contentUrl":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2024\/10\/logo.svg","caption":"SPLat Controls"},"image":{"@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-json\/wp\/v2\/spl_knowledgebase\/2272","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-json\/wp\/v2\/spl_knowledgebase"}],"about":[{"href":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-json\/wp\/v2\/types\/spl_knowledgebase"}],"author":[{"embeddable":true,"href":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-json\/wp\/v2\/users\/1"}],"up":[{"embeddable":true,"href":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-json\/wp\/v2\/spl_knowledgebase\/2271"}],"wp:attachment":[{"href":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-json\/wp\/v2\/media?parent=2272"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}