{"id":1731,"date":"2017-03-08T20:20:21","date_gmt":"2017-03-08T20:20:21","guid":{"rendered":"https:\/\/novanta.com\/robotics-automation\/modbustcp-vs-mcodetcp-overview\/"},"modified":"2017-03-08T20:20:21","modified_gmt":"2017-03-08T20:20:21","slug":"modbustcp-vs-mcodetcp-overview","status":"publish","type":"page","link":"https:\/\/novanta.com\/robotics-automation\/modbustcp-vs-mcodetcp-overview\/","title":{"rendered":"Modbus\/TCP vs MCode\/TCP Overview"},"content":{"rendered":"\n\n\n<div class=\"wp-block-group alignwide is-layout-flow wp-block-group-is-layout-flow\" style=\"margin-top:var(--wp--preset--spacing--40);margin-bottom:var(--wp--preset--spacing--40)\">\n\t<ol class=\"wp-block-list\"><li><strong>MODBUS\/TCP (Connect to port 502)<\/strong>\r\nMODBUS\/TCP is a standard protocol designed for multidrop networks based on a client-server architecture communicating over TCP\/IP.<\/li><li><strong>MCode\/TCP (Connect to port 503)<\/strong>\r\nMCode\/TCP is a protocol based upon the MDrive programming language using 1 and two character mnemonics.<\/li><\/ol>\n\n\r\nDepending on the port selected (ip.address:502 or ip.address:503) the device operation will differ significantly. When connected to port 502 the device will respond to standard MODBUS\/TCP function code formats. Commands will map to register addresses and follow the MODBUS\/TCP message format. Most importantly, MODBUS\/TCP follows a client-server networking model. The device is able to receive commands in immediate mode only.\r\n\r\nWhen connected to port 503, the device will operate like the RS-422\/485 products with the exception that party mode commands and features are disabled, as multi-drop communications are addressed via IP.\r\n\n<h3 class=\"wp-block-heading\">Comparison<\/h3>\n\n\r\n\n<figure class=\"wp-block-table\"><table>\r\n<tbody>\r\n<tr>\r\n<th>Function<\/th>\r\n<td><strong>MODBUS\/TCP<\/strong><\/td>\r\n<td><strong>MCode\/TCP<\/strong><\/td>\r\n<\/tr>\r\n<tr>\r\n<td>Networking model<\/td>\r\n<td>Server (Client-Server network)<\/td>\r\n<td>Programmable node<\/td>\r\n<\/tr>\r\n<tr>\r\n<td>Port<\/td>\r\n<td>502<\/td>\r\n<td>503<\/td>\r\n<\/tr>\r\n<tr>\r\n<td>Command format<\/td>\r\n<td>6 standard function codes, 2 mfg specific function codes<\/td>\r\n<td>Standard MCode mnemonics<\/td>\r\n<\/tr>\r\n<tr>\r\n<td>Programmable<\/td>\r\n<td>No<\/td>\r\n<td>Yes &#8211; Standard MCode program format<\/td>\r\n<\/tr>\r\n<tr>\r\n<td>Communication modes<\/td>\r\n<td>Immediate mode functions only<\/td>\r\n<td>Immediate and program mode<\/td>\r\n<\/tr>\r\n<tr>\r\n<td>Complexity<\/td>\r\n<td>Complex<\/td>\r\n<td>Simple 1 and 2 character mnemonics<\/td>\r\n<\/tr>\r\n<tr>\r\n<td>Compatibility with programs from RS-422\/485 MDrive products<\/td>\r\n<td>None<\/td>\r\n<td>Fully compatible with non-party mode programs.<\/td>\r\n<\/tr>\r\n<tr>\r\n<td>Recommended use<\/td>\r\n<td>Use in systems unified by the MODBUS protocol.<\/td>\r\n<td>Use in systems where multiple device types communicating using the same protocol isn&#8217;t required.<\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table><\/figure>\n\n\r\n\n<h3 class=\"wp-block-heading\">MCode\/TCP (Port 503)<\/h3>\n\n\r\nMCode is the programming and control language utilized by MDrive Motion Control products developed to communicate over RS-422\/485. MCode\/TCP is MCode communicating over TCP\/IP. The language consists of an extensive command set made up of 1 and 2 character mnemonics.\r\n\r\nWhen connected to ip.address:503 the MDrive will automatically be in MCode\/TCP mode. In this mode the device is fully programmable and will operate identical to the RS-422\/485 products with the exception that multidrop communication is accomplished using individual IP addresses instead of party-mode names. Global commands are sent using the UDP protocol to address 255.255.255.255.\r\n\r\nThe key advantages of MCode\/TCP:\r\n\n<ul class=\"wp-block-list\"><li>Ease of connection using commonly available RJ-45 connectors and CAT 5 cabling.<\/li><li>Elimination of complicated party mode communication wiring and configuration.<\/li><li>Higher speed, less error prone than RS-422\/485.<\/li><\/ul>\n\n\r\nMODBUS\/TCP (Port 502)\r\n\r\nMODBUS is a communications interface developed in 1979 by PLC manufacturer Modicon, Inc. (now a brand of Schneider Electric). MODBUS is designed for multidrop networks based on a master-client architecture.\r\n\r\nThe availability of devices using MODBUS has made it a de facto standard for industrial communications network. Modbus was originally developed for use with serial communications interfaces such as RS-232 and RS-485, MODBUS communications over TCP\/IP has become a standard because of the ease of interface and simpler message format\r\n\r\nWhen connected to ip.address:502 the MDrive will automatically respond to MODBUS\/TCP protocol function codes only. Note that when operating the MDrive using MODBUS\/TCP it is not programmable and can only use immediate command functions.\r\n\r\nMODBUS\/TCP message format\r\n\r\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"646\" height=\"259\" src=\"https:\/\/novanta.com\/robotics-automation\/wp-content\/uploads\/sites\/3\/2026\/01\/message-format.gif\" alt=\"\" class=\"wp-image-1729\"\/><\/figure>\n\n\r\n\r\nProtocol Data Unit (PDU)\r\n\r\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"306\" height=\"164\" src=\"https:\/\/novanta.com\/robotics-automation\/wp-content\/uploads\/sites\/3\/2026\/01\/pdu.gif\" alt=\"\" class=\"wp-image-1730\"\/><\/figure>\n\nThe MDrive command information is contained in the PDU and consists of the function code. The data block will contain the address of the register which relates to an MDrive command, and the data of the command in hexadecimal format. MODBUS\/TCP communications are in Big Endian form (Most Significant Byte first (MSB))\r\n\n<h3 class=\"wp-block-heading\">Supported function codes<\/h3>\n\n\r\n\n<figure class=\"wp-block-table\"><table>\r\n<tbody>\r\n<tr>\r\n<td><strong>dec<\/strong><\/td>\r\n<td><strong>hex<\/strong><\/td>\r\n<td><strong>function<\/strong><\/td>\r\n<\/tr>\r\n<tr>\r\n<td colspan=\"3\">Device ID<\/td>\r\n<\/tr>\r\n<tr>\r\n<td>43\/14<\/td>\r\n<td>0x2B\/0x0E<\/td>\r\n<td>Read device identification<\/td>\r\n<\/tr>\r\n<tr>\r\n<td><strong>Public Function Codes<\/strong><\/td>\r\n<\/tr>\r\n<tr>\r\n<td>01<\/td>\r\n<td>0x01<\/td>\r\n<td>Read coils (digital outputs)<\/td>\r\n<\/tr>\r\n<tr>\r\n<td>02<\/td>\r\n<td>0x02<\/td>\r\n<td>Read digital inputs<\/td>\r\n<\/tr>\r\n<tr>\r\n<td>05<\/td>\r\n<td>0x05<\/td>\r\n<td>Write single coil (digital output)<\/td>\r\n<\/tr>\r\n<tr>\r\n<td>03<\/td>\r\n<td>0x03<\/td>\r\n<td>Read holding register<\/td>\r\n<\/tr>\r\n<tr>\r\n<td>16<\/td>\r\n<td>0x10<\/td>\r\n<td>Write multiple registers<\/td>\r\n<\/tr>\r\n<tr>\r\n<td colspan=\"3\"><strong>Manufacturer Specific Function Codes<\/strong><\/td>\r\n<\/tr>\r\n<tr>\r\n<td>65<\/td>\r\n<td>0x41<\/td>\r\n<td>Read I\/O and trip configuration and parameters<\/td>\r\n<\/tr>\r\n<tr>\r\n<td>66<\/td>\r\n<td>0x42<\/td>\r\n<td>Write I\/O and trip configuration and parameters, enter upgrade mode.<\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table><\/figure>\n\n\r\n\n<h4 class=\"wp-block-heading\">MODBUS\/TCP resources<\/h4>\n\n\r\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/www.modbus.org\/\">https:\/\/www.modbus.org\/<\/a><\/li><li><a href=\"https:\/\/www.modbus-ida.org\/\">https:\/\/www.modbus-ida.org<\/a><\/li><\/ul>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Comparison Function MODBUS\/TCP MCode\/TCP Networking model Server (Client-Server network) Programmable node Port 502 503 Command format 6 standard function codes, 2 mfg specific function codes Standard MCode mnemonics Programmable No Yes &#8211; Standard MCode program format Communication modes Immediate mode functions only Immediate and program mode Complexity Complex Simple 1 and 2 character mnemonics Compatibility [&hellip;]<\/p>\n","protected":false},"author":102,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"footnotes":""},"class_list":["post-1731","page","type-page","status-publish","hentry"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v28.1 (Yoast SEO v28.1) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Modbus\/TCP vs MCode\/TCP Overview - Robotics &amp; Automation<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/novanta.com\/robotics-automation\/modbustcp-vs-mcodetcp-overview\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Modbus\/TCP vs MCode\/TCP Overview\" \/>\n<meta property=\"og:description\" content=\"Comparison Function MODBUS\/TCP MCode\/TCP Networking model Server (Client-Server network) Programmable node Port 502 503 Command format 6 standard function codes, 2 mfg specific function codes Standard MCode mnemonics Programmable No Yes &#8211; Standard MCode program format Communication modes Immediate mode functions only Immediate and program mode Complexity Complex Simple 1 and 2 character mnemonics Compatibility [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/novanta.com\/robotics-automation\/modbustcp-vs-mcodetcp-overview\/\" \/>\n<meta property=\"og:site_name\" content=\"Robotics &amp; Automation\" \/>\n<meta property=\"og:image\" content=\"https:\/\/novanta.com\/robotics-automation\/wp-content\/uploads\/sites\/3\/2026\/01\/message-format.gif\" \/>\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:\\\/\\\/novanta.com\\\/robotics-automation\\\/modbustcp-vs-mcodetcp-overview\\\/\",\"url\":\"https:\\\/\\\/novanta.com\\\/robotics-automation\\\/modbustcp-vs-mcodetcp-overview\\\/\",\"name\":\"Modbus\\\/TCP vs MCode\\\/TCP Overview - Robotics &amp; Automation\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/novanta.com\\\/robotics-automation\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/novanta.com\\\/robotics-automation\\\/modbustcp-vs-mcodetcp-overview\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/novanta.com\\\/robotics-automation\\\/modbustcp-vs-mcodetcp-overview\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/novanta.com\\\/robotics-automation\\\/wp-content\\\/uploads\\\/sites\\\/3\\\/2026\\\/01\\\/message-format.gif\",\"datePublished\":\"2017-03-08T20:20:21+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/novanta.com\\\/robotics-automation\\\/modbustcp-vs-mcodetcp-overview\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/novanta.com\\\/robotics-automation\\\/modbustcp-vs-mcodetcp-overview\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/novanta.com\\\/robotics-automation\\\/modbustcp-vs-mcodetcp-overview\\\/#primaryimage\",\"url\":\"https:\\\/\\\/novanta.com\\\/robotics-automation\\\/wp-content\\\/uploads\\\/sites\\\/3\\\/2026\\\/01\\\/message-format.gif\",\"contentUrl\":\"https:\\\/\\\/novanta.com\\\/robotics-automation\\\/wp-content\\\/uploads\\\/sites\\\/3\\\/2026\\\/01\\\/message-format.gif\",\"width\":646,\"height\":259},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/novanta.com\\\/robotics-automation\\\/modbustcp-vs-mcodetcp-overview\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/novanta.com\\\/robotics-automation\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Modbus\\\/TCP vs MCode\\\/TCP Overview\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/novanta.com\\\/robotics-automation\\\/#website\",\"url\":\"https:\\\/\\\/novanta.com\\\/robotics-automation\\\/\",\"name\":\"Robotics & Automation\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/novanta.com\\\/robotics-automation\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Modbus\/TCP vs MCode\/TCP Overview - Robotics &amp; Automation","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:\/\/novanta.com\/robotics-automation\/modbustcp-vs-mcodetcp-overview\/","og_locale":"en_US","og_type":"article","og_title":"Modbus\/TCP vs MCode\/TCP Overview","og_description":"Comparison Function MODBUS\/TCP MCode\/TCP Networking model Server (Client-Server network) Programmable node Port 502 503 Command format 6 standard function codes, 2 mfg specific function codes Standard MCode mnemonics Programmable No Yes &#8211; Standard MCode program format Communication modes Immediate mode functions only Immediate and program mode Complexity Complex Simple 1 and 2 character mnemonics Compatibility [&hellip;]","og_url":"https:\/\/novanta.com\/robotics-automation\/modbustcp-vs-mcodetcp-overview\/","og_site_name":"Robotics &amp; Automation","og_image":[{"url":"https:\/\/novanta.com\/robotics-automation\/wp-content\/uploads\/sites\/3\/2026\/01\/message-format.gif","type":"","width":"","height":""}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/novanta.com\/robotics-automation\/modbustcp-vs-mcodetcp-overview\/","url":"https:\/\/novanta.com\/robotics-automation\/modbustcp-vs-mcodetcp-overview\/","name":"Modbus\/TCP vs MCode\/TCP Overview - Robotics &amp; Automation","isPartOf":{"@id":"https:\/\/novanta.com\/robotics-automation\/#website"},"primaryImageOfPage":{"@id":"https:\/\/novanta.com\/robotics-automation\/modbustcp-vs-mcodetcp-overview\/#primaryimage"},"image":{"@id":"https:\/\/novanta.com\/robotics-automation\/modbustcp-vs-mcodetcp-overview\/#primaryimage"},"thumbnailUrl":"https:\/\/novanta.com\/robotics-automation\/wp-content\/uploads\/sites\/3\/2026\/01\/message-format.gif","datePublished":"2017-03-08T20:20:21+00:00","breadcrumb":{"@id":"https:\/\/novanta.com\/robotics-automation\/modbustcp-vs-mcodetcp-overview\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/novanta.com\/robotics-automation\/modbustcp-vs-mcodetcp-overview\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/novanta.com\/robotics-automation\/modbustcp-vs-mcodetcp-overview\/#primaryimage","url":"https:\/\/novanta.com\/robotics-automation\/wp-content\/uploads\/sites\/3\/2026\/01\/message-format.gif","contentUrl":"https:\/\/novanta.com\/robotics-automation\/wp-content\/uploads\/sites\/3\/2026\/01\/message-format.gif","width":646,"height":259},{"@type":"BreadcrumbList","@id":"https:\/\/novanta.com\/robotics-automation\/modbustcp-vs-mcodetcp-overview\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/novanta.com\/robotics-automation\/"},{"@type":"ListItem","position":2,"name":"Modbus\/TCP vs MCode\/TCP Overview"}]},{"@type":"WebSite","@id":"https:\/\/novanta.com\/robotics-automation\/#website","url":"https:\/\/novanta.com\/robotics-automation\/","name":"Robotics & Automation","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/novanta.com\/robotics-automation\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/novanta.com\/robotics-automation\/wp-json\/wp\/v2\/pages\/1731","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/novanta.com\/robotics-automation\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/novanta.com\/robotics-automation\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/novanta.com\/robotics-automation\/wp-json\/wp\/v2\/users\/102"}],"replies":[{"embeddable":true,"href":"https:\/\/novanta.com\/robotics-automation\/wp-json\/wp\/v2\/comments?post=1731"}],"version-history":[{"count":0,"href":"https:\/\/novanta.com\/robotics-automation\/wp-json\/wp\/v2\/pages\/1731\/revisions"}],"wp:attachment":[{"href":"https:\/\/novanta.com\/robotics-automation\/wp-json\/wp\/v2\/media?parent=1731"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}