{"id":3777,"date":"2025-04-21T09:28:13","date_gmt":"2025-04-21T09:28:13","guid":{"rendered":"https:\/\/webprojects.cloud\/wordpress\/splatco\/?post_type=spl_knowledgebase&#038;p=3777"},"modified":"2025-06-10T05:48:27","modified_gmt":"2025-06-10T05:48:27","slug":"enablesmask-hash-function","status":"publish","type":"spl_knowledgebase","link":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/enablesmask-hash-function\/","title":{"rendered":"# Enables(Mask) hash function"},"content":{"rendered":"\n<p>Valid for use with hash command:&nbsp;<code><a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/\">HMI<\/a><\/code><\/p>\n\n\n\n<p>Implemented on the following platforms: Windows standalone<\/p>\n\n\n\n<p>This function determines which controls will be available on the&nbsp;<a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/glossary-of-terms\/#o5380\">SimpleHMI<\/a>&nbsp;screen.&nbsp;<code>Mask<\/code>&nbsp;consists of 8 semaphores packed into a single byte. Each semaphore controls the visibility of one item. This allows you to control what your&nbsp;<a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/glossary-of-terms\/#o5369\">Enduser<\/a>&nbsp;will see in the standalone Windows version of SimpleHMI.<\/p>\n\n\n\n<p>The following defines the bit (semaphore) numbers within the byte, and what they control:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><th>Bit<\/th><th>Controls<\/th><th>Notes<\/th><\/tr><tr><td>0<\/td><td>Connect button<\/td><td>&nbsp;<\/td><\/tr><tr><td>1<\/td><td>Reset button<\/td><td>&nbsp;<\/td><\/tr><tr><td>2<\/td><td>CLS button<\/td><td>&nbsp;<\/td><\/tr><tr><td>3<\/td><td>Rulers button<\/td><td>&nbsp;<\/td><\/tr><tr><td>4<\/td><td>A\/R (aspect ratio) settings<\/td><td>&nbsp;<\/td><\/tr><tr><td>5<\/td><td>Width settings<\/td><td>&nbsp;<\/td><\/tr><tr><td>6<\/td><td>Show log button<\/td><td>The enduser can still set a log file name on the settings tab, so you can implement logging in your app.<\/td><\/tr><tr><td>7<\/td><td>Terminal tab<\/td><td>Also controls relevant settings on the Settings tab. The terminal is by default hidden in the standalone Windows SimpleHMI. It can be made visible by the command-line\/shortcut switch&nbsp;<code>\/T<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Example program:<\/h2>\n\n\n\n<p>The following program produces a SimpleHMI screen that can be used to control the visibility of all controllable items. In a practical application you would most likely just send a fixed pattern to the SimpleHMI when you draw the initial screen.<\/p>\n\n\n\n<p><a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/cutting-and-pasting-code-from-the-splat-knowledge-base\/\">(Click here<\/a>&nbsp;for some tips for working around problems with copy and paste out of Internet Explorer and HTML-help&nbsp;<code>(.chm)<\/code>&nbsp;files)<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">;========= Test enables in standalone sHMI =========================<br>#       Open_Serial User(38400,8,N)  <br>        GoSub           HMI_Connect<br>#       <a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/glossary-of-terms\/#o5243\">HMI<\/a> ConnectEvent(HMI_Connect)       <br>        RunTasksForever<br>         <br>;ON connecting to SimpleHMI, force the screen to a known width<br>HMI_Connect:<br># HMI Reset() Cls() HideAllButtons() ScreenWidthEvent(40,evScreenWidth)  <br>        Return<br> <br>;Once the SimpleHMI acknowledges the screen width, draw the buttons.       <br>evScreenWidth:<br># HMI Cursor(1, C-10) Print(\"Test control enables\")<br># HMI ButtonEvent(, 0.2, 0.1, 0.1, 0.3, \"Connect\", evConnect)              <br># HMI ButtonEvent(, 0.2, 0.6, 0.1, 0.3, \"Reset\", evReset)              <br><br># HMI ButtonEvent(, 0.4, 0.1, 0.1, 0.3, \"Cls\", evCls)              <br># HMI ButtonEvent(, 0.4, 0.6, 0.1, 0.3, \"Ruler\", evRuler)              <br><br># HMI ButtonEvent(, 0.6, 0.1, 0.1, 0.3, \"A\/R\", evAspect)              <br># HMI ButtonEvent(, 0.6, 0.6, 0.1, 0.3, \"Width\", evWidth)              <br>                                                         <br># HMI ButtonEvent(, 0.8, 0.1, 0.1, 0.3, \"Show log\", evShowLog)              <br># HMI ButtonEvent(, 0.8, 0.6, 0.1, 0.3, \"Terminal\", evTerminal)              <br>                                                         <br>;Controlling enables. One semaphore byte<br>bEnables        defBYTE<br>;Define the enable semaphore bits<br>sConnect        EQU     0<br>sReset          EQU     1<br>sCls            EQU     2<br>sRuler          EQU     3<br>sAspect         EQU     4<br>sWidth          EQU     5<br>sShowLog        EQU     6    <br>sTerminal       EQU     7<br><br>;<a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/glossary-of-terms\/#o4952\">Event<\/a> handlers for each of th enable buttons.  <br>evConnect:      LoadI   sConnect<br>                GoTo    ToggleEnable<br><br>evReset:        LoadI   sReset<br>                GoTo    ToggleEnable<br><br>evCls:          LoadI   sCls<br>                GoTo    ToggleEnable<br><br>evRuler:        LoadI   sRuler<br>                GoTo    ToggleEnable<br><br>evAspect:       LoadI   sAspect<br>                GoTo    ToggleEnable<br><br>evWidth:        LoadI   sWidth<br>                GoTo    ToggleEnable<br><br>evShowLog:      LoadI   sShowLog<br>                GoTo    ToggleEnable<br><br>evTerminal:     LoadI   sTerminal<br>                GoTo    ToggleEnable<br>ToggleEnable:<br>                IasJ:RecallS    0,bEnables <br>                Not<br>                IasJ:StoreS     0,bEnables<br># HMI Enables(bEnables)                         ;Send enables mask to SimpleHMI<br>                Return                <\/pre>\n\n\n\n<p>The Enables hash function is intended for use in cases where the standalone SimpleHMI for Windows is to be used by an enduser. It also works in the SPLat\/PC version.<\/p>\n\n\n\n<p>In the SPLat\/PC version, you can restore the default settings by holding down SHIFT and clicking the blue SimpleHMI title bar.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"335\" height=\"129\" src=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2025\/04\/Enables.png\" alt=\"\" class=\"wp-image-3778\" srcset=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2025\/04\/Enables.png 335w, https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2025\/04\/Enables-300x116.png 300w, https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2025\/04\/Enables-64x25.png 64w\" sizes=\"auto, (max-width: 335px) 100vw, 335px\" \/><\/figure>\n\n\n\n\n","protected":false},"excerpt":{"rendered":"<p>Valid for use with hash command:&nbsp;HMI Implemented on the following platforms: Windows standalone This function determines which controls will be available on the&nbsp;SimpleHMI&nbsp;screen.&nbsp;Mask&nbsp;consists of 8&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":3768,"menu_order":7,"template":"","class_list":["post-3777","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># Enables(Mask) hash function - 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=\"# Enables(Mask) hash function - SPLat Controls\" \/>\n<meta property=\"og:description\" content=\"Valid for use with hash command:&nbsp;HMI Implemented on the following platforms: Windows standalone This function determines which controls will be available on the&nbsp;SimpleHMI&nbsp;screen.&nbsp;Mask&nbsp;consists of 8...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/enablesmask-hash-function\/\" \/>\n<meta property=\"og:site_name\" content=\"SPLat Controls\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-10T05:48:27+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2025\/04\/Enables.png\" \/>\n\t<meta property=\"og:image:width\" content=\"335\" \/>\n\t<meta property=\"og:image:height\" content=\"129\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\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\/enablesmask-hash-function\/\",\"url\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/enablesmask-hash-function\/\",\"name\":\"# Enables(Mask) hash function - SPLat Controls\",\"isPartOf\":{\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/enablesmask-hash-function\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/enablesmask-hash-function\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2025\/04\/Enables.png\",\"datePublished\":\"2025-04-21T09:28:13+00:00\",\"dateModified\":\"2025-06-10T05:48:27+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/enablesmask-hash-function\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/enablesmask-hash-function\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/enablesmask-hash-function\/#primaryimage\",\"url\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2025\/04\/Enables.png\",\"contentUrl\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2025\/04\/Enables.png\",\"width\":335,\"height\":129},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/enablesmask-hash-function\/#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\":\"# Enables(Mask) hash function\"}]},{\"@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":"# Enables(Mask) hash function - 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":"# Enables(Mask) hash function - SPLat Controls","og_description":"Valid for use with hash command:&nbsp;HMI Implemented on the following platforms: Windows standalone This function determines which controls will be available on the&nbsp;SimpleHMI&nbsp;screen.&nbsp;Mask&nbsp;consists of 8...","og_url":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/enablesmask-hash-function\/","og_site_name":"SPLat Controls","article_modified_time":"2025-06-10T05:48:27+00:00","og_image":[{"width":335,"height":129,"url":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2025\/04\/Enables.png","type":"image\/png"}],"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\/enablesmask-hash-function\/","url":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/enablesmask-hash-function\/","name":"# Enables(Mask) hash function - SPLat Controls","isPartOf":{"@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/#website"},"primaryImageOfPage":{"@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/enablesmask-hash-function\/#primaryimage"},"image":{"@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/enablesmask-hash-function\/#primaryimage"},"thumbnailUrl":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2025\/04\/Enables.png","datePublished":"2025-04-21T09:28:13+00:00","dateModified":"2025-06-10T05:48:27+00:00","breadcrumb":{"@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/enablesmask-hash-function\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/enablesmask-hash-function\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/enablesmask-hash-function\/#primaryimage","url":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2025\/04\/Enables.png","contentUrl":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2025\/04\/Enables.png","width":335,"height":129},{"@type":"BreadcrumbList","@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/enablesmask-hash-function\/#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":"# Enables(Mask) hash function"}]},{"@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\/3777","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\/3768"}],"wp:attachment":[{"href":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-json\/wp\/v2\/media?parent=3777"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}