MDrive Ethernet
MCode/TCP, EtherNet/IP & MODBUS/TCP
- Introduction
- Protocol Comparison
- MCode/TCP
- EtherNet/IP
- MODBUS/TCP
Introduction
Ethernet is a frame based, standardized
networking system used for
Local Area Networks. The ease of
connectivity and use, reliability and
minimal signal degradation over
long distance has made it an ideal
networking standard for a number of
industrial protocols.
A major benefit of using Ethernet in motion control systems is the standardized IP addressing system, which allows for up to 255 devices on a network, while eliminating the complicated wiring and software configuration of traditional multi-drop systems using RS-422/485.
Ethernet overview
- Developed in 1970 by Xerox Corporation.
- Standardized into IEEE 802.3 in 1983.
- If you are on a network, there is a 90% chance it is Ethernet.
- If you are installing a new network, there is a 98% chance it is Ethernet.
Key advantages
- Standard RJ45 connector and CAT5/6 cabling.
- Isolated communication.
- Minimal signal degradation over long distance.
- Designed for networking.
- All error checking handled by the system (no check-summing)
Protocols
The new MDrive Motion Control Ethernet products support three control methods in a two packages:
- MCode/TCP — Schneider Electric Motion USA's proprietary programming language for MDrive Motion Control products, adapted to utilize TCP/IP message formatting. MCode/TCP is standard on both EtherNet/IP and MODBUS/TCP Mdrive products.
- EtherNet/IP — A standard industrial protocol allowing interface with other devices commonly supporting this protocol. Devices include PLCs, PACs and host HMIs by manufacturers such as Rockwell Automation, Schneider Electric and Omron. EtherNet/IP is used in 30% of industrial networks.
- MODBUS/TCP — A standard open industrial convention supported by a variety of machine components such as programmable controllers, drives and controls, I/O modules and switches. MODBUS/TCP is utilized in 22% of industrial networks.
Comparison: MCode/TCP. EtherNet/IP and MODBUS/TCP
The three control methods operate differently and are accessed separately: Note that EtherNet/IP and MODBUS/TCP are available as separate devices. Both have MCode/TCP availability on port 503.
- MCode/TCP — example 192.168.33.4:503
- EtherNet/IP — example 192.168.33.4:XXXX (port number assigned by controller software).
- MODBUS/TCP — example 192.168.33.4:502
Function |
MCode/TCP |
EtherNet/IP | MODBUS/TCP |
Networking model |
Programmable node |
Server (client-server network) | Server (client-server network) |
Port number |
503 |
Assigned by controller software. | 502 |
Command format |
1 and 2 char. mnemonics |
Standard CIP object model | 6 standard function codes, |
Programmable |
Yes |
No | No, but may execute MCode/TCP programs in operation immediate |
Communication modes |
Streaming commands and program modes |
Streaming commands only | Streaming commands only |
Complexity |
Simple 1 and 2 character mnemonics |
Standard objects and attributes | Complex hexadecimal addressing and parameter formatting |
Compatibility with programs from RS-422/485 MDrive products |
Compatible with non-party mode programs |
None | None |
Recommended use |
Use in systems where multiple devices using the same protocol aren’t required |
Use in systems unified by the EtherNet/IP industrial protocol | Use in systems unified by the MODBUS protocol |
Table 1: MCode/TCP. EtherNet/IP and MODBUS/TCP compared
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 with Ethernet will automatically be in MCode/TCP mode. In this mode the device is fully programmable and will operate identically 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:503.
The key advantages of MCode/TCP:
- Ease of connection using commonly available RJ45 connectors and CAT5/6 cabling.
- Elimination of complicated party mode communication wiring and configuration.
- Higher speed, less error prone than RS-422/485.
- Ethernet has collision detection to prevent lost data errors.
EtherNet/IP
EtherNet/IP™ was introduced by Rockwell Automation in 2001. Over the last 9 years it has grown into the most widely used industrial Ethernet solution for factory automation. EtherNet/IP provides a complete set of services and messages for applications such as:
- Control
- Safety
- Synchronization
- Motion
- Data exchange
Advantages
- Common interoperability with Rockwell/Allen-Bradley control systems.
- Ready availability of devices (I/O modules, controllers, drives, gateways etc;)
- Use of off-the-shelf Ethernet hardware such as routers, switches, cabling)
- Ease of system integration using the CIP (Common Industrial Protocol)
- EtherNet/IP™ is a standard. The group managing EIP, the Open DeviceNet Vendors Association (ODVA) ensures a consistent, comprehensive standard that applies to all EtherNet/IP™ vendors and products.
Basic functional overview
EtherNet/IP™, like other CIP networks, follows the Open Systems Interconnection (OSI) model. The OSI model defines a standardized framework for implementing networking. A typical EtherNet/IP™ network is shown in Figure 1.

