{"id":2317,"date":"2025-04-15T10:00:28","date_gmt":"2025-04-15T10:00:28","guid":{"rendered":"https:\/\/webprojects.cloud\/wordpress\/splatco\/?post_type=spl_knowledgebase&#038;p=2317"},"modified":"2025-06-10T06:58:37","modified_gmt":"2025-06-10T06:58:37","slug":"iifgetnum-bbnnfw-d28","status":"publish","type":"spl_knowledgebase","link":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/communications-instructions\/iifgetnum-bbnnfw-d28\/","title":{"rendered":"iifGetNum bb#,nn,fw [D>=28]"},"content":{"rendered":"\n<p><code>W = (float){Ascii2Decimal[(bb+I)..(bb+I+min(fw,nn))]}; I = I+{number of characters consumed}; R = (valid result) ? 0 : 1<\/code><\/p>\n\n\n\n<p>Extract (Get) a floating point number from a buffer in&nbsp;<a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/glossary-of-terms\/#o414\">RAM<\/a>.<\/p>\n\n\n\n<p>Consider an Xwire receive data block to be&nbsp;<code>nn<\/code>&nbsp;bytes of RAM long, starting at address&nbsp;<code>bb<\/code>. Return a decimal number from the data block, starting at RAM address&nbsp;<code>bb+I<\/code>&nbsp;(i.e. the starting address is indexed). Skip any leading spaces. Process leading + or &#8211;&nbsp;sign, if present. Terminate on anything thereafter that&#8217;s not a decimal digit or decimal point, or after processing&nbsp;<code>fw<\/code>&nbsp;(field width) characters in total (including spaces, sign and decimal point). Advance&nbsp;<code>I<\/code>&nbsp;past the characters used, leaving it pointing at the terminating character (auto-index). Result in W, NaN if nothing there. R register signals outcome. 0 = OK, 1 = no valid decimal number present.<\/p>\n\n\n\n<p>Notes:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Typically used for receiving ASCII-coded information from an Xwire peripheral board.<\/li>\n\n\n\n<li>The field width&nbsp;<code>fw<\/code>&nbsp;includes leading spaces, signs and decimal point.<\/li>\n\n\n\n<li>Conversion will end on the first unexpected character, including a second sign character, a second decimal point or a trailing space. This overrides the field width.<\/li>\n\n\n\n<li>The valid range for&nbsp;<code>fw<\/code>&nbsp;is 1 to 255.&nbsp;<code>fw<\/code>&nbsp;= 255 disables character counting.<\/li>\n\n\n\n<li>Anything more than 7 digits of input is meaningless, as the floating point number representation is only accurate to 6 or 7 decimal places. Excess digits will be nevertheless be consumed, up to the limits of&nbsp;<code>nn<\/code>&nbsp;and&nbsp;<code>fw<\/code>.<\/li>\n<\/ol>\n\n\n\n<p><a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/glossary-of-terms\/#o2825\">Dialect<\/a>&nbsp;exclusions: Not available in dialects before 28<\/p>\n\n\n\n<p>See also:\u00a0<code><a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/communications-instructions\/iifprintwfw-destfp-d23\/\">iifPrintWFW<\/a><\/code>,\u00a0<code><a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/communications-instructions\/iifprintwvw-destfp-d23\/\">iifPrintWVW<\/a><\/code>,<\/p>\n\n\n\n<h6 class=\"wp-block-heading\">Examples<\/h6>\n\n\n\n<p>The following shows the result of the instruction&nbsp;<code>iifGetNum 100,15,8<\/code>&nbsp;for various RAM contents and Values of&nbsp;<code>I<\/code>.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td><strong>Data in RAM, starting at address 100 (Shown as ASCII (printable) characters.<\/strong><\/td><td><strong>Initial value of I<\/strong><\/td><td><strong>Result returned in W<\/strong><\/td><td><strong>Final value of I<\/strong><\/td><td><strong>Comment<\/strong><\/td><\/tr><tr><td><code>123.456xxxxxxxx<\/code><\/td><td>0<\/td><td>123.456<\/td><td>7<\/td><td>Conversion starts at the first character, because&nbsp;<code>I<\/code>&nbsp;= 0. Conversion is terminated by the first x.<\/td><\/tr><tr><td><code>123.456xxxxxxxx<\/code><\/td><td>1<\/td><td>23.456<\/td><td>7<\/td><td>Conversion starts at the second character, because&nbsp;<code>I<\/code>&nbsp;= 1.<\/td><\/tr><tr><td><code>123.456xxxx<\/code><\/td><td>0<\/td><td>123<\/td><td>8<\/td><td>Leading spaces are counted in the field width. The decimal point &#8220;makes it&#8221;, and&nbsp;<code>I<\/code>&nbsp;gets left pointing at the 4. A subsequent conversion with the same instruction would return 456<\/td><\/tr><tr><td><code>-123.456xxxxxxx<\/code><\/td><td>0<\/td><td>-123.456<\/td><td>8<\/td><td>All good, got it all<\/td><\/tr><tr><td><code>-123.456xxxxxx<\/code><\/td><td>0<\/td><td>-123.45<\/td><td>8<\/td><td>The last digit is excluded, because the field width of 8 terminates conversion. Furthermore, a subsequent conversion would return 6.<\/td><\/tr><tr><td><code>-12.3.456xxxxxx<\/code><\/td><td>0<\/td><td>-12.3<\/td><td>6<\/td><td>The second decimal point terminates conversion. If the same instruction were executed again (with&nbsp;<code>I<\/code>&nbsp;as-is), it would return 0.456<\/td><\/tr><\/tbody><\/table><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>W = (float){Ascii2Decimal[(bb+I)..(bb+I+min(fw,nn))]}; I = I+{number of characters consumed}; R = (valid result) ? 0 : 1 Extract (Get) a floating point number from a&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":2256,"menu_order":7,"template":"","class_list":["post-2317","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>iifGetNum bb#,nn,fw [D&gt;=28] - 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=\"iifGetNum bb#,nn,fw [D&gt;=28] - SPLat Controls\" \/>\n<meta property=\"og:description\" content=\"W = (float){Ascii2Decimal[(bb+I)..(bb+I+min(fw,nn))]}; I = I+{number of characters consumed}; R = (valid result) ? 0 : 1 Extract (Get) a floating point number from a...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/communications-instructions\/iifgetnum-bbnnfw-d28\/\" \/>\n<meta property=\"og:site_name\" content=\"SPLat Controls\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-10T06:58:37+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=\"2 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\/iifgetnum-bbnnfw-d28\/\",\"url\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/communications-instructions\/iifgetnum-bbnnfw-d28\/\",\"name\":\"iifGetNum bb#,nn,fw [D>=28] - SPLat Controls\",\"isPartOf\":{\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/#website\"},\"datePublished\":\"2025-04-15T10:00:28+00:00\",\"dateModified\":\"2025-06-10T06:58:37+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/communications-instructions\/iifgetnum-bbnnfw-d28\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/communications-instructions\/iifgetnum-bbnnfw-d28\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/communications-instructions\/iifgetnum-bbnnfw-d28\/#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\":\"iifGetNum bb#,nn,fw [D>=28]\"}]},{\"@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":"iifGetNum bb#,nn,fw [D>=28] - 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":"iifGetNum bb#,nn,fw [D>=28] - SPLat Controls","og_description":"W = (float){Ascii2Decimal[(bb+I)..(bb+I+min(fw,nn))]}; I = I+{number of characters consumed}; R = (valid result) ? 0 : 1 Extract (Get) a floating point number from a...","og_url":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/communications-instructions\/iifgetnum-bbnnfw-d28\/","og_site_name":"SPLat Controls","article_modified_time":"2025-06-10T06:58:37+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/communications-instructions\/iifgetnum-bbnnfw-d28\/","url":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/communications-instructions\/iifgetnum-bbnnfw-d28\/","name":"iifGetNum bb#,nn,fw [D>=28] - SPLat Controls","isPartOf":{"@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/#website"},"datePublished":"2025-04-15T10:00:28+00:00","dateModified":"2025-06-10T06:58:37+00:00","breadcrumb":{"@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/communications-instructions\/iifgetnum-bbnnfw-d28\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/communications-instructions\/iifgetnum-bbnnfw-d28\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/communications-instructions\/iifgetnum-bbnnfw-d28\/#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":"iifGetNum bb#,nn,fw [D>=28]"}]},{"@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\/2317","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\/2256"}],"wp:attachment":[{"href":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-json\/wp\/v2\/media?parent=2317"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}