{"id":3344,"date":"2025-04-18T05:14:13","date_gmt":"2025-04-18T05:14:13","guid":{"rendered":"https:\/\/webprojects.cloud\/wordpress\/splatco\/?post_type=spl_knowledgebase&#038;p=3344"},"modified":"2025-06-10T09:41:25","modified_gmt":"2025-06-10T09:41:25","slug":"user-programmable-protocol-sending-out-messages","status":"publish","type":"spl_knowledgebase","link":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/serial-communications\/user-programmable-protocol\/user-programmable-protocol-sending-out-messages\/","title":{"rendered":"User programmable protocol: Sending out messages"},"content":{"rendered":"\n<p>Interacting with an external device via the serial port will frequently entail sending out messages or commands to that device. You would do this by sending the individual &#8220;components&#8221; of a message one at a time. The instructions you need are the ones that start with&nbsp;<code>ComTx_<\/code>&nbsp;or&nbsp;<code>ii<\/code>&nbsp;under&nbsp;<a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/communications-instructions\/\">Communications instructions<\/a>. The trick with the&nbsp;<code>ii<\/code>&nbsp;instructions is to use the same destination address as programmed in the #Open_Serial command, which directs the output of the instruction to the serial port (providing you have initialised it to&nbsp;<a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/serial-communications\/user-programmable-protocol\/user-programmable-protocol-communication-control-block\/\">User Programmable Protocol<\/a>).<\/p>\n\n\n\n<h6 class=\"wp-block-heading\">Example:<\/h6>\n\n\n\n<p>The following program will send out ASCII numeric and text strings terminated in carriage return\/line feed. You can view the result using the terminal function built into SPLat\/PC. Once the program is running (you should see a flashing LED on the MS120 front panel, click the SIO button on the SPLat\/PC Module window. This will open up the&nbsp;<a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/splat-pc-programming-software\/terminal-for-serial-comms-testing\/\">terminal window<\/a>. In the settings tab make sure the Comms parameters are 38400 for Baud and N,8,1 for Character (this is the same as on&nbsp;<a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/splat-pc-programming-software\/terminal-for-serial-comms-testing\/\">this page<\/a>. Once the settings are correct, click the Terminal tab, and make sure the ASCII button is depressed. When you start pressing buttons on the MS120 you should see the data from the MS120 displayed on the black terminal display. If you now select the Hex button, you can see the same data in hex.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"671\" height=\"420\" src=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2025\/04\/programmable-protocol.png\" alt=\"\" class=\"wp-image-3345\" srcset=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2025\/04\/programmable-protocol.png 671w, https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2025\/04\/programmable-protocol-300x188.png 300w, https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2025\/04\/programmable-protocol-600x376.png 600w, https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2025\/04\/programmable-protocol-64x40.png 64w\" sizes=\"auto, (max-width: 671px) 100vw, 671px\" \/><\/figure>\n\n\n\n<p>Here&#8217;s the code:\u00a0<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>\u00a0for some tips for working around problems with copy and paste out of Internet Explorer and HTML-help\u00a0<code>(.chm)<\/code>\u00a0files)<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>;Example of sending ASCII stuff out the serial port. Designed for MS120, easily adapted to MMi202.\n;Input button 12 increments a counter and sends its value\n;Input button 13 decrements the counter and sends its value\n;Input button 14 Sends a canned message\n;Input button 16 deliberately crashes the program so SPLat\/PC can regain control (connect).\n;There is one MultiTrack task per function. Another task flashes an LED as a run indicator\n\n          OBLCD_Dim       1,8,2                   ;Set up LCD backlight for dimming\n  #       Open_Serial     Port(251) User(38400, 8, N)       ;Start up serial port 251 in \"user\" protocol. This will delay 10 seonds\n          LaunchTask      UpCount\n          LaunchTask      DnCount\n          LaunchTask      CannedMsg\n          LaunchTask      HeartBeat       ;Run indicator\n          LaunchTask      CrashMe         ;Suicide task\n          RunTasksForever\n\nfCount  defFLOAT                        ;The up\/down counter    \n\nUpCount:\n          WaitOnK         12              ;Up button\n          fRecallW        fCount\n          fINC\n          fStore          fCount\n          GoSub           OutputCounter\n          GoTo            UpCount  \n\nDnCount:\n          WaitOnK         13              ;Dn button\n          fRecallW        fCount\n          fDEC\n          fStore          fCount\n          GoSub           OutputCounter\n          GoTo            DnCount    \n\nCannedMsg:\n          WaitOnK         14\n          iiPrintText     251,\"Hello World\",'0D,'0A         ;251 is the serial port\n          GoTo            CannedMsg\n\nHeartBeat:\n          On              8       ;The LED under the kill button\n          Pause           2\n          Off             8\n          Pause           20\n          GoTo            HeartBeat\n\nCrashMe: ;Suicide\n          WaitOnK         16\nDie\n          GoSub           Die     ;Program will restart at once (stack overflow), but with 10S delay before user comms starts up.\n\n;Serial output counter\nOutputCounter:\n          fRecallW        fCount\n          iifPrintWVW     251,5,0         ;251 is the serial port\n          iiPrintText     251,'0D,'0A     ;Carriage return\/line feed\n          Return<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Interacting with an external device via the serial port will frequently entail sending out messages or commands to that device. You would do this by&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":3330,"menu_order":1,"template":"","class_list":["post-3344","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>User programmable protocol: Sending out messages - 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=\"User programmable protocol: Sending out messages - SPLat Controls\" \/>\n<meta property=\"og:description\" content=\"Interacting with an external device via the serial port will frequently entail sending out messages or commands to that device. You would do this by...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/serial-communications\/user-programmable-protocol\/user-programmable-protocol-sending-out-messages\/\" \/>\n<meta property=\"og:site_name\" content=\"SPLat Controls\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-10T09:41:25+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2025\/04\/programmable-protocol.png\" \/>\n\t<meta property=\"og:image:width\" content=\"671\" \/>\n\t<meta property=\"og:image:height\" content=\"420\" \/>\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\/tutorials-application-notes-and-white-papers\/serial-communications\/user-programmable-protocol\/user-programmable-protocol-sending-out-messages\/\",\"url\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/serial-communications\/user-programmable-protocol\/user-programmable-protocol-sending-out-messages\/\",\"name\":\"User programmable protocol: Sending out messages - SPLat Controls\",\"isPartOf\":{\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/serial-communications\/user-programmable-protocol\/user-programmable-protocol-sending-out-messages\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/serial-communications\/user-programmable-protocol\/user-programmable-protocol-sending-out-messages\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2025\/04\/programmable-protocol.png\",\"datePublished\":\"2025-04-18T05:14:13+00:00\",\"dateModified\":\"2025-06-10T09:41:25+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/serial-communications\/user-programmable-protocol\/user-programmable-protocol-sending-out-messages\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/serial-communications\/user-programmable-protocol\/user-programmable-protocol-sending-out-messages\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/serial-communications\/user-programmable-protocol\/user-programmable-protocol-sending-out-messages\/#primaryimage\",\"url\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2025\/04\/programmable-protocol.png\",\"contentUrl\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2025\/04\/programmable-protocol.png\",\"width\":671,\"height\":420},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/serial-communications\/user-programmable-protocol\/user-programmable-protocol-sending-out-messages\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Tutorials, application notes and white papers\",\"item\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Serial communications\",\"item\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/serial-communications\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"User programmable protocol\",\"item\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/serial-communications\/user-programmable-protocol\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"User programmable protocol: Sending out messages\"}]},{\"@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":"User programmable protocol: Sending out messages - 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":"User programmable protocol: Sending out messages - SPLat Controls","og_description":"Interacting with an external device via the serial port will frequently entail sending out messages or commands to that device. You would do this by...","og_url":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/serial-communications\/user-programmable-protocol\/user-programmable-protocol-sending-out-messages\/","og_site_name":"SPLat Controls","article_modified_time":"2025-06-10T09:41:25+00:00","og_image":[{"width":671,"height":420,"url":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2025\/04\/programmable-protocol.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\/tutorials-application-notes-and-white-papers\/serial-communications\/user-programmable-protocol\/user-programmable-protocol-sending-out-messages\/","url":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/serial-communications\/user-programmable-protocol\/user-programmable-protocol-sending-out-messages\/","name":"User programmable protocol: Sending out messages - SPLat Controls","isPartOf":{"@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/#website"},"primaryImageOfPage":{"@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/serial-communications\/user-programmable-protocol\/user-programmable-protocol-sending-out-messages\/#primaryimage"},"image":{"@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/serial-communications\/user-programmable-protocol\/user-programmable-protocol-sending-out-messages\/#primaryimage"},"thumbnailUrl":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2025\/04\/programmable-protocol.png","datePublished":"2025-04-18T05:14:13+00:00","dateModified":"2025-06-10T09:41:25+00:00","breadcrumb":{"@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/serial-communications\/user-programmable-protocol\/user-programmable-protocol-sending-out-messages\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/serial-communications\/user-programmable-protocol\/user-programmable-protocol-sending-out-messages\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/serial-communications\/user-programmable-protocol\/user-programmable-protocol-sending-out-messages\/#primaryimage","url":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2025\/04\/programmable-protocol.png","contentUrl":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2025\/04\/programmable-protocol.png","width":671,"height":420},{"@type":"BreadcrumbList","@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/serial-communications\/user-programmable-protocol\/user-programmable-protocol-sending-out-messages\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webprojects.cloud\/wordpress\/splatco\/"},{"@type":"ListItem","position":2,"name":"Tutorials, application notes and white papers","item":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/"},{"@type":"ListItem","position":3,"name":"Serial communications","item":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/serial-communications\/"},{"@type":"ListItem","position":4,"name":"User programmable protocol","item":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/serial-communications\/user-programmable-protocol\/"},{"@type":"ListItem","position":5,"name":"User programmable protocol: Sending out messages"}]},{"@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\/3344","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\/3330"}],"wp:attachment":[{"href":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-json\/wp\/v2\/media?parent=3344"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}