Figure 1: Typical Ethernet/IP™ network
Messages
EtherNet/IP™ uses two types of message connections, Explicit and Implicit.
- Explicit connections enable request-response transactions between two nodes which are general purpose in in nature. Explicit connections use TCP/IP services to transfer messages across Ethernet. Explicit messages are asynchronous and are sent as needed.
- Implicit (I/O data) connections facilitate the movement of application specific messages at regular intervals. Implicit connections usually use a one-to-many relationship to make full use of multicast messaging over UDP/IP. Implicit messages must be configured to define the data transferred.
Device classes
EtherNet/IP™ uses three device classes to define the function of the device based upon network communications capability. These classes are defined as: Message Class, Adapter Class and Scanner Class.
- Message Class devices support explicit messages that are sent or received by all other classes of devices. While they may be the target or originator of explicit message requests, the cannot send or receive real-time I/O data. Message Class devices include:
- PC interface cards used to up/download programs to PLCs or Host HMI products
- Software applications not requiring real time I/O data
- Network configuration and diagnostic tools
- Adapter Class devices are the target or real-time I/O data requests from scanner class devices, as well as explicit messaging requests from all other classes of device. Adapter Class products include:
- Drives and modules that send/receive I/O data at the request of PLCs and other controllers
- Drives and modules that send/receive explicit messages to and from Message and Adapter class devices
- HMI devices that send/receive explicit or implicit messages to/from PLCs
- Scanner Class devices are the originator of I/O data connection requests to Adapter Class and other Scanner Class devices. Devices include:
- PLCs and controllers that send/receive I/O data at the request of PLCs, Host HMIs and other controllers
- PLCs that send/receive explicit messages to and from other PLCs
- PC interface cards or software used for PC-based control
Object Model
EtherNet/IP™ uses standard CIP objects. An object class represents a grouping of related attributes. There are three classes of objects:
- Required objects: These objects are required by the CIP specification in every EtherNet/IP™ device. These are:
- Identity object: contains attributes which includes information such as Vendor ID, Date of Manufacture, Serial number and etc.
- TCP or Router object: contains routing information for messaging such as the IP address, gateway, subnet mask.
- Ethernet link or network object: hold the physical connection data such as the MAC-ID, interface speed, etc.
- Application objects which contain data specific to the device itself.
- Vendor specific objects which contain attributes specific to the features and functionality unique to the device such as configuration data, control commands, register data and etc.
EtherNet/IP™ is a standardized, certifiable protocol with a massive industry presence. Implementing EtherNet/IP™ into new network designs is not without it’s challenges, as implementation requires skill and training in both the IT and Automation fields. In the end though, the advantages, savings, and system interoperability and reliability may be worth the transition.
MODBUS/TCP (Port 502)
MODBUS is a communication interface developed in 1979 by PLC manufacturer Modicon, Inc. (now a brand of Schneider Electric). MODBUS is designed for multidrop networks based on a client-server architecture.
The availability of devices using MODBUS has made it a de facto standard for industrial communication networks. MODBUS was originally developed for use with serial communication interfaces such as RS-232 and RS-485. MODBUS communication 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 with Ethernet 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 — MCode/TCP relationship
MODBUS uses a Protocol Data Unit (PDU) embedded in the message frame to send commands to an MDrive.
The PDU consists of two parts:
- Function code — identifies the function the command performs (see Table 2).
- Data — the command and parameter setting. Each command maps to a standard MCode mnemonic using a hexadecimal address. (see Figure 2).
MODBUS/TCP communications are in Big Endian form (Most Significant Byte first [MSB]).
Figure 2: MODBUS Protocol Data Unit (PDU)
Supported function codes
Standard MODBUS function codes for reading/writing I/O points and registers are supported by the MDrive Motion Control Ethernet products.
Two manufacturer specific function codes provide support for commands whose parameters consist of variable data lengths.
Function code |
Description |
|
dec |
hex |
|
Device ID |
||
43/14 |
0x2B/0x0E |
Read device identification |
Public |
||
02 |
0x02 |
Read digital inputs |
01 |
0x01 |
Read coils (digital outputs) |
05 |
0x05 |
Write single coil (digital output) |
03 |
0x03 |
Read holding register |
16 |
0x10 |
Write multiple registers |
Manufacturer specific |
||
65 |
0x41 |
Read I/O and trip configuration and parameters |
66 |
0x42 |
Write I/O and trip configuration and parameters, enter upgrade mode |
Table 2: Supported function codes
Conclusion
The MDrive Motion Control Ethernet products provide the speed, ease of use and reliability of Ethernet networking, while giving the system integrator the power of three protocols, MCode/TCP to access the power, programmability and rich feature set of the MDrive Motion Control family, EtherNet/IP to network with popular PLC's, PACs and motion controllers and MDODBUS/TCP to interoperate with other MODBUS system components.
i