User manual

105G Wireless Gateway User Manual
Elpro_man_105g_1.18.doc Page 68
4.7 Serial Configuration - MODBUS
The 105G-MD1 module provides interface for Modbus Slave, Modbus Master and Allen-
Bradley DF1. This Modbus interface uses the Modbus RTU protocol - also known as the
Modbus Binary protocol. This manual assumes that the reader has a good understanding of the
Modbus or DF1 protocol.
4.7.1 MODBUS Slave
If you use the 105G Modbus Slave interface, then the host device will be a Modbus Master
device. The only configuration required for the Modbus slave interface is selecting the Modbus
address and serial port parameters. This is done in the “Serial Settings” screen. A valid Modbus
slave address is 1 to 255.
Each I/O register (and status register) in the 105G can act as one of the following types of
Modbus registers
00001-09999 = Output Coils (digital/single bit)
10001-19999 = Input Bits (digital/single bit)
30001-39999 = Input Registers (analog/16 bit)
40001-49999 = Output Registers (analog/16 bit)
For example:
If the Modbus Master sends the 105G a “read” command for Modbus input 10457, then the
105G will respond with the value in I/O register 457.
If the Modbus Master sends the 105G a “write” command for Modbus output 02650, then the
105G will write the value to I/O register 2650.
If the Modbus Master sends the 105G a “read” command for Modbus input 30142, then the
105G will respond with the value in I/O register 142.
If the Modbus Master sends the 105G a “write” command for Modbus output 40905, then the
105G will write the value to I/O register 905.
The 105G I/O register values are 16 bit (hexadecimal values ‘0000’ to ‘FFFF’, or decimal 0 to
65535), regardless of whether the register represents a discrete, analog or count point.
The value of a discrete (digital) I/O point is stored in the 105G database as a hexadecimal ‘0000’
(“off”) or hex 'FFFF' (“on”). However the 105G will respond with either a ‘0’ (“off”) or ‘1’ (“on”)
to a digital read command from the Modbus master - these are commands 01 and 02. Similarly, the
105G will accept ‘0’ or ‘1’ from the Modbus master in a digital write command and store ‘0000’ or
‘FFFF’ in the database location - these commands are 05 and 15.
The Modbus function codes that the 105G will respond to are shown in the table below.