Setting up the Allen Bradley Micrologix 1100 & 1400 for Communications via Modbus RTU Slave

There have been many applications which I've used the very versatile AB Micrologix 1100 or 1400 and the customer wanted me to communicate to their DCS system using Modbus Slave. The AB Micrologix 1100/1400 is perfectly suited to accommodate this, as the ML 1100/1400 comes standard with two (2) communication ports which can be configured to communicate as Modbus Slave ports. I would recommend using Channel 0 (8 pin Mini Din) as the default channel for Modbus Slave because AB makes a RS-485 break out connector for this port: See image below of the AB 1763-NC01. You can utilize Channel 2 (DB9 port); however, you'll have to furnish your own cable - which isn't difficult, but using the 1763-NC01 is just a cleaner & easier option.

To configure the respective channel for Modbus communications, you'll have to open your project up in RSLogix 500. On the Project Navigation Tree (to the left of the program display), click on Channel Configuration and at the Driver pull down menu, select Modbus RTU Slave. Next, select the desired Baud Rate, Parity, Stop & Data bits which will be the setup of the host device you'll be communicating with. Next, you'll want to select your Modbus File #'s. These file #'s will reference files in your project. Refer to the image below for the Channel Configuration example:

The file numbers are as follows:

  • Coils 20
  • Contacts 21
  • Input Registers 23
  • Holding Registers 24

You can use any File numbers you wish, but it's always best to assign File numbers which are much greater than the least Filer number in your project. This will ensure that you don't have any conflicts within your project. For example, if your last assigned File number = 11 (N11 - Integer), then you'll be safe with starting your Modbus File allocations at File #20. Also, it's best to use consecutive File #'s for your Modbus File # assignments, as it just makes things easier to setup.

Now that you have your File #'s selected, move down to the pull down menu labeled Control Line and then select "No Handshaking (485 Network)". Then hit the "OK" button at the bottom. You'll notice right away that your selected File #'s are automatically built into your project. These files will correspond to the type of file that they are associated with.

  • Coils 20 = Modbus 0xxxxx
  • Contacts 21 = Modbus 1xxxx
  • Input Registers 22 = Modbus 3xxxx
  • Hold Registers 23 = Modbus 4xxxx

For the File #'s in your project, the first available bit/word in each file will equal the first available Modbus address for the type of file that you have selected.

For example:

  • N20:0/00 = Modbus Addr 00001
  • N21:0/00 = Modbus Addr 10001
  • N22:0 = Modbus Addr 30001
  • N23:0 = Modbus Addr 40001

Remember, there are no "0" bits or words in Modbus therefore you must offset the AB File # bit/word by "1" to reference the correct Modbus bit/register.

For example:

  • N20:0/14 = Modbus Addr 00015
  • N21:1/15 = Modbus Addr 00032
  • N22:5 = Modbus Addr 30006
  • N23:15 = Modbus Addr 40016

It's a bit confusing at first, but the more you work with it, the easier it gets.

Once you have your File #'s built and your protocol selected, all you must do in your program is move the data you wish to make available via Modbus into the appropriate file types that you've assigned above. For example, if you wish to move the accumulated value of C5:0 into holding register 40010, then you must build a rung with a MOV statement which will do this: See below:

If you have a lot of bits/registers to make available via Modbus, then you may need to spend considerable time building the MOV statements in your AB project to accommodate this, but it's still a very easy way to communicate via Modbus RTU Slave.

If you have specific questions regarding the Modbus interface using the ML 1100/1400, just contact us using our convenient webmail form and we'll try to assist you.