{"id":2314,"date":"2020-02-28T01:39:16","date_gmt":"2020-02-28T01:39:16","guid":{"rendered":"http:\/\/bryceautomation.com\/?p=2314"},"modified":"2020-02-28T01:41:05","modified_gmt":"2020-02-28T01:41:05","slug":"cascading-counters","status":"publish","type":"post","link":"https:\/\/bryceautomation.com\/index.php\/2020\/02\/28\/cascading-counters\/","title":{"rendered":"Cascading Counters"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\">Introduction to Cascading Counters<\/h3>\n\n\n\n<p>By cascading counters, you can virtually have a limitless number of counts using CTU instructions.  With the older 16 bit processors, the maximum count was 32767 before the counter overflowed.    Using 32 bit processors, however, this maximum count for a signed DINT is 2147483647 before it will overflow.  In reality, this is more counts than most people will ever need.    At one count per second, the counter would be good for over 68 years!<\/p><div id=\"bryce-3896673286\" class=\"bryce-afterfirst bryce-entity-placement\"><script async src=\"\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js?client=ca-pub-8316758073402323\" crossorigin=\"anonymous\"><\/script><ins class=\"adsbygoogle\" style=\"display:block;\" data-ad-client=\"ca-pub-8316758073402323\" \ndata-ad-slot=\"7728240895\" \ndata-ad-format=\"auto\"><\/ins>\n<script> \n(adsbygoogle = window.adsbygoogle || []).push({}); \n<\/script>\n<\/div>\n\n\n\n<p>So why would we want to cascade counters to get more counts?  In spite of the ControlLogix ability to count so high, many factories are working with older SCADA systems which only support 16 bit integers.   In this case, we might have one counter that counts thousands of counts.  The SCADA system can then display the thousands of counts in one register, and individual counts (below 1000) in another register.<\/p>\n\n\n\n<p>Another reason to cascade counters is to limit the number of digits on an HMI display.   For example:   For maintenance purposes, the HMI will simply display thousands of counts instead of individual counts.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Create the tags<\/h3>\n\n\n\n<p>First we&#8217;ll create a couple of tags for the counters.   I&#8217;ll also create a BOOL bit to trigger the number of counts, and a tag for a ONS instruction that we will need later on.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" width=\"513\" height=\"169\" data-src=\"https:\/\/bryceautomation.com\/wp-content\/uploads\/2020\/02\/cascadetags-1.png\" alt=\"\" class=\"wp-image-2318 lazyload\" data-srcset=\"https:\/\/bryceautomation.com\/wp-content\/uploads\/2020\/02\/cascadetags-1.png 513w, https:\/\/bryceautomation.com\/wp-content\/uploads\/2020\/02\/cascadetags-1-300x99.png 300w\" data-sizes=\"(max-width: 513px) 100vw, 513px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 513px; --smush-placeholder-aspect-ratio: 513\/169;\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Cascading Counters Logic<\/h3>\n\n\n\n<p>The logic is very simple:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" width=\"520\" height=\"314\" data-src=\"https:\/\/bryceautomation.com\/wp-content\/uploads\/2020\/02\/cascadelogic-1.png\" alt=\"\" class=\"wp-image-2319 lazyload\" data-srcset=\"https:\/\/bryceautomation.com\/wp-content\/uploads\/2020\/02\/cascadelogic-1.png 520w, https:\/\/bryceautomation.com\/wp-content\/uploads\/2020\/02\/cascadelogic-1-300x181.png 300w\" data-sizes=\"(max-width: 520px) 100vw, 520px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 520px; --smush-placeholder-aspect-ratio: 520\/314;\" \/><\/figure>\n\n\n\n<p>Each time the OnesCounter is triggered, it will increase by the value of 1.   Once the OnesCounter reaches the preset of 1000, it will trigger the ThousandsCounter.    It then resets the OnesCounter.<\/p>\n\n\n\n<p>It&#8217;s important to realize why we use the ONS instruction.  When the Trigger goes high, and the OnesCounter reaches 1000, it resets in the next rung.   If the Trigger is still true on the next scan, the OnesCounter would immediately count back to 1 if it wasn&#8217;t for the ONS instruction.   In effect, without the ONS, every thousand counts, our value would be 1 count too high.  <\/p>\n\n\n\n<p>Be sure to test and verify any logic in your project to assure correct operation before implementing it in any way!<\/p>\n\n\n\n<p>For more information on counters, visit the<a href=\"https:\/\/bryceautomation.com\/index.php\/2017\/05\/30\/controllogix-counters\/\"> ControlLogix Counters <\/a>post!<\/p>\n\n\n\n<p>&#8212; Ricky Bryce<\/p>\n<div id=\"bryce-1474465080\" class=\"bryce-after-content bryce-entity-placement\"><script async src=\"\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js?client=ca-pub-8316758073402323\" crossorigin=\"anonymous\"><\/script><ins class=\"adsbygoogle\" style=\"display:block;\" data-ad-client=\"ca-pub-8316758073402323\" \ndata-ad-slot=\"4667596182\" \ndata-ad-format=\"auto\"><\/ins>\n<script> \n(adsbygoogle = window.adsbygoogle || []).push({}); \n<\/script>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>Introduction to Cascading Counters By cascading counters, you can virtually have a limitless number of counts using CTU instructions. With the older 16 bit processors, the maximum count was 32767 before the counter overflowed. Using 32 bit processors, however, this maximum count for a signed DINT is 2147483647 before it will overflow. In reality, this <a class=\"moretag btn btn-primary\" href=\"https:\/\/bryceautomation.com\/index.php\/2020\/02\/28\/cascading-counters\/\">Read More \u00bb<\/a><\/p>\n","protected":false},"author":1,"featured_media":2319,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[11,27],"class_list":{"0":"post-2314","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-controllogix","8":"tag-controllogix","9":"tag-counters","10":"czr-hentry"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Cascading Counters in the ControlLogix processor<\/title>\n<meta name=\"description\" content=\"We will cascade counters for the purpose of breaking up large numbers into thousand counts, and single counts in the ControlLogix processor.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/bryceautomation.com\/index.php\/2020\/02\/28\/cascading-counters\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Cascading Counters in the ControlLogix processor\" \/>\n<meta property=\"og:description\" content=\"We will cascade counters for the purpose of breaking up large numbers into thousand counts, and single counts in the ControlLogix processor.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/bryceautomation.com\/index.php\/2020\/02\/28\/cascading-counters\/\" \/>\n<meta property=\"og:site_name\" content=\"Bryce Automation\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/ricky.bryce.7\" \/>\n<meta property=\"article:published_time\" content=\"2020-02-28T01:39:16+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-02-28T01:41:05+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/bryceautomation.com\/wp-content\/uploads\/2020\/02\/cascadelogic-1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"520\" \/>\n\t<meta property=\"og:image:height\" content=\"314\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Ricky\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/bryceautomation.com\\\/index.php\\\/2020\\\/02\\\/28\\\/cascading-counters\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/bryceautomation.com\\\/index.php\\\/2020\\\/02\\\/28\\\/cascading-counters\\\/\"},\"author\":{\"name\":\"Ricky\",\"@id\":\"https:\\\/\\\/bryceautomation.com\\\/#\\\/schema\\\/person\\\/5d5b0f6f6ad768f1ee52968338e63af7\"},\"headline\":\"Cascading Counters\",\"datePublished\":\"2020-02-28T01:39:16+00:00\",\"dateModified\":\"2020-02-28T01:41:05+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/bryceautomation.com\\\/index.php\\\/2020\\\/02\\\/28\\\/cascading-counters\\\/\"},\"wordCount\":354,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/bryceautomation.com\\\/index.php\\\/2020\\\/02\\\/28\\\/cascading-counters\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/bryceautomation.com\\\/wp-content\\\/uploads\\\/2020\\\/02\\\/cascadelogic-1.png\",\"keywords\":[\"ControlLogix\",\"Counters\"],\"articleSection\":[\"ControlLogix\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/bryceautomation.com\\\/index.php\\\/2020\\\/02\\\/28\\\/cascading-counters\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/bryceautomation.com\\\/index.php\\\/2020\\\/02\\\/28\\\/cascading-counters\\\/\",\"url\":\"https:\\\/\\\/bryceautomation.com\\\/index.php\\\/2020\\\/02\\\/28\\\/cascading-counters\\\/\",\"name\":\"Cascading Counters in the ControlLogix processor\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/bryceautomation.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/bryceautomation.com\\\/index.php\\\/2020\\\/02\\\/28\\\/cascading-counters\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/bryceautomation.com\\\/index.php\\\/2020\\\/02\\\/28\\\/cascading-counters\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/bryceautomation.com\\\/wp-content\\\/uploads\\\/2020\\\/02\\\/cascadelogic-1.png\",\"datePublished\":\"2020-02-28T01:39:16+00:00\",\"dateModified\":\"2020-02-28T01:41:05+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/bryceautomation.com\\\/#\\\/schema\\\/person\\\/5d5b0f6f6ad768f1ee52968338e63af7\"},\"description\":\"We will cascade counters for the purpose of breaking up large numbers into thousand counts, and single counts in the ControlLogix processor.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/bryceautomation.com\\\/index.php\\\/2020\\\/02\\\/28\\\/cascading-counters\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/bryceautomation.com\\\/index.php\\\/2020\\\/02\\\/28\\\/cascading-counters\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/bryceautomation.com\\\/index.php\\\/2020\\\/02\\\/28\\\/cascading-counters\\\/#primaryimage\",\"url\":\"https:\\\/\\\/bryceautomation.com\\\/wp-content\\\/uploads\\\/2020\\\/02\\\/cascadelogic-1.png\",\"contentUrl\":\"https:\\\/\\\/bryceautomation.com\\\/wp-content\\\/uploads\\\/2020\\\/02\\\/cascadelogic-1.png\",\"width\":520,\"height\":314,\"caption\":\"Cascading ControlLogix Counters\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/bryceautomation.com\\\/index.php\\\/2020\\\/02\\\/28\\\/cascading-counters\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/bryceautomation.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Cascading Counters\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/bryceautomation.com\\\/#website\",\"url\":\"https:\\\/\\\/bryceautomation.com\\\/\",\"name\":\"Bryce Automation\",\"description\":\"Automating Home and Industry...\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/bryceautomation.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/bryceautomation.com\\\/#\\\/schema\\\/person\\\/5d5b0f6f6ad768f1ee52968338e63af7\",\"name\":\"Ricky\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/bryceautomation.com\\\/wp-content\\\/wphb-cache\\\/gravatar\\\/a8f\\\/a8fe6bf79d292b388ffee281ccb12488x96.jpg\",\"url\":\"https:\\\/\\\/bryceautomation.com\\\/wp-content\\\/wphb-cache\\\/gravatar\\\/a8f\\\/a8fe6bf79d292b388ffee281ccb12488x96.jpg\",\"contentUrl\":\"https:\\\/\\\/bryceautomation.com\\\/wp-content\\\/wphb-cache\\\/gravatar\\\/a8f\\\/a8fe6bf79d292b388ffee281ccb12488x96.jpg\",\"caption\":\"Ricky\"},\"sameAs\":[\"http:\\\/\\\/bryceautomation.com\",\"https:\\\/\\\/www.facebook.com\\\/ricky.bryce.7\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/ricky-bryce-4367a416\\\/\"],\"url\":\"https:\\\/\\\/bryceautomation.com\\\/index.php\\\/author\\\/ricky\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Cascading Counters in the ControlLogix processor","description":"We will cascade counters for the purpose of breaking up large numbers into thousand counts, and single counts in the ControlLogix processor.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/bryceautomation.com\/index.php\/2020\/02\/28\/cascading-counters\/","og_locale":"en_US","og_type":"article","og_title":"Cascading Counters in the ControlLogix processor","og_description":"We will cascade counters for the purpose of breaking up large numbers into thousand counts, and single counts in the ControlLogix processor.","og_url":"https:\/\/bryceautomation.com\/index.php\/2020\/02\/28\/cascading-counters\/","og_site_name":"Bryce Automation","article_author":"https:\/\/www.facebook.com\/ricky.bryce.7","article_published_time":"2020-02-28T01:39:16+00:00","article_modified_time":"2020-02-28T01:41:05+00:00","og_image":[{"width":520,"height":314,"url":"https:\/\/bryceautomation.com\/wp-content\/uploads\/2020\/02\/cascadelogic-1.png","type":"image\/png"}],"author":"Ricky","twitter_card":"summary_large_image","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/bryceautomation.com\/index.php\/2020\/02\/28\/cascading-counters\/#article","isPartOf":{"@id":"https:\/\/bryceautomation.com\/index.php\/2020\/02\/28\/cascading-counters\/"},"author":{"name":"Ricky","@id":"https:\/\/bryceautomation.com\/#\/schema\/person\/5d5b0f6f6ad768f1ee52968338e63af7"},"headline":"Cascading Counters","datePublished":"2020-02-28T01:39:16+00:00","dateModified":"2020-02-28T01:41:05+00:00","mainEntityOfPage":{"@id":"https:\/\/bryceautomation.com\/index.php\/2020\/02\/28\/cascading-counters\/"},"wordCount":354,"commentCount":0,"image":{"@id":"https:\/\/bryceautomation.com\/index.php\/2020\/02\/28\/cascading-counters\/#primaryimage"},"thumbnailUrl":"https:\/\/bryceautomation.com\/wp-content\/uploads\/2020\/02\/cascadelogic-1.png","keywords":["ControlLogix","Counters"],"articleSection":["ControlLogix"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/bryceautomation.com\/index.php\/2020\/02\/28\/cascading-counters\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/bryceautomation.com\/index.php\/2020\/02\/28\/cascading-counters\/","url":"https:\/\/bryceautomation.com\/index.php\/2020\/02\/28\/cascading-counters\/","name":"Cascading Counters in the ControlLogix processor","isPartOf":{"@id":"https:\/\/bryceautomation.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/bryceautomation.com\/index.php\/2020\/02\/28\/cascading-counters\/#primaryimage"},"image":{"@id":"https:\/\/bryceautomation.com\/index.php\/2020\/02\/28\/cascading-counters\/#primaryimage"},"thumbnailUrl":"https:\/\/bryceautomation.com\/wp-content\/uploads\/2020\/02\/cascadelogic-1.png","datePublished":"2020-02-28T01:39:16+00:00","dateModified":"2020-02-28T01:41:05+00:00","author":{"@id":"https:\/\/bryceautomation.com\/#\/schema\/person\/5d5b0f6f6ad768f1ee52968338e63af7"},"description":"We will cascade counters for the purpose of breaking up large numbers into thousand counts, and single counts in the ControlLogix processor.","breadcrumb":{"@id":"https:\/\/bryceautomation.com\/index.php\/2020\/02\/28\/cascading-counters\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/bryceautomation.com\/index.php\/2020\/02\/28\/cascading-counters\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/bryceautomation.com\/index.php\/2020\/02\/28\/cascading-counters\/#primaryimage","url":"https:\/\/bryceautomation.com\/wp-content\/uploads\/2020\/02\/cascadelogic-1.png","contentUrl":"https:\/\/bryceautomation.com\/wp-content\/uploads\/2020\/02\/cascadelogic-1.png","width":520,"height":314,"caption":"Cascading ControlLogix Counters"},{"@type":"BreadcrumbList","@id":"https:\/\/bryceautomation.com\/index.php\/2020\/02\/28\/cascading-counters\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/bryceautomation.com\/"},{"@type":"ListItem","position":2,"name":"Cascading Counters"}]},{"@type":"WebSite","@id":"https:\/\/bryceautomation.com\/#website","url":"https:\/\/bryceautomation.com\/","name":"Bryce Automation","description":"Automating Home and Industry...","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/bryceautomation.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/bryceautomation.com\/#\/schema\/person\/5d5b0f6f6ad768f1ee52968338e63af7","name":"Ricky","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/bryceautomation.com\/wp-content\/wphb-cache\/gravatar\/a8f\/a8fe6bf79d292b388ffee281ccb12488x96.jpg","url":"https:\/\/bryceautomation.com\/wp-content\/wphb-cache\/gravatar\/a8f\/a8fe6bf79d292b388ffee281ccb12488x96.jpg","contentUrl":"https:\/\/bryceautomation.com\/wp-content\/wphb-cache\/gravatar\/a8f\/a8fe6bf79d292b388ffee281ccb12488x96.jpg","caption":"Ricky"},"sameAs":["http:\/\/bryceautomation.com","https:\/\/www.facebook.com\/ricky.bryce.7","https:\/\/www.linkedin.com\/in\/ricky-bryce-4367a416\/"],"url":"https:\/\/bryceautomation.com\/index.php\/author\/ricky\/"}]}},"_links":{"self":[{"href":"https:\/\/bryceautomation.com\/index.php\/wp-json\/wp\/v2\/posts\/2314","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bryceautomation.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bryceautomation.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bryceautomation.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bryceautomation.com\/index.php\/wp-json\/wp\/v2\/comments?post=2314"}],"version-history":[{"count":0,"href":"https:\/\/bryceautomation.com\/index.php\/wp-json\/wp\/v2\/posts\/2314\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/bryceautomation.com\/index.php\/wp-json\/wp\/v2\/media\/2319"}],"wp:attachment":[{"href":"https:\/\/bryceautomation.com\/index.php\/wp-json\/wp\/v2\/media?parent=2314"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bryceautomation.com\/index.php\/wp-json\/wp\/v2\/categories?post=2314"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bryceautomation.com\/index.php\/wp-json\/wp\/v2\/tags?post=2314"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}