EtherNet-IP Modbus Getting Started
EtherNet-IP Modbus Getting Started
The EtherNet/IP to Modbus products are packaged with a CD containing the following
documents:
7/29/2011
Page 1 of 7
To test connectivity between your configuration tool and the EIP-MB unit, you can retrieve the
Vendor ID. This is done by sending an Explicit Message using the following parameters:
The EIP-MB unit should respond with 0x03AC (940 dec). If your tool displays the response in a
byte-by-byte format, you may see AC 03 which is the Little Endian representation of the 16-bit
value 0x03AC.
For more details about EtherNet/IP Explicit Messaging, please refer to the ODVA EtherNet/IP
Specifications.
As another example, suppose we want to change the parity to None. This is done by setting the
Modbus Parity Attribute to a value of 0:
7/29/2011
Page 2 of 7
Once you have set the serial port parameters to match those of your Modbus slave, cycle power
to the EIP-MB unit.
0x03: Modbus Function Code to Read Multiple Registers. Please refer to the Modbus
Specification for more information.
0xF5 0x01: Little Endian representation of 0x01F5 which is the 16-bit hex representation
of 501, which is our starting register number (the address is 500).
0x03 0x00: Little Endian representation of 0x0003 which is the 16-bit hex representation
of our desired quantity of registers, 3.
Upon receiving this message, the EIP-MB unit will attempt to send the corresponding Modbus
message to your slave. The mapping will only be set if the Modbus slave responds with a
success. If you receive an EtherNet/IP success response, then the mapping has been set. If you
receive an error, then one of the following is most likely your problem:
7/29/2011
Page 3 of 7
Once you have successfully set your mappings, cycle power to the EIP-MB unit for them to take
effect.
At this point in our example, the internal Modbus Master will be reading 3 Modbus registers,
therefore 3 words (6 bytes) of data have been added to the EtherNet/IP Class 1 T->O (Input)
Data packet. The Input Data packet always begins with 1 word (2 bytes) of Modbus Status, so
our total input data size is now 4 words (8 bytes).
For the second Output Mapping, the Explicit Message would be:
Once you have successfully set your mappings, cycle power to the EIP-MB unit for them to take
effect.
At this point in our example, the internal Modbus Master will be writing 8 Modbus registers,
therefore 8 words (16 bytes) of data have been added to the EtherNet/IP Class 1 O->T (Output)
7/29/2011
Page 4 of 7
Data packet. The Output Data packet always begins with 1 word (2 bytes) for a Run/Idle
command, so our total output data size is now 9 words (18 bytes).
If you are satisfied with your configuration and would like it to be permanent, then it would be
best to change the power-up default of the lock state. You definitely want to do this once the unit
is being deployed, so that when power is cycled it begins running, but also so that people cannot
randomly change the configuration. Change the power-up default of the lock with this Explicit
Message:
Now the next time you cycle power, the configuration will be locked. To unlock the
configuration again, simply send the secret message above. Then you will be free to change
any of the configuration again. Note that it will re-lock after the next power cycle unless you set
the power-up default back to 0!
7/29/2011
Page 5 of 7
*Note that the above sizes follow our previous example. You should change these according to
how you set your mappings.
Some EtherNet/IP Master simulators such as EIP Scan do not have a data type setting;
everything is in bytes. In that case, the input and output sizes would be 8 and 18 respectively.
If the PLC is reporting a communication failure, one of the following is most likely the issue:
The data sizes for the input and/or output are not correct.
The GUI uses decimal values and you entered hex, or vice versa.
7/29/2011
Page 6 of 7
If the data is all zeros and you know the values in those registers is non-zero, then most likely
your configuration is unlocked. The Modbus Master does not scan the mappings when it is
unlocked.
Regarding the Output Data, the Modbus Master will not write any output mappings until the Run
Bit in the first word of the output data is set. Change the first word to a 1 and it will begin
writing registers. From our example, the 9 words of our output data are:
In our example, if we were to change the data in words 6, 7, or 8, we would see the input data
words 1, 2, or 3 also change, because the first input mapping and second output mapping are
reading/writing the same registers.
If you are not seeing your Modbus Slaves register data change according to the changes you
make in the PLC data, then one of the following is most likely the issue:
7/29/2011
Page 7 of 7