Modbus configuration example for an Allen Bradley Micrologix 1400

Social Share Toolbar

The latest PLC Allen Bradley Micrologix 1400 is provided with Modbus TCP and RTU. This is a powerful feature and with this post i explain how to enable and how to use it.

To configure the Modbus communication you need to know at least the basic information about Modbus protocol.

Quick overview of Modbus protocol

Modbus protocol can be used with serial cables (Modbus RTU: RS232 or RS485) or with ethernet cable(Modbus TCP).
Modbus TCP architecture is client – server (like for websites, you with the browser are the client that ask information to the server, and the server reply). Modbus TCP devices can be both client-server and the protocol is multi-master, so every device can start the communication.
Modbus RTU architecture is master – slave (master is the client, slave is the server). The only device that can start a communication is the master and there can be only one master (usually a supervisor) and as many slave as you want. Every slave has a “Node address”, so the master can send packet to a single slave. Master does not have the Node address.

The registers

You have 4 types of registers:

  • 2 are read-only (for bits and integers)
  • 2 are readable and writable (for bits and integers)

Boolean block es. B3:
Read Only registers are called Contacts.
Read/Write registers are called Coils.

Numeric block es. N7:
Read Only registers are called Input Registers.
Read/Write registers are called Holding Registers.

Enabling Modbus TCP:

Important note: once you flag Modbus TCP and save the configuration, you should powerup the PLC again.

Enabling Modbus RTU Slave

To enable Modbus RTU you have to configure channel 2 as Modbus RTU Slave.

Block configuration:

With this configuration i have:
B9: read-only
B10: r/w
N7: read-only
N15: r/w

Expanded flag: this flag permit to use 4 more N registers contigous to N15 in order to expand the holding registers area.
To enable expanded registers you need to declare N15 – N16 – N17 – N18 – N19 and to set all the registers words to 256.

Social Share Counters

, , ,

14 Responses to Modbus configuration example for an Allen Bradley Micrologix 1400

  1. gray September 18, 2012 at 00:01 #

    Hi Mesta
    Thanks for the notes much appreciated.
    What version of RSLogix500 are you running? I am running 8.10.00 and noticed that the Modbus selection is not available. I havent installed a modbus software driver into the PLC, not sure if I have to.

    • mesta September 18, 2012 at 21:26 #

      I was running RsLogix 500 version 8.40.00.
      Please note that Modbus protocol is available only on Micrologix 1400 Ser. B.
      Micrologix 1400 Ser. A doesn’t provide Modbus communication.

    • shridhar November 20, 2013 at 07:05 #

      8.3 r later

  2. ducsi September 9, 2013 at 12:35 #

    Hello Mesta,
    Do you know how many client connections a Micrologix 1400 Ser. B. can handle?
    I try to connect to a PLC from a 2nd PC and it does not work.

    • mesta September 9, 2013 at 13:56 #

      It depends if it’s Modbus TCP or RTU.
      For Modbus TCP i connected up to 3 computers time ago, but i never tried with more.
      For Modbus RTU it depends if the Micrologis is set as master or slave.

  3. sarang September 17, 2013 at 08:24 #

    Hi mesta,

    I have Micrologix 1400 Ser B PLC.I have to establish a communication with Modbus TCP & RTU.How to use RSLinx Classic to configure driver for the same?

    • mesta September 17, 2013 at 16:01 #

      RsLinx can’t communicate in Modbus, it uses the proprietary protocols of RA.
      The ethernet port of Micrologix can communicate with 2 or 3 protocols simultaneously, and the simil-Ethernet/IP is the default, and you can choose what other protocol you want to communicate with, in your case Modbus.
      So with RsLinx you set Ethernet Devices (not Ethernet/IP, it will not work) and you can communicate with RsLogix, while with your applications and other plcs you communicate in Modbus.

      • sarang October 16, 2013 at 10:07 #

        Hi Mesta,
        What about Modbus RTU???What I am supposed to select in Rs-Linx while configuring ML1400 Ser B through Modbus-RTU?I have done channel configuration through RS-Logix 500.But it is unable to establish a communication link.

        Kindly revert back.

        • mesta October 16, 2013 at 12:25 #

          I don’t remember if the serial port of Micrologix can talk 2 different protocols. If it does, then you have to select DF1 in RsLinx. If it can communicate only Modbus RTU, you have to use the other serial port or connect through the ethernet port.

  4. krishna September 19, 2013 at 06:00 #

    Hi Mesta,

    Iam an newbie in .net,basically from PLC,SCADA domain.
    Big fan of ADVHMI, Now can some one share me a project where the real time data from PLC can be logged to sql server.
    I want to make a screen for data and another one for reports.

    Does someone have done this in advanced hmi.


  5. Hector Quiroz October 22, 2013 at 17:37 #

    Hello Mesta:

    I’m working with web server embed on Micrologix 1400 PLC and RSLogix 8.40.

    I monitored directory enabled and N7: 0, (eg)

    Using codes <ABDRT-xxx) but only for reading, my question is:

    Is there any code with which I can now write to that block (N7: 0)?

    Thank you.

    • mesta October 22, 2013 at 19:11 #

      I have no experience of working with embedded webserver of Micrologix 1400. In the projects based on ML-1400 was using Ethernet/IP, OPC client or Modbus TCP protocols; with all of them i was using C# or ANSI-C compilers.

  6. shridhar November 20, 2013 at 07:11 #

    HI mesta
    do you have a sample rslogix500 plc program for modbus TCP/IP communication pls send me on

    • mesta November 20, 2013 at 10:56 #

      Actually i don’t have a working sample, but you can test that if your program works by using the Modbus client that you can find on

Leave a Reply