Application Notes

Modbus/TCP vs MCode/TCP Overview

Home > Resources > Application Notes > Modbus/TCP vs MCode/TCP Overview

Description

This Application Note: covers the basic functions and capabilities of the MDrive communicating over Ethernet.

Applicable

  • MDrive Linear Actuator
  • MDrive Plus

Requirements

Details

  1. MODBUS/TCP (Connect to port 502)
    MODBUS/TCP is a standard protocol designed for multidrop networks based on a client-server architecture communicating over TCP/IP.
  2. MCode/TCP (Connect to port 503)
    MCode/TCP is a protocol based upon the MDrive programming language using 1 and two character mnemonics.

Depending 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.

When 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.

Comparison

FunctionMODBUS/TCPMCode/TCP
Networking modelServer (Client-Server network)Programmable node
Port502503
Command format6 standard function codes, 2 mfg specific function codesStandard MCode mnemonics
ProgrammableNoYes – Standard MCode program format
Communication modesImmediate mode functions onlyImmediate and program mode
ComplexityComplexSimple 1 and 2 character mnemonics
Compatibility with programs from RS-422/485 MDrive productsNoneFully compatible with non-party mode programs.
Recommended useUse in systems unified by the MODBUS protocol.Use in systems where multiple device types communicating using the same protocol isn’t required.

MCode/TCP (Port 503)

MCode 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.

When 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.

The key advantages of MCode/TCP:

  • Ease of connection using commonly available RJ-45 connectors and CAT 5 cabling.
  • Elimination of complicated party mode communication wiring and configuration.
  • Higher speed, less error prone than RS-422/485.

MODBUS/TCP (Port 502)

MODBUS 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.

The 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

When 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.

MODBUS/TCP message format

Protocol Data Unit (PDU)

The 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))

Supported function codes

dechexfunction
Device ID
43/140x2B/0x0ERead device identification
Public Function Codes
010x01Read coils (digital outputs)
020x02Read digital inputs
050x05Write single coil (digital output)
030x03Read holding register
160x10Write multiple registers
Manufacturer Specific Function Codes
650x41Read I/O and trip configuration and parameters
660x42Write I/O and trip configuration and parameters, enter upgrade mode.

MODBUS/TCP resources

When it comes to your form, fit and function requirements, don’t settle. Get precisely what you need working with us. We know motion.

Contact us with any questions about how we can help you with your motion application or for assistance with your IMS products.

Browse our resource section and find the most useful tools and documents for all our products.