{"id":2557,"date":"2025-04-16T05:35:19","date_gmt":"2025-04-16T05:35:19","guid":{"rendered":"https:\/\/webprojects.cloud\/wordpress\/splatco\/?post_type=spl_knowledgebase&#038;p=2557"},"modified":"2025-06-10T11:43:47","modified_gmt":"2025-06-10T11:43:47","slug":"modbusslave","status":"publish","type":"spl_knowledgebase","link":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/hash-commands-and-functions\/open_serial-hash-command\/modbusslave\/","title":{"rendered":"# ModBusSlave"},"content":{"rendered":"\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><th>Valid For<\/th><td>#<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><\/td><\/tr><tr><th>Applies To<\/th><td>All<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>This instruction opens a serial port for use as a MODBUS slave.<\/p>\n\n\n\n<h6 class=\"wp-block-heading\">Function Prototype<\/h6>\n\n\n\n<pre class=\"wp-block-preformatted\">#Open_Serial Port(PortNumber) ModbusSlave(<br>   BaudRate,<br>   Parity,<br>   SlaveAddress,<br>   MessageGap<br>   {,<br>      RAMUnprotectedStart,<br>      RAMUnprotectedEnd,<br>      OutputUnprotectedStart,<br>      OutputUnprotectedEnd<br>   }<br> )<br><br>\"{}\" denotes optional.<\/pre>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><th>Parameter<\/th><th>Option<\/th><th>Description<\/th><\/tr><tr><th>BaudRate<\/th><td>mandatory<\/td><td>The baudrate to be used. Legal values are 300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 76800, 115200, (230400, 460800)*<\/td><\/tr><tr><th>Parity<\/th><td>mandatory<\/td><td>May be either:n = noneo = odde = even<\/td><\/tr><tr><th>SlaveAddress<\/th><td>mandatory<\/td><td>The ModBus slave address of the SPLat controller. Legal values are 1 through 247.\u00a0 May be changed later via\u00a0<a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/communications-instructions\/modbus-instructions\/comdevaddr-d17\/\">ComDevAddr<\/a>.<\/td><\/tr><tr><th>MessageGap<\/th><td>mandatory<\/td><td>See description\u00a0<a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/communication-control-block-elements\/message-gap-x10ms\/\">here<\/a>. Set to 0 for the default.<\/td><\/tr><tr><th>RAMUnprotectedStart<\/th><td>optional<\/td><td>Starting RAM address where master writes are permitted.&nbsp; Any attempt by the master to write before this address will be denied.&nbsp; Default is 255.<\/td><\/tr><tr><th>RAMUnprotectedEnd<\/th><td>optional<\/td><td>Ending RAM address where master writes are permitted.&nbsp; Any attempt by the master to write after this address will be denied. Default is 255.<\/td><\/tr><tr><th>OutputUnprotectedStart<\/th><td>optional<\/td><td>Starting output number where master writes are permitted.&nbsp; Any attempt by the master to write before this address will be denied.&nbsp; Default is 255.<\/td><\/tr><tr><th>OutputUnprotectedEnd<\/th><td>optional<\/td><td>Ending output number where master writes are permitted.&nbsp; Any attempt by the master to write after this address will be denied. Default is 255.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h6 class=\"wp-block-heading\">Description<\/h6>\n\n\n\n<p>This hash function sets the serial port up for use with the ModBusRTU slave. Once initiated and configured, the SPLat controller\u00a0<a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/glossary-of-terms\/#o370\">Firmware<\/a>\u00a0takes care of all the low level communications activity.\u00a0<a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/serial-communications\/modbus\/\">ModBus documentation<\/a>.<\/p>\n\n\n\n<p>You should set these to match the device you are communicating with.<\/p>\n\n\n\n<p><strong>Port()<\/strong>&nbsp;is only available on SPLat 32 bit controllers (black boards).<\/p>\n\n\n\n<p>Note that 32-bit controllers allow use of Modbus on multiple ports.&nbsp; It has been successfully tried with Master mode on one port and Slave mode on another.<\/p>\n\n\n\n<p>*The&nbsp;<strong>(high speed baud rates)<\/strong>&nbsp;are only available on SPLat 32 bit controllers (black boards).<\/p>\n\n\n\n<h6 class=\"wp-block-heading\">Unprotected Area<\/h6>\n\n\n\n<p>RAM and Output write protection is only available on SPLat 32 bit controllers.&nbsp; It provides a mechanism of ensuring a Modbus Master cannot write to RAM or Outputs that the slave wishes to protect.&nbsp; Both RAM and Output protection follow these conditions:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Start &amp; End = 255.<br>All writes are denied.&nbsp; This is the default.<\/li>\n\n\n\n<li>Start &amp; End = 0.<br>All writes are permiteed.&nbsp; Be careful!<\/li>\n\n\n\n<li>All other values mark the start and end, inclusive.&nbsp; So if start =100 and end = 115, then 100, 101, &#8230;, 114 &amp; 115 are all permitted.<\/li>\n<\/ul>\n\n\n\n<p>If any part of a Modbus Master WriteMultipleCoils or WriteMultipleRegisters command lies within the protected area, then the whole command will be rejected.<\/p>\n\n\n\n<h6 class=\"wp-block-heading\">Examples<\/h6>\n\n\n\n<pre class=\"wp-block-preformatted\"><br>COM0              EQU   252                           ;the TTL serial port<br><br>   #Open_Serial   Port( COM0 ) ModbusSlave( 38400, n, 10, 0, 0, 255, 255, 255 )<br><\/pre>\n\n\n\n<p>Use COM0 as a MODBUS Slave port, permit write to all RAM, block writes to all outputs.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Valid For #Open_Serial Applies To All This instruction opens a serial port for use as a MODBUS slave. Function Prototype #Open_Serial Port(PortNumber) ModbusSlave( BaudRate, Parity,&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":2555,"menu_order":1,"template":"","class_list":["post-2557","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># ModBusSlave - 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=\"# ModBusSlave - SPLat Controls\" \/>\n<meta property=\"og:description\" content=\"Valid For #Open_Serial Applies To All This instruction opens a serial port for use as a MODBUS slave. Function Prototype #Open_Serial Port(PortNumber) ModbusSlave( BaudRate, Parity,...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/hash-commands-and-functions\/open_serial-hash-command\/modbusslave\/\" \/>\n<meta property=\"og:site_name\" content=\"SPLat Controls\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-10T11:43:47+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=\"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\/programming-reference\/instructions-arranged-by-function\/hash-commands-and-functions\/open_serial-hash-command\/modbusslave\/\",\"url\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/hash-commands-and-functions\/open_serial-hash-command\/modbusslave\/\",\"name\":\"# ModBusSlave - SPLat Controls\",\"isPartOf\":{\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/#website\"},\"datePublished\":\"2025-04-16T05:35:19+00:00\",\"dateModified\":\"2025-06-10T11:43:47+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/hash-commands-and-functions\/open_serial-hash-command\/modbusslave\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/hash-commands-and-functions\/open_serial-hash-command\/modbusslave\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/hash-commands-and-functions\/open_serial-hash-command\/modbusslave\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Programming reference\",\"item\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Instructions arranged by function\",\"item\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"# Hash commands and functions\",\"item\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/hash-commands-and-functions\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"# Open_Serial hash command\",\"item\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/hash-commands-and-functions\/open_serial-hash-command\/\"},{\"@type\":\"ListItem\",\"position\":6,\"name\":\"# ModBusSlave\"}]},{\"@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":"# ModBusSlave - 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":"# ModBusSlave - SPLat Controls","og_description":"Valid For #Open_Serial Applies To All This instruction opens a serial port for use as a MODBUS slave. Function Prototype #Open_Serial Port(PortNumber) ModbusSlave( BaudRate, Parity,...","og_url":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/hash-commands-and-functions\/open_serial-hash-command\/modbusslave\/","og_site_name":"SPLat Controls","article_modified_time":"2025-06-10T11:43:47+00:00","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\/programming-reference\/instructions-arranged-by-function\/hash-commands-and-functions\/open_serial-hash-command\/modbusslave\/","url":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/hash-commands-and-functions\/open_serial-hash-command\/modbusslave\/","name":"# ModBusSlave - SPLat Controls","isPartOf":{"@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/#website"},"datePublished":"2025-04-16T05:35:19+00:00","dateModified":"2025-06-10T11:43:47+00:00","breadcrumb":{"@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/hash-commands-and-functions\/open_serial-hash-command\/modbusslave\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/hash-commands-and-functions\/open_serial-hash-command\/modbusslave\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/hash-commands-and-functions\/open_serial-hash-command\/modbusslave\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webprojects.cloud\/wordpress\/splatco\/"},{"@type":"ListItem","position":2,"name":"Programming reference","item":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/"},{"@type":"ListItem","position":3,"name":"Instructions arranged by function","item":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/"},{"@type":"ListItem","position":4,"name":"# Hash commands and functions","item":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/hash-commands-and-functions\/"},{"@type":"ListItem","position":5,"name":"# Open_Serial hash command","item":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/hash-commands-and-functions\/open_serial-hash-command\/"},{"@type":"ListItem","position":6,"name":"# ModBusSlave"}]},{"@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\/2557","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\/2555"}],"wp:attachment":[{"href":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-json\/wp\/v2\/media?parent=2557"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}