{"id":3803,"date":"2025-04-21T11:15:32","date_gmt":"2025-04-21T11:15:32","guid":{"rendered":"https:\/\/webprojects.cloud\/wordpress\/splatco\/?post_type=spl_knowledgebase&#038;p=3803"},"modified":"2025-06-10T06:03:19","modified_gmt":"2025-06-10T06:03:19","slug":"byte-formatting-function-bsource-format-2","status":"publish","type":"spl_knowledgebase","link":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/formatting-functions\/byte-formatting-function-bsource-format-2\/","title":{"rendered":"Byte formatting function b(Source {, Format})"},"content":{"rendered":"\n<p>Specifies byte sized (8-bit, values 0 to 255) data as an argument to a supporting hash function. The first argument specifies where to get the data (the source). The second, optional, argument specifies the actual display format. If the format is not specified, the format defaults to decimal, variable width.<\/p>\n\n\n\n<p>While the obvious use of this is in the&nbsp;<code>Print()<\/code>&nbsp;hash function, it can also be used in such functions as&nbsp;<code>SetCursor<\/code>&nbsp;or&nbsp;<code>HBar<\/code>.<\/p>\n\n\n\n<h6 class=\"wp-block-heading\">Source specifiers<\/h6>\n\n\n\n<p>The following are the allowable source specifiers<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><th>Form<\/th><th>Meaning<\/th><th>Example<\/th><\/tr><tr><td><code>=x<\/code><\/td><td>Contents of the X register<\/td><td><code>#HMI Print(b(=x))<\/code><\/td><\/tr><tr><td><code>=y<\/code><\/td><td>Contents of the Y register<\/td><td><code>#HMI Print(b(=y))<\/code><\/td><\/tr><tr><td><code>=h<\/code><\/td><td>Contents of the H register<\/td><td><code>#HMI Print(b(=h))<\/code><\/td><\/tr><tr><td><code>=m<\/code><\/td><td>Contents of the M register<\/td><td><code>#HMI Print(b(=m))<\/code><\/td><\/tr><tr><td><code>=s<\/code><\/td><td>Contents of the S register<\/td><td><code>#HMI Print(b(=s))<\/code><\/td><\/tr><tr><td><code>=i<\/code><\/td><td>Contents of the I register<\/td><td><code>#HMI Print(b(=i))<\/code><\/td><\/tr><tr><td><code>Constant<\/code><\/td><td>Contents of an EQUated constant<\/td><td><code>Foo EQU 56<\/code><code>...<\/code><code>#HMI Print(b(Foo))<\/code><\/td><\/tr><tr><td>A number 0 &#8211; 255<\/td><td>An immediate numeric value<\/td><td><code>#HMI Print(b(165))<\/code><\/td><\/tr><tr><td><code>*Label<\/code><\/td><td>Contents of a RAM byte (variable)<\/td><td><code>Temperature defBYTE<\/code><code>...<\/code><code>#HMI Print(b(*Temperature))<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h6 class=\"wp-block-heading\">index\/jndex modifiers<\/h6>\n\n\n\n<p>RAM variable references can also have index\/jndex modifiers<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><th>Form<\/th><th>What is sourced<\/th><th>Example code<\/th><\/tr><tr><td><code>*+bb<\/code><\/td><td>Whatever is in RAM (byte) variable<code> bb<\/code>, with&nbsp;<code><a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/precodes\/iasj-precode-d16\/\">IasJ:<\/a><\/code>&nbsp;applied<\/td><td><code>#HMI Print(b(*+Counter)) ;Force indexing<\/code><\/td><\/tr><tr><td><code>*-bb<\/code><\/td><td>Whatever is in RAM (byte) variable&nbsp;<code>bb<\/code>, with&nbsp;<code><a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/precodes\/noj-precode-d16\/\">NoJ:<\/a><\/code>&nbsp;applied<\/td><td><code>#HMI Print(b(*-Counter)) ;Inhibit jndexing<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>NOTE: The modifier (<code>+<\/code>&nbsp;or&nbsp;<code>-<\/code>) must be after the asterisk. jndexing applies only to code running inside a&nbsp;<a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/tutorial-multitrack\/multitrack-advanced-multi-channel-operations\/\">MultiTrack<\/a>&nbsp;task.<\/p>\n\n\n\n<h6 class=\"wp-block-heading\">Format specifiers<\/h6>\n\n\n\n<p>The format argument specifies how the number is to be displayed. Valid format specifiers are:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><th>Form<\/th><th>Resulting format<\/th><th>Example<\/th><th>Result (the single quotes are NOT printed)<\/th><\/tr><tr><td>Blank (default)<\/td><td>Decimal, variable width<\/td><td><code>#HMI Print(b(56))<\/code><\/td><td><code>'56'<\/code><\/td><\/tr><tr><td><code>f<\/code><\/td><td>Decimal in fixed field width (3 characters)<\/td><td><code>#HMI Print(b(56, f))<\/code><\/td><td><code>' 56'<\/code><\/td><\/tr><tr><td><code>v<\/code><\/td><td>Decimal in variable field width (as many characters positions as are needed.<\/td><td><code>#HMI Print(b(56, v))<\/code><\/td><td><code>'56'<\/code><\/td><\/tr><tr><td><code>2<\/code><\/td><td>Decimal, in 2 character field, padded with&nbsp;<code>0<\/code>. Intended for displaying RTC time.<\/td><td><code>#HMI Print(b(=h, 2))<\/code><\/td><td><code>'06'<\/code><\/td><\/tr><tr><td><code>h<\/code><\/td><td><a href=\"https:\/\/www.google.com\/search?q=hexadecimal\" target=\"_blank\" rel=\"noreferrer noopener\">Hexadecimal<\/a>\u00a0in a field of two character positions<\/td><td><code>#HMI Print(b(165, h))<\/code><code>#HMI Print(b(10, h))<\/code><\/td><td><code>'A5'<\/code><code>'0A'<\/code><\/td><\/tr><tr><td>c<\/td><td>ASCII character<\/td><td><code>LoadX 65<\/code><br><code>#HMI Print(b(=x,c))<\/code><\/td><td>&#8216;A&#8217;<\/td><\/tr><\/tbody><\/table><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Specifies byte sized (8-bit, values 0 to 255) data as an argument to a supporting hash function. The first argument specifies where to get the&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":3802,"menu_order":0,"template":"","class_list":["post-3803","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>Byte formatting function b(Source {, 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=\"Byte formatting function b(Source {, Format}) - SPLat Controls\" \/>\n<meta property=\"og:description\" content=\"Specifies byte sized (8-bit, values 0 to 255) data as an argument to a supporting hash function. The first argument specifies where to get the...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/formatting-functions\/byte-formatting-function-bsource-format-2\/\" \/>\n<meta property=\"og:site_name\" content=\"SPLat Controls\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-10T06:03:19+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\/deprecated\/hmi-android-windows\/formatting-functions\/byte-formatting-function-bsource-format-2\/\",\"url\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/formatting-functions\/byte-formatting-function-bsource-format-2\/\",\"name\":\"Byte formatting function b(Source {, Format}) - SPLat Controls\",\"isPartOf\":{\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/#website\"},\"datePublished\":\"2025-04-21T11:15:32+00:00\",\"dateModified\":\"2025-06-10T06:03:19+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/formatting-functions\/byte-formatting-function-bsource-format-2\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/formatting-functions\/byte-formatting-function-bsource-format-2\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/formatting-functions\/byte-formatting-function-bsource-format-2\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Deprecated\",\"item\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"# HMI Android &#038; Windows\",\"item\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Formatting functions\",\"item\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/formatting-functions\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"Byte formatting function b(Source {, 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":"Byte formatting function b(Source {, 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":"Byte formatting function b(Source {, Format}) - SPLat Controls","og_description":"Specifies byte sized (8-bit, values 0 to 255) data as an argument to a supporting hash function. The first argument specifies where to get the...","og_url":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/formatting-functions\/byte-formatting-function-bsource-format-2\/","og_site_name":"SPLat Controls","article_modified_time":"2025-06-10T06:03:19+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\/deprecated\/hmi-android-windows\/formatting-functions\/byte-formatting-function-bsource-format-2\/","url":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/formatting-functions\/byte-formatting-function-bsource-format-2\/","name":"Byte formatting function b(Source {, Format}) - SPLat Controls","isPartOf":{"@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/#website"},"datePublished":"2025-04-21T11:15:32+00:00","dateModified":"2025-06-10T06:03:19+00:00","breadcrumb":{"@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/formatting-functions\/byte-formatting-function-bsource-format-2\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/formatting-functions\/byte-formatting-function-bsource-format-2\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/formatting-functions\/byte-formatting-function-bsource-format-2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webprojects.cloud\/wordpress\/splatco\/"},{"@type":"ListItem","position":2,"name":"Deprecated","item":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/"},{"@type":"ListItem","position":3,"name":"# HMI Android &#038; Windows","item":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/"},{"@type":"ListItem","position":4,"name":"Formatting functions","item":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/formatting-functions\/"},{"@type":"ListItem","position":5,"name":"Byte formatting function b(Source {, 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\/3803","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\/3802"}],"wp:attachment":[{"href":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-json\/wp\/v2\/media?parent=3803"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}