{"id":3310,"date":"2025-04-18T04:45:07","date_gmt":"2025-04-18T04:45:07","guid":{"rendered":"https:\/\/webprojects.cloud\/wordpress\/splatco\/?post_type=spl_knowledgebase&#038;p=3310"},"modified":"2025-06-10T09:23:23","modified_gmt":"2025-06-10T09:23:23","slug":"multitrack-advanced-multiple-simultaneous-supertimers","status":"publish","type":"spl_knowledgebase","link":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/tutorial-multitrack\/multitrack-advanced-multiple-simultaneous-supertimers\/","title":{"rendered":"MultiTrack (Advanced): Multiple simultaneous SuperTimers"},"content":{"rendered":"\n<p>With MultiTrack each task gets a &#8220;free&#8221; SuperTimer for setting intervals. This was covered in an\u00a0<a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/tutorial-multitrack\/multitrack-intermediate-supertimers\/\">earlier lesson<\/a>. But what if you need to have several timers running simultaneously within a task? You will need to manually create additional SuperTimers.<\/p>\n\n\n\n<p>Remember: When executed inside a MultiTrack task, instructions with built in timing (<code><a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/fasttrack-instructions\/pause-tttt\/\">Pause<\/a><\/code>,\u00a0<code><a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/fasttrack-instructions\/waitont-iitttt\/\">WaitOnT<\/a>,<\/code>\u00a0<code><a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/timing-instructions\/waitofft-iitttt\/\">WaitOffT<\/a><\/code>\u00a0and\u00a0<code><a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/timing-instructions\/waitonkt-iitttt\/\">WaitOnKT<\/a>)<\/code>\u00a0use the task&#8217;s SuperTimer.<\/p>\n\n\n\n<p>To manually create SuperTimers within a task (or to use SuperTimers outside MultiTrack tasks) you need to set aside 3 bytes of normal\u00a0<a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/glossary-of-terms\/#o414\">RAM<\/a>\u00a0(<a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/glossary-of-terms\/#o415\">Data Memory<\/a>) for each timer. The directive for doing this is<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">MyTimer:              <a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/directives\/deftime24-directive\/\">defTIME24<\/a><\/pre>\n\n\n\n<p>Thereafter &#8216;<code>MyTimer<\/code>&#8216; can be used to refer to the specific SuperTimer.&nbsp;<code>defTIME24<\/code>&nbsp;sets aside 3 bytes (24 bits) of RAM to hold the time value.<\/p>\n\n\n\n<p>To start timing with a manual SuperTimer you use the instruction<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">        STStart       MyTimer<\/pre>\n\n\n\n<p>What this does is to grab the current system time value and save it in RAM in the 3 bytes of&nbsp;<code>MyTimer<\/code>.<\/p>\n\n\n\n<p>To determine if a certain amount of time has elapsed since the&nbsp;<code>STStart<\/code>&nbsp;instruction was executed, you use the&nbsp;<code>STTest<\/code>&nbsp;instruction:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">        STTest        MyTimer,1234567<\/pre>\n\n\n\n<p>This will return True in\u00a0<a href=\"https:\/\/www.splatco.com\/skb\/352.htm#o3808\">X<\/a>\u00a0if the interval (1234567 times 10mS) has not yet expired, i.e. it is still timing the interval. This is consistent with the legacy timers and the\u00a0<code><a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/timing-instructions\/countdown-timers\/test-t\/\">Test<\/a><\/code>\u00a0instruction.<\/p>\n\n\n\n<h6 class=\"wp-block-heading\">Example:<\/h6>\n\n\n\n<p>This example is a little contrived, but it illustrates the point. When a start button is pressed, turn on output 7 and start timing a 1 minute interval. When the same button is pressed a second time, start flashing output 0 on for 500mS and off for 500mS for the remainder of the minute. At the end of the minute make sure outputs are off and repeat the process.<\/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>\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-preformatted\">OverallTime EQU         6000                    ;1 minute in 10mS increments\nMyTime      defTIME24                           ;Memory for SuperTimer\n\nStart:\n        ResetK                                  ;Clear input latches\n        Off             7                       ;Turn off 1 minute indicator\n        WaitOnK         0                       ;Wait for 1st button press\n        On              7                       ;Indicate that we are timing\n        STStart         MyTime                  ;Start 1 minute over-arching timer\nLoop1:\n        GoIfInK         0,StartFlashing         ;Test for 2nd button press\n        STTest          MyTime,OverallTime      ;Test if the minute has expired\n        GoIfT           Loop1                   ;Keep trying if the minute is not up\n        GoTo            Start                   ;Timed out ... end of the game\n\n;Flash output 0 for the remainder of the minute.\nStartFlashing:\n        On              0                       ;Flash on\n        Pause           50                      ;Time the ON period\n        Off             0                       ;Flash off\n        STTest          MyTime,OverallTime      ;Test if the minute has expired\n        GoIfF           Start                   ;G\/ no longer timing\n        Pause           50                      ;Time the OFF period\n        STTest          MyTime,OverallTime      ;Test if the minute has expired\n        GoIfF           Start                   ;G\/ no longer timing\n        GoTo            StartFlashing\n<\/pre>\n\n\n\n<p>This program has been coded without using MultiTrack. You will notice there are several tests for expiration of the 1 minute time interval. This is necessary because there are several places in the program where the program is in a loop but the minute could expire.<\/p>\n\n\n\n<h6 class=\"wp-block-heading\">Exercise 1:<\/h6>\n\n\n\n<p>Get the program running in the SPLat\/PC simulator. Hint: Reduce the time intervals to speed it up. You can also close the&nbsp;<code>Pause<\/code>&nbsp;timer window to speed it up.<\/p>\n\n\n\n<h6 class=\"wp-block-heading\">Exercise 2:<\/h6>\n\n\n\n<p>Convert the program to a MultiTrack task and get it running. You will most likely get an error message first time you run it. Fix the problem. Notice that the&nbsp;<code>Pause<\/code>&nbsp;timer window no longer appears. This is because when executed from inside a MultiTrack task&nbsp;<code>Pause<\/code>&nbsp;is generated by the SuperTimer mechanism, but when not in a MultiTrack task it is generated by an older mechanism (a single, global&nbsp;<code>Pause<\/code>&nbsp;timer).<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>With MultiTrack each task gets a &#8220;free&#8221; SuperTimer for setting intervals. This was covered in an\u00a0earlier lesson. But what if you need to have several&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":3299,"menu_order":7,"template":"","class_list":["post-3310","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>MultiTrack (Advanced): Multiple simultaneous SuperTimers - 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=\"MultiTrack (Advanced): Multiple simultaneous SuperTimers - SPLat Controls\" \/>\n<meta property=\"og:description\" content=\"With MultiTrack each task gets a &#8220;free&#8221; SuperTimer for setting intervals. This was covered in an\u00a0earlier lesson. But what if you need to have several...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/tutorial-multitrack\/multitrack-advanced-multiple-simultaneous-supertimers\/\" \/>\n<meta property=\"og:site_name\" content=\"SPLat Controls\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-10T09:23:23+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=\"3 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\/tutorial-multitrack\/multitrack-advanced-multiple-simultaneous-supertimers\/\",\"url\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/tutorial-multitrack\/multitrack-advanced-multiple-simultaneous-supertimers\/\",\"name\":\"MultiTrack (Advanced): Multiple simultaneous SuperTimers - SPLat Controls\",\"isPartOf\":{\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/#website\"},\"datePublished\":\"2025-04-18T04:45:07+00:00\",\"dateModified\":\"2025-06-10T09:23:23+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/tutorial-multitrack\/multitrack-advanced-multiple-simultaneous-supertimers\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/tutorial-multitrack\/multitrack-advanced-multiple-simultaneous-supertimers\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/tutorial-multitrack\/multitrack-advanced-multiple-simultaneous-supertimers\/#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: MultiTrack\",\"item\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/tutorial-multitrack\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"MultiTrack (Advanced): Multiple simultaneous SuperTimers\"}]},{\"@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":"MultiTrack (Advanced): Multiple simultaneous SuperTimers - 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":"MultiTrack (Advanced): Multiple simultaneous SuperTimers - SPLat Controls","og_description":"With MultiTrack each task gets a &#8220;free&#8221; SuperTimer for setting intervals. This was covered in an\u00a0earlier lesson. But what if you need to have several...","og_url":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/tutorial-multitrack\/multitrack-advanced-multiple-simultaneous-supertimers\/","og_site_name":"SPLat Controls","article_modified_time":"2025-06-10T09:23:23+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/tutorial-multitrack\/multitrack-advanced-multiple-simultaneous-supertimers\/","url":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/tutorial-multitrack\/multitrack-advanced-multiple-simultaneous-supertimers\/","name":"MultiTrack (Advanced): Multiple simultaneous SuperTimers - SPLat Controls","isPartOf":{"@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/#website"},"datePublished":"2025-04-18T04:45:07+00:00","dateModified":"2025-06-10T09:23:23+00:00","breadcrumb":{"@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/tutorial-multitrack\/multitrack-advanced-multiple-simultaneous-supertimers\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/tutorial-multitrack\/multitrack-advanced-multiple-simultaneous-supertimers\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/tutorial-multitrack\/multitrack-advanced-multiple-simultaneous-supertimers\/#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: MultiTrack","item":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/tutorial-multitrack\/"},{"@type":"ListItem","position":4,"name":"MultiTrack (Advanced): Multiple simultaneous SuperTimers"}]},{"@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\/3310","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\/3299"}],"wp:attachment":[{"href":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-json\/wp\/v2\/media?parent=3310"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}