AN0103
AN0103
Relevant for:
This application note describes how to set the address and the baud rate for E+E devices with Modbus
RTU interface.
Summary:
The application note provides support for setting individually the slave address and the communication.
Additionally it describes the data encoding of floating point values and the Modbus function codes
supported by the E+E devices.
Rev. 1. 4 11/2020 1
AN0103
Contents
Rev. 1. 4 11/2020 2
AN0103
The measured values can be read by using 0x03 and 0x04 codes. The register address and the
corresponding physical quantities are listed in the datasheet and in the operation manual of the specific
E+E device.
Request:
Modbus Function Starting Address Quantity of Coils CRC
Address Code HB LB HB LB LB HB
XX 01 XX XX XX XX XX XX
This example demonstrates reading the device status from a desired register address. The supported
register addresses can be found in the datasheet and in the operation manual of the specific E+E
device.
Request:
Modbus Function Starting Address Quantity of Registers CRC
Address Code HB LB HB LB LB HB
XX 01 00 XX 00 08 XX XX
Request:
Modbus Function Starting Address Quantity of Registers CRC
Address Code HB LB HB LB LB HB
XX 03, 04 XX XX XX XX XX XX
Rev. 1. 4 11/2020 3
AN0103
This example demonstrates reading the temperature (float value) from register address 0x19. A float
value consists of 4 Bytes 1. The byte order of the floating point value is specified in section 7.2.
Request:
Modbus Function Starting Address Quantity of Registers CRC
Address Code HB LB HB LB LB HB
XX 03 00 19 00 02 XX XX
Request:
Modbus Function Starting Address Register Value CRC
Address Code HB LB HB LB LB HB
XX 05 XX XX XX XX XX XX
The supported register addresses can be found in the datasheet and in the operation manual of the
specific E+E device.
Request:
Modbus Function Register Address Register Value CRC
Address Code HB LB HB LB LB HB
XX 06 XX XX XX XX XX XX
1 It is highly recommended to request a floating point number with a single command. Otherwise, you may get the
upper and lower part of the floating point value from two different measurements.
Rev. 1. 4 11/2020 4
AN0103
The new Slave ID (Modbus address) can be set in the range of 1 to 247 by using the 0x06 function
code 2 and register address 0x00.
Request:
Modbus Function Register Address Register Value CRC
Address Code HB LB HB LB LB HB
XX 06 00 00 00 YY XX XX
The baud rate, parity and stop bit can be changed using the 0x06 function code 3 and register address
0x01.
Request:
Modbus Function Register Address Register Value CRC
Address Code HB LB HB LB LB HB
XX 06 00 01 01 4 XX 5 XX XX
Rev. 1. 4 11/2020 5
AN0103
Request:
Modbus Function Starting Address Quantity of Byte N * Register CRC
Address Code HB LB Registers Count Values
HB LB HB LB LB HB
XX 10 XX XX XX XX XX XX XX XX XX
The supported addresses can be found in the datasheet and in the operation manual of the specific
E+E device.
Set the pressure compensation to 1013.25 mbar (address 0x1388, decimal 5000). The byte order of
the floating point value is specified in section 7.2.
The Modbus standard allows for flexible word order, values larger than 16 bits, such as floating point
values (32 bit and 64 bit).
The IEEE standard definition of single precision floating point values (32 bit, float).
The IEEE standard definition of double precision floating point values (64 bit, double).
Rev. 1. 4 11/2020 6
AN0103
For the double precision format the byte pairs from 1 to 8 are inverted as follows.
Contact information
For more information got to the download centre on the E+E homepage:
http://www.epluse.com/de/service-support/download-center/
The information in this document is believed to be accurate in all respects at the time of publication but is subject
to change without notice. E+E Elektronik assumes no responsibility for errors and omissions, and shall not
accept responsibility for any consequences resulting from the use of information included herein. Additionally,
E+E Elektronik assumes no responsibility for the functioning of features or parameters not described. E+E
Elektronik reserves the right to make changes without further notice. E+E Elektronik makes no warranty,
representation or guarantee regarding the suitability of its products for any particular purpose, nor does E+E
Elektronik assume any liability arising out of the application or use of any product or circuit, and specifically
disclaims any and all liability, including consequential or incidental damages without limitation. E+E Elektronik
products are not designed, intended, or authorised for use in applications intended to support or sustain life, or
for any other application in which the failure of the E+E Elektronik product could create a situation where personal
injury or death may occur. Should the buyer purchase or use E+E Elektronik products for any such unintended
or unauthorised application, the buyer shall indemnify and hold E+E Elektronik harmless against all claims and
damages.
Rev. 1. 4 11/2020 7