{"id":3332,"date":"2025-04-18T05:03:06","date_gmt":"2025-04-18T05:03:06","guid":{"rendered":"https:\/\/webprojects.cloud\/wordpress\/splatco\/?post_type=spl_knowledgebase&#038;p=3332"},"modified":"2025-06-10T09:27:49","modified_gmt":"2025-06-10T09:27:49","slug":"protocols-communications-control-blocks-ccb","status":"publish","type":"spl_knowledgebase","link":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/serial-communications\/serial-communications-protocol-selection\/protocols-communications-control-blocks-ccb\/","title":{"rendered":"Protocols: Communications Control Blocks (CCB)"},"content":{"rendered":"\n<p>Since this was written we have introduced Hash commands. The&nbsp;<code><a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/hash-commands-and-functions\/open_serial-hash-command\/\">Open_Serial<\/a><\/code>&nbsp;hash command make this much simpler to do, so 99% of the time you won;t need what follows<\/p>\n\n\n\n<p>Most protocols have a&nbsp;<a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/communication-control-block-elements\/\">number of attributes<\/a>&nbsp;that can be controlled, and need to be set up. This may be fairly obvious things like the Baud rate (strictly speaking not part of a protocol, but a very important setup parameter) or subtler, protocol-specific things.<\/p>\n\n\n\n<p>It takes&nbsp;<em>up to<\/em>&nbsp;21 bytes of information (possibly more in the future) to fully specify the settings for a protocol. These bytes get stored by you, the programmer, as a table in&nbsp;<a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/non-volatile-extended-memory-nvem-users-guide\/nvem-type-specific-information\/nvem0-documentation\/\">NVEM page 0<\/a>&nbsp;(if that means nothing to you, don&#8217;t worry, we will give you examples later). The table is called a Communications Control Block (CCB), and is created as you edit your program (&#8220;Set at Design Time&#8221;).<\/p>\n\n\n\n<p>This discussion is generalized; it does not pertain to any specific protocol.<\/p>\n\n\n\n<p>Once the CCB is set up in NVEM0, it is invoked during program run by executing a&nbsp;<code><a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/communications-instructions\/default-serial-port\/comsetccb-pppp-d17\/\">ComSetCCB<\/a><\/code>&nbsp;instruction. The&nbsp;<code>ComSetCCB <\/code>instruction contains an argument that points to the CCB.<\/p>\n\n\n\n<p>In summary, to switch to a protocol other than the default SPLatLink, you need to:-<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>At design time create a Communications Control Block (CCB) that selects the required protocol and&nbsp;<a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/communication-control-block-elements\/\">sets its parameters<\/a>.<\/li>\n\n\n\n<li>When your program runs, have it execute a&nbsp;<code>ComSetCCB<\/code>&nbsp;instruction that points to the CCB.<\/li>\n<\/ol>\n\n\n\n<p>In a program, this would look something like the following. Don&#8217;t try yet to fathom the details of the CCB; that will be explained under each individual protocol. Also, be aware the the CCB structure may vary between protocols, according to their individual needs.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">;Example of protocol switching<br><br>;The following instruction would be in the body of the program,<br>;most likely in a program initialization sequence:<br><br>        <a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/communications-instructions\/default-serial-port\/comsetccb-pppp-d17\/\">ComSetCCB<\/a>       ModBus_CCB      ;Point processor at CCB for ModBus<br>        ...<br><br>;The following is in the NVEM0 segment, which must be located<br>;after all executable program lines (i.e. at the end of the program)<br><br>        <a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/directives\/nvem0-directive-d15\/\">NVEM0<\/a>           ;Demarcation between program space and <a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/glossary-of-terms\/#o2970\">NVEM<\/a> page 0 space<br><br>ModBus_CCB:     \t   ;Communications Control Block for ModBus master<br>        <a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/directives\/nvem0-directive-d15\/\">NV0Byte<\/a>         2       ;<a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/communication-control-block-elements\/protocol\/\">Protocol<\/a> = ModBus RTU Master<br>        NV0Byte         0       ;<a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/communication-control-block-elements\/device-address\/\">Device address<\/a> (N\/A)<br>        NV0Byte         0       ;<a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/communication-control-block-elements\/character-profile\/\">Character profile<\/a> (8,N,1) *Must match slaves!*<br>        NV0Byte         7       ;<a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/communication-control-block-elements\/baud-rate\/\">Baudrate<\/a> = 38400 *Must match slaves!*<br>        NV0Byte         255     ;Not used<br>        NV0Byte         255     ;Not used<br>        NV0Byte         255     ;Not used<br>        NV0Byte         255     ;Not used<br>        NV0Byte         255     ;Not used<br>        NV0Byte         5       ;<a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/communication-control-block-elements\/message-gap-x10ms\/\">Message gap<\/a> x 10mS<br>        NV0Byte         15      ;<a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/communication-control-block-elements\/query-timeout-x10ms\/\">Query timeout<\/a> x 10mS<br>        NV0Byte         3       ;<a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/communication-control-block-elements\/query-attempts\/\">Query attempts<\/a> before failure<br>        NV0Byte         255     ;Not used<br>        NV0Byte         255     ;Not used<br>        NV0Byte         255     ;Not used<br>        NV0Byte         255     ;Not used<br>        NV0Byte         255     ;Not used<br>        NV0Byte         255     ;Not used<br>        NV0Byte         255     ;Not used<br>        NV0Byte         255     ;Not used<br><\/pre>\n\n\n\n<p>We mentioned earlier that in the first 10 seconds after a reset, the controller is locked in SPLatLink protocol (as used by SPLat\/PC) by a startup timer. The instruction&nbsp;<code><a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/communications-instructions\/default-serial-port\/comteststarttimer-d17\/\">ComTestStartTimer<\/a><\/code>&nbsp;will test if that startup timer is running, and return a True result in&nbsp;<a href=\"https:\/\/www.splatco.com\/skb\/352.htm#o3808\">X<\/a>&nbsp;if it is. You can then branch your program using a&nbsp;<code><a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/fasttrack-instructions\/goift-llll\/\">GoIfT<\/a><\/code>&nbsp;or&nbsp;<code><a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/fasttrack-instructions\/goiff-llll\/\">GoIfF<\/a><\/code>.<\/p>\n\n\n\n<p>If you ignore the startup timer and just do a&nbsp;<code>ComSetCCB<\/code>, the whole processor will stall (block) until the timer expires. You might write a splash screen (startup message) to the LCD before starting the delay. You could also do anything that is required to &#8220;make safe&#8221; your machine, and also initialize any values that will be transmitted over the protocol once it starts running.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Since this was written we have introduced Hash commands. The&nbsp;Open_Serial&nbsp;hash command make this much simpler to do, so 99% of the time you won;t need&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":3327,"menu_order":1,"template":"","class_list":["post-3332","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>Protocols: Communications Control Blocks (CCB) - 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=\"Protocols: Communications Control Blocks (CCB) - SPLat Controls\" \/>\n<meta property=\"og:description\" content=\"Since this was written we have introduced Hash commands. The&nbsp;Open_Serial&nbsp;hash command make this much simpler to do, so 99% of the time you won;t need...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/serial-communications\/serial-communications-protocol-selection\/protocols-communications-control-blocks-ccb\/\" \/>\n<meta property=\"og:site_name\" content=\"SPLat Controls\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-10T09:27:49+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\/serial-communications\/serial-communications-protocol-selection\/protocols-communications-control-blocks-ccb\/\",\"url\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/serial-communications\/serial-communications-protocol-selection\/protocols-communications-control-blocks-ccb\/\",\"name\":\"Protocols: Communications Control Blocks (CCB) - SPLat Controls\",\"isPartOf\":{\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/#website\"},\"datePublished\":\"2025-04-18T05:03:06+00:00\",\"dateModified\":\"2025-06-10T09:27:49+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/serial-communications\/serial-communications-protocol-selection\/protocols-communications-control-blocks-ccb\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/serial-communications\/serial-communications-protocol-selection\/protocols-communications-control-blocks-ccb\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/serial-communications\/serial-communications-protocol-selection\/protocols-communications-control-blocks-ccb\/#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\":\"Serial communications: protocol selection\",\"item\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/serial-communications\/serial-communications-protocol-selection\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"Protocols: Communications Control Blocks (CCB)\"}]},{\"@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":"Protocols: Communications Control Blocks (CCB) - 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":"Protocols: Communications Control Blocks (CCB) - SPLat Controls","og_description":"Since this was written we have introduced Hash commands. The&nbsp;Open_Serial&nbsp;hash command make this much simpler to do, so 99% of the time you won;t need...","og_url":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/serial-communications\/serial-communications-protocol-selection\/protocols-communications-control-blocks-ccb\/","og_site_name":"SPLat Controls","article_modified_time":"2025-06-10T09:27:49+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\/serial-communications\/serial-communications-protocol-selection\/protocols-communications-control-blocks-ccb\/","url":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/serial-communications\/serial-communications-protocol-selection\/protocols-communications-control-blocks-ccb\/","name":"Protocols: Communications Control Blocks (CCB) - SPLat Controls","isPartOf":{"@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/#website"},"datePublished":"2025-04-18T05:03:06+00:00","dateModified":"2025-06-10T09:27:49+00:00","breadcrumb":{"@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/serial-communications\/serial-communications-protocol-selection\/protocols-communications-control-blocks-ccb\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/serial-communications\/serial-communications-protocol-selection\/protocols-communications-control-blocks-ccb\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/serial-communications\/serial-communications-protocol-selection\/protocols-communications-control-blocks-ccb\/#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":"Serial communications: protocol selection","item":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/serial-communications\/serial-communications-protocol-selection\/"},{"@type":"ListItem","position":5,"name":"Protocols: Communications Control Blocks (CCB)"}]},{"@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\/3332","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\/3327"}],"wp:attachment":[{"href":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-json\/wp\/v2\/media?parent=3332"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}