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

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 – Standard MCode program format
Communication modes Immediate mode functions only Immediate and program mode
Complexity Complex Simple 1 and 2 character mnemonics
Compatibility with programs from RS-422/485 MDrive products None Fully compatible with non-party mode programs.
Recommended use Use 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

dec hex function
Device ID
43/14 0x2B/0x0E Read device identification
Public Function Codes
01 0x01 Read coils (digital outputs)
02 0x02 Read digital inputs
05 0x05 Write single coil (digital output)
03 0x03 Read holding register
16 0x10 Write multiple registers
Manufacturer Specific Function Codes
65 0x41 Read I/O and trip configuration and parameters
66 0x42 Write I/O and trip configuration and parameters, enter upgrade mode.

MODBUS/TCP resources

 

Lexium MDrive Setup

  1. Locate the Lexium MDrive Software Suite for download at the below link: https://motion.schneider-electric.com/lmd/lexium-mdrive-software.php
  2. Once installed on your PC, open the Lexium MDrive Software Suite and select “Install Lexium MDrive Ethernet Interface”. This will install the TCP/IP utility within the Lexium MDrive Software Suite for use.
  3. After installing this utility, a green check mark will be placed by the new command button that states “Launch Lexium MDrive Ethernet Interface”. Select the command button with a single mouse-click. You should now see the Ethernet Interface software utility launch.
  4. Select “Refresh” in the upper left hand corner of the screen to insure your “Adapter (NIC)” list is current with your PC settings:
    Ethernet Configuration Utility
    Figure 1: Refresh adapter list
  5. After selecting the proper “Adapter (NIC)” IP address that your PC is set up to communicate with the Lexium MDrive in the drop down box provided, choose the “Select” button to the right of “Refresh” to solidify the selection. You should see a similar recognition as the image below:
    Ethernet Configuration Utility
    Figure 2: Select Adapter (NIC) IP
  6. We now need to physically connect to the motor to insure the application protocol over Ethernet is set for Modbus TCP/IP. To do this, locate the “Connection” area in the upper right hand side of the TCP/IP utility and enter your IP address in the “Connection” box. For a first time Lexium MDrive user, all of our drives come from the factory with an IP address of 192.168.33.1. Once the IP address has been entered, choose “Connect” to the right of the “Connection” box where you entered the device IP address. You should have a similar screen as shown in Figure 3 below:
    Ethernet Configuration Utility
    Figure 3: Select Lexium MDrive IP address
  7. If you are successfully connected to the LMD device you will also see confirmation in the center of the TCP/IP utility at the bottom of the screen. Figure 4 below shows a successful connection between (NIC) 192.168.33.100 and LMD device 192.168.33.1:
    Ethernet Configuration Utility
    Figure 4: Successful connection to the Lexium product
  8. We now are able to read and write values for the connected device to configure it properly in your network. For this example we are going to keep the default IP address of 192.168.33.1 and insure the Ethernet Application Protocol is set to Modbus TCP/IP. By selecting “Read All” in the center of the TCP/IP utility, you can see what has been set in the device you are working with:
    Ethernet Configuration Utility
    Figure 5: Select the Modbus/TCP application protocol
  9. In this case, the motor has already been set to “Modbus/TCP” in the Application Protocol section, and the device IP address has been set to 192.168.33.1. If you wished to make changes, you simply would edit the proper fields, select “Write” (or “Set” for the Application Protocol), and then cycle power to the drive so the updated information can take effect in the device.
  10. Once you have your IP settings and Application Protocol selected, you now can proceed to the Proface GP-Pro EX software to set up your HMI to talk to the LMD device.

HMI Setup

  1. Open EasyBuilder 5000 Software and create a “New” project. Once prompted, select the proper model of HMI you are using. For this application we are using the HMI5070TH display:
    Maple Systems HMI EasyBuilder
    Figure 5: EasyBuilder 5000 setup dialog

    Once this selection has been made, EasyBuilder 5000 will open up to the “System Parameters” utility that will allow you to create, select, and edit different devices for communication with the HMI.

  2. In the “System Parameters” section of EasyBuilder 5000, select the “New” button in order to create a new device for the HMI to communicate with:
    Maple Systems HMI EasyBuilder
    Figure 6: Create new device
  3. The “Device Properties” box will now be active, within this utility you will setup the properties for the Lexium MDrive you are communicating with.
    1. First give the Device a name. In this example we are naming the device “Lexium MDrive”
    2. Insure you have selected “PLC” as the Device type, and given it a “Local” location
    3. Set the PLC Type to “Modbus TCP/IP Master”
    4. Set PLC I/F to “Ethernet”
    5. Select the “IP” settings tab and configure the IP address for the device. In this example we are using the Lexium MDrive default IP address of 192.168.33.1
    6. All other default settings in the Device Properties utility work fine for this example, a sample image of these settings is below:
      Maple Systems HMI EasyBuilder
      Figure 7: Lexium MDrive Device Properies
  4. Once these communication settings are set, you then can begin to build your project as you see fit. The only other critical piece of information to realize when working with the Maple Systems device is that the register mapping starts at a value of “1” and we (Schneider Electric Motion) start at a value of “0”. Because of this, when working with our Modbus register map, you just need to add a value of 1 to any starting address for the register you want to access. For example, our slewing command, SL, has an address of 120 in our map. For the Maple Systems device you would want to select the starting address to be 121. See the example of this below for a “Numeric Input” device allowing the user to enter a Slew speed:
    Maple Systems HMI EasyBuilder
    Figure 8: Configuring an input object

Note about Modbus registers

