ezeio2:installation:modbustcp

Modbus/TCP is a common protocol for connecting control and monitoring equipment. The fundamental protocol is the same as for Modbus/RTU, with the obvious difference that Modbus/TCP uses an Ethernet connection to link the devices together, while Modbus/RTU use a serial, RS-485 bus.

Another key difference between Modbus/TCP and Modbus/RTU is that in Modbus/RTU, only one device must be the 'master', and all the other devices must be 'slaves'. In Modbus/TCP, any device can be both a 'server' (providing information to a requestor) or a 'client' (requesting information from servers) - all at the same time.

Note that most Modbus/TCP servers allow a limited number of concurrent connections. Please refer to the documentation of the specific device you are using for these details. The ezeio allows up to 20 concurrent Modbus/TCP connections.

For detailed information about Modbus, please refer to http://modbus.org/

Modbus/TCP wiring

Since Modbus/TCP uses Ethernet, common networking hardware is used to connect devices together. If you are only connecting a single device to the ezeio, you may connect the ezeio and the device directly together. If you need to connect multiple devices, you must use an Ethernet Switch.

The ezeio supports standard Ethernet TP10/100, Auto MDX. The 'Auto MDX' part means that you can use either a regular Ethernet patch cable, or a 'crossover' Ethernet cable. The ezeio will detect the cable type and adapt accordingly.

All standard Ethernet wiring practices apply.

The ezeio uses the same connector for both cloud connectivity and Modbus/TCP. If the LAN provides public Internet access, you must use a correctly configured router to disallow any traffic from the public Internet to your control devices.

If the ezeio is using the built-in cellular modem for cloud connectivity, the Ethernet connection can be dedicated to the Modbus/TCP function, eliminating any security concerns.

Power considerations

The Ethernet connector on the ezeio is electrically isolated. It does not provide power, nor can does it accept power for the ezeio. Any devices connected to the ezeio via Ethernet must be separately powered.

Modbus/TCP addressing

By default the ezeio will expect a DHCP server to provide IP addressing for the LAN. If there is no DHCP server set up, you will need to manually set up fixed IP's in each device, including the ezeio. All devices and the ezeio must be configured for the same subnet (commonly a private network like 192.168.0.0/16, 172.16.0.0/12 or 10.0.0.0/8). Only the last octet is used for local addressing, so the subnet must be a /24.

All devices and the ezeio must be configured for the same /24 subnet.

By default, the ezeio uses port 502 for both client and server Modbus/TCP traffic. The port number can be changed in the ezeio configuration.

The ezeio exposes the following registers:

Input registers Read (command 4)

Register Address Type Description
30001 0 UINT_16 Input 1 raw value (mV, uA or Ohm)
30002 1 UINT_16 Input 2 raw value (mV, uA or Ohm)
30003 2 UINT_16 Input 3 raw value (mV, uA or Ohm)
30004 3 UINT_16 Input 4 raw value (mV, uA or Ohm)
30005 4 UINT_16 Input 5 raw value (mV, uA or Ohm)
30006 5 UINT_16 Input 6 raw value (mV, uA or Ohm)
30007 6 UINT_16 Input 7 raw value (mV, uA or Ohm)
30008 7 UINT_16 Input 8 raw value (mV, uA or Ohm)
30009 8 UINT_16 Supply voltage (mV)
30010 9 UINT_16 Batt terminal voltage (mV)
30011 10 UINT_16 5V terminal voltage (mV)
30012 11 UINT_16 Uptime (seconds), masked low 16 bits
30013 12 INT_32 Location Longitude
30015 14 INT_32 Location Latitude
30017 16 INT_32 Location Elevation
30019 18 UINT_16 GPS signal
30020 19 UINT_16 constant 23456 (5BA0 hex)
30021 20 UINT_32 constant 123456789 (075BCD15 hex)
30023 22 UINT_32 ezeio serial number
30025 24 UINT_32 RTC time (UNIX timestamp)

Holding registers Read (command 3)

Register Address Type Description
40001 0 INT_16 Field 1 value, as integer masked to 16 bit
40002 1 INT_16 Field 2 value, as integer masked to 16 bit
/ / / /
40090 89 INT_16 Field 90 value, as integer masked to 16 bit
40101 100 INT_32 Field 1 value, as integer
40103 102 INT_32 Field 2 value, as integer
/ / / /
40280 279 INT_32 Field 90 value, as integer
40301 300 FLOAT Field 1 value, as IEEE754 floating point
40303 302 FLOAT Field 2 value, as IEEE754 floating point
/ / / /
40480 479 FLOAT Field 90 value, as IEEE754 floating point

Holding registers Write (command 6)

Register Address Type Description
40001 0 INT_16 Field 1 value, as integer masked to 16 bit
40002 1 INT_16 Field 2 value, as integer masked to 16 bit
/ / / /
40090 89 INT_16 Field 90 value, as integer masked to 16 bit

NOTE: The field will only accept the value written if the field is configured as Writeable.

Modbus/TCP is not a secure protocol. It relies on the security of the LAN. Typically a Modbus/TCP LAN should be dedicated to this functionality, and not have any Internet connectivity at all. Never allow incoming traffic on the same port as Modbus is using (TCP/502). Modbus/TCP is not designed for remote access and should never be routed on the Internet.

  • ezeio2/installation/modbustcp.txt
  • Last modified: 2020-09-08 22:57
  • by andreh