{"id":3352,"date":"2025-04-18T05:20:11","date_gmt":"2025-04-18T05:20:11","guid":{"rendered":"https:\/\/webprojects.cloud\/wordpress\/splatco\/?post_type=spl_knowledgebase&#038;p=3352"},"modified":"2025-06-10T10:58:16","modified_gmt":"2025-06-10T10:58:16","slug":"serial-debugging-state-tracing","status":"publish","type":"spl_knowledgebase","link":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/tutorial-debugging-splatware-using-serial-data\/serial-debugging-state-tracing\/","title":{"rendered":"Serial debugging: State tracing"},"content":{"rendered":"\n<p>State tracing is very similar to sign posts. You could also call it sign posts applied to\u00a0<a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/glossary-of-terms\/#o4952\">Event<\/a>-Action programming (a.k.a Finite State Machines or FSM).<\/p>\n\n\n\n<p>This is not the place to teach you about FSMs. Suffice to say they are the most powerful way known to man of programming control sequences that can take into account the past history of the system. One easy way to get into this technology is with our&nbsp;<a href=\"https:\/\/www.splatco.com\/skb\/4835.htm\">Tabula programming tool<\/a>.<\/p>\n\n\n\n<p>If you understand FSMs, you will understand the concept of adding a serial debugging signpost on every state entry, which gets execute just one upon entering the state. You could also add signposts to event code or transition code, but that is more cumbersome. Generally it is quite possible to identify a bug by tracking state entries.<\/p>\n\n\n\n<p>One advantage of numbering states, as distinct from (or maybe in addition to) naming them, is that the signpost display can take up less space on the terminal screen. Tabula supports this idea, in that states (table columns) are always numbered.<\/p>\n\n\n\n<h6 class=\"wp-block-heading\">Multiple state machines<\/h6>\n\n\n\n<p>If I have multiple state machines running under MultiTrack, and cannot debug one in isolation from others, I enclose the state numbers in different types of brackets, so that&nbsp;<code>(3)<\/code>&nbsp;and&nbsp;<code>[3]<\/code>&nbsp;are states in different state machines.<\/p>\n\n\n\n<h6 class=\"wp-block-heading\">Multiple instances of one state machine<\/h6>\n\n\n\n<p>If you have multiple instances of a particular state machine in several MultiTrack tasks, it becomes a little more interesting. You then need to generate signposts that includes the task&#8217;s value of\u00a0<code>J<\/code>. as well as the state number. There are two ways to discover a task&#8217;s\u00a0<code>J<\/code>\u00a0value, using either\u00a0<code>BranchJ<\/code>\u00a0or\u00a0<code>LaunchTaskX<\/code>. Both methods require some special initialisation code, plus an array of\u00a0<a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/glossary-of-terms\/#o3499\">jndexed<\/a>\u00a0bytes to hold the state numbers<\/p>\n","protected":false},"excerpt":{"rendered":"<p>State tracing is very similar to sign posts. You could also call it sign posts applied to\u00a0Event-Action programming (a.k.a Finite State Machines or FSM). This&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":3348,"menu_order":3,"template":"","class_list":["post-3352","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>Serial debugging: State tracing - 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=\"Serial debugging: State tracing - SPLat Controls\" \/>\n<meta property=\"og:description\" content=\"State tracing is very similar to sign posts. You could also call it sign posts applied to\u00a0Event-Action programming (a.k.a Finite State Machines or FSM). This...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/tutorial-debugging-splatware-using-serial-data\/serial-debugging-state-tracing\/\" \/>\n<meta property=\"og:site_name\" content=\"SPLat Controls\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-10T10:58:16+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=\"1 minute\" \/>\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\/tutorial-debugging-splatware-using-serial-data\/serial-debugging-state-tracing\/\",\"url\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/tutorial-debugging-splatware-using-serial-data\/serial-debugging-state-tracing\/\",\"name\":\"Serial debugging: State tracing - SPLat Controls\",\"isPartOf\":{\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/#website\"},\"datePublished\":\"2025-04-18T05:20:11+00:00\",\"dateModified\":\"2025-06-10T10:58:16+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/tutorial-debugging-splatware-using-serial-data\/serial-debugging-state-tracing\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/tutorial-debugging-splatware-using-serial-data\/serial-debugging-state-tracing\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/tutorial-debugging-splatware-using-serial-data\/serial-debugging-state-tracing\/#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\":\"Tutorial: Debugging SPLatWare using serial data\",\"item\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/tutorial-debugging-splatware-using-serial-data\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Serial debugging: State tracing\"}]},{\"@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":"Serial debugging: State tracing - 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":"Serial debugging: State tracing - SPLat Controls","og_description":"State tracing is very similar to sign posts. You could also call it sign posts applied to\u00a0Event-Action programming (a.k.a Finite State Machines or FSM). This...","og_url":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/tutorial-debugging-splatware-using-serial-data\/serial-debugging-state-tracing\/","og_site_name":"SPLat Controls","article_modified_time":"2025-06-10T10:58:16+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/tutorial-debugging-splatware-using-serial-data\/serial-debugging-state-tracing\/","url":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/tutorial-debugging-splatware-using-serial-data\/serial-debugging-state-tracing\/","name":"Serial debugging: State tracing - SPLat Controls","isPartOf":{"@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/#website"},"datePublished":"2025-04-18T05:20:11+00:00","dateModified":"2025-06-10T10:58:16+00:00","breadcrumb":{"@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/tutorial-debugging-splatware-using-serial-data\/serial-debugging-state-tracing\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/tutorial-debugging-splatware-using-serial-data\/serial-debugging-state-tracing\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/tutorial-debugging-splatware-using-serial-data\/serial-debugging-state-tracing\/#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":"Tutorial: Debugging SPLatWare using serial data","item":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/tutorial-debugging-splatware-using-serial-data\/"},{"@type":"ListItem","position":4,"name":"Serial debugging: State tracing"}]},{"@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\/3352","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\/3348"}],"wp:attachment":[{"href":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-json\/wp\/v2\/media?parent=3352"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}