Also worth noting from the example above, our Modbus registers are “holding” registers and are denoted by the “4x” address type in the Maple Interface software. Our registers can be 1, 2, or 4 bytes in length. If I am reading or writing a value for run current for example, you would want to select the “16-bit Unsigned” Data format for the information to be read back or set (RC can only be a value between 1-100 in terms of percentage). If I were looking to input a slewing velocity, or read a position register, it will be much longer so the “32-bit Signed” Data format would need to be selected. If it is a longer value than it is a double word and the address type should be 4x_Double as opposed to 4x. See the numeric format for the slewing example below:

Maple Systems HMI EasyBuilder
Figure 9: Define input object numeric properties

Lexium MDrive Setup

  1. Locate the Lexium MDrive Software Suite for download at the below link: https://motion.schneider-electric.com/lmd/lexium-mdrive-software.php
  2. Once installed on your PC, open the Lexium MDrive Software Suite and select “Install Lexium MDrive Ethernet Interface”. This will install the TCP/IP utility within the Lexium MDrive Software Suite for use.
  3. After installing this utility, a green check mark will be placed by the new command button that states “Launch Lexium MDrive Ethernet Interface”. Select the command button with a single mouse-click. You should now see the Ethernet Interface software utility launch.
  4. Select “Refresh” in the upper left hand corner of the screen to insure your “Adapter (NIC)” list is current with your PC settings:
    Ethernet Configuration Utility
    Figure 1: Refresh adapter list
  5. After selecting the proper “Adapter (NIC)” IP address that your PC is set up to communicate with the Lexium MDrive in the drop down box provided, choose the “Select” button to the right of “Refresh” to solidify the selection. You should see a similar recognition as the image below:
    Ethernet Configuration Utility
    Figure 2: Select Adapter (NIC) IP
  6. We now need to physically connect to the motor to insure the application protocol over Ethernet is set for Modbus TCP/IP. To do this, locate the “Connection” area in the upper right hand side of the TCP/IP utility and enter your IP address in the “Connection” box. For a first time Lexium MDrive user, all of our drives come from the factory with an IP address of 192.168.33.1. Once the IP address has been entered, choose “Connect” to the right of the “Connection” box where you entered the device IP address. You should have a similar screen as shown in Figure 3 below:
    Ethernet Configuration Utility
    Figure 3: Select Lexium MDrive IP address
  7. If you are successfully connected to the LMD device you will also see confirmation in the center of the TCP/IP utility at the bottom of the screen. Figure 4 below shows a successful connection between (NIC) 192.168.33.100 and LMD device 192.168.33.1:
    Ethernet Configuration Utility
    Figure 4: Successful connection to the Lexium product
  8. We now are able to read and write values for the connected device to configure it properly in your network. For this example we are going to keep the default IP address of 192.168.33.1 and insure the Ethernet Application Protocol is set to Modbus TCP/IP. By selecting “Read All” in the center of the TCP/IP utility, you can see what has been set in the device you are working with:
    Ethernet Configuration Utility
    Figure 5: Select the Modbus/TCP application protocol
  9. In this case, the motor has already been set to “Modbus/TCP” in the Application Protocol section, and the device IP address has been set to 192.168.33.1. If you wished to make changes, you simply would edit the proper fields, select “Write” (or “Set” for the Application Protocol), and then cycle power to the drive so the updated information can take effect in the device.
  10. Once you have your IP settings and Application Protocol selected, you now can proceed to the Proface GP-Pro EX software to set up your HMI to talk to the LMD device.

HMI Setup

  1. In the “Device/PLC” section of the GP-Pro EX software you need to select the “Schneider Electric-SA” Modbus TCP Master Driver from the pull down list. This is the common Modbus TCP driver created by Pro-face and works for many Modbus based devices, not just Schneider products. See Figure 6 below:
    Proface HMI GP-Pro EX
    Figure 6: Select Modbus/TCP driver
  2. Insure that after selecting the proper Device Driver from above, you set the correct IP Address of the device you wish to talk to over Modbus. This is done right below the Device Driver selection area in the “Device/PLC” section of their project settings. In the attached project I kept the motor default IP address, which is 192.168.33.1.
    Proface HMI GP-Pro EX
    Figure 7: Set the Lexium product’s IP address
  3. Once the IP address is set, you then need to change the “word” values for the holding registers in the “Max Query” section of the “Industrial Device Settings” tab you used to set the IP address. The last two holding register values for “Holding Register (4) Read” and “Holding Register (4) Write” need to be set to “2”. See below:
    Proface HMI GP-Pro EX
    Figure 8: Configure holding register values
  4. Once these communication settings are set, you then can begin to build your project as you see fit. The only other critical piece of information to realize when working with the Pro-face device is that the Proface register mapping starts at a value of “1” and we (Schneider Electric Motion) start at a value of “0”. So when working with our Modbus register map, you just need to add a value of 1 to any starting address for the register you want to access. For example, our slewing command, SL, has an address of 120 in our map. For the Pro-face device you would want to select the starting address to be 121. An example of this can be seen below in the Proface environment:
    Proface HMI GP-Pro EX
    Figure 9: Proface GP-Pro EX project environment
  5. Finally, the last piece of advice is when selecting the proper length of the register to be read or written to. Many of our registers are going to be 32-bit decimal to accommodate for the larger values in micro stepping units but others are going to be 16-bit. This will be register value based and we can assist where needed. Here is an example below of reading back the motor position (P) over Modbus in the Proface software:
    Proface HMI GP-Pro EX
    Figure 10: Verify correct register length