Introduction
Modbus is a communication protocol commonly used in industrial automation to facilitate the exchange of data between different devices, such as sensors, controllers, and actuators. Modbus can be used to query and set Node configuration options from LAN devices. LAN device executing the query can then relay the data forward for example to a SCADA supervisory system.
Modbus has become a widely adopted standard in the industry. There are variants of the Modbus protocol of which Tosibox implementation support the Modbus TCP/IP. Modbus standard ensures interoperability and compatibility between devices from different manufacturers that support Modbus communication.
Modbus is supported on Lock 150, 210, 250, 500 and Tosibox 175, 350, 375, 610, 650, 670, 675, 695 starting with firmware 5.5.0. |
Configuring the Node
Enabling and configuring Modbus is done on Advanced Settings page.
Settings:
- Enable Modbus server - When enabled Modbus server is started and Node is listening to client requests
- Listen IP - IP address that the Node accepts Modbus requests from. Use 0.0.0.0 if all addresses should be accepted
- Master for Internet/VPN access states - When enabled overrides digital I/O settings, when disabled digital I/O will override possible Modbus commands. In both cases Modbus overrides UI settings always. Applies to Internet access enabled and VPN access enabled commands.
After enabling the Modbus server it listens on port 502 on WLAN access point and all physical LAN interfaces. Modbus data update rate is around 10 seconds.
If Modbus clients asks data rarely (e.g. once a minute), first query may yield 0xFFFF value. Client must wait a few seconds and ask again.
Modbus uses simple TCP/IP request-response protocol, it does not have connected/disconnected states. If a Modbus client goes offline Modbus server on the Node will not be notified. Node keeps the last state that was set until explicitly changed.
Registers
Data | Data value | Registers first - last relative to 40001 | Return value if data is not available | Comment |
---|---|---|---|---|
GNSS latitude | 64-bit IEEE-754 floating point (little-endian) | 0 - 3 Registers: 4 | NaN | Returns 0xFFFF on devices without GNSS |
GNSS longitude | 64-bit IEEE-754 floating point (little-endian) | 4 - 7 Registers: 4 | NaN | Returns 0xFFFF on devices without GNSS |
GNSS UTC time, seconds since midnight | 64-bit IEEE-754 floating point (little-endian) | 4 - 7 Registers: 4 | NaN | GNSS data does not outdate, i.e. the latest info will be be posted as long as there is no new coordinates. Returns 0xFFFF on devices without GNSS |
GNSS talker ID | two-byte talker ID | 12 Registers: 1 | 0 | List of talkers can be found e.g. from NMEA Revealed Bytes are written in memcpy style so first byte is little end. For example if receiving value is 20551 = 0x5047, little end is 0x47 ('G') and big end 0x50 ('P') → 20551 means talker ID 'GP'. Returns 0xFFFF on devices without GNSS |
GNSS locking/fix status either as quality or as pos mode | Unsigned 16-bit integer (little-endian) | 13 Registers: 1 | 0xFFFF | Values 0-9
Values > 32: pos mode character as ASCII
Returns 0xFFFF on devices without GNSS and if value is not available |
Mobile signal strength (RSRP in dBm) | Unsigned 16-bit integer (little-endian) | 14 Registers: 1 | 0xFFFF | Supports both internal and external modems. If both modems are in one Node, internal modem gets priority over external modem |
Mobile signal strength (RSSI in dBm) | Unsigned 16-bit integer (little-endian) | 15 Registers: 1 | 0xFFFF | Supports both internal and external modems. If both modems are in one Node, internal modem gets priority over external modem |
Internet connection interface | Unsigned 16-bit integer (little-endian) | 16 Registers: 1 | 0xFFFF |
|
Tosibox Cloud connection status | Unsigned 16-bit integer (little-endian) | 17 Registers: 1 | 0xFFFF |
|
VPN connection count | Unsigned 16-bit integer (little-endian) | 18 Registers: 1 | 0xFFFF | Number of open VPN tunnels. Count may include also VPNs that are not actually functional (e.g. VPN's that are still being established or malfunctioning, but not yet closed). |
Internet access enabled (Read/Write) | Unsigned 16-bit integer (little-endian) | 19 Registers: 1 | 0xFFFF |
Read and write values:
|
VPN access enabled (Read/Write) | Unsigned 16-bit integer (little-endian) | 20 Registers: 1 | 0xFFFF |
Read and write values:
|