Select Page

RUTX11 Modbus

Summary #

Modbus is a serial communications protocol. Simple and robust, it has become a de facto standard communication protocol and is now a commonly available means of connecting industrial electronic devices.

This manual page provides an overview of the Modbus functionality in RUTX11 devices.

If you’re having trouble finding this page or some of the parameters described here on your device’s WebUI, you should turn on “Advanced WebUI” mode. You can do that by clicking the “Basic” button under “Mode”, which is located at the top-right corner of the WebUI.

Networking rutx manual webui basic advanced mode v1.gif

Modbus TCP slave #

Modbus TCP slave listens for connections from a master (client) and sends out a response or sets some system related parameter in accordance with the given query. This provides the user with the possibility to set or get system parameters.

The figure below is an example of the Modbus TCP window section and the table below provides information on the fields contained in that window:

Networking rutos manual modbus modbus tcp slave v2.png
FieldValueDescription
Enableyes | no; default: noneTurns Modbus TCP on or off.
Portinteger [0..65535]; default: 502TCP port used for Modbus communications.
Device IDinteger [0..255]; default: 1The device’s Modbus slave ID. When set to 0, it will respond to requests addressed to any ID.
Allow Remote Accessyes | no; default: noAllows remote Modbus connections by adding an exception to the device’s firewall on the port specified in the field above.
Keep persistent connectionyes | no; default: noAllows keep the connection open after responding a Modbus TCP master request.
Connection timeoutinteger; default: 0Sets TCP timeout in seconds after which the connection is forcefully closed.
Enable custom register blockyes | no; default: noAllow custom register block.

Get Parameters #

Modbus parameters are held within registers. Each register contains 2 bytes of information. For simplification, the number of registers for storing numbers is 2 (4 bytes), while the number of registers for storing text information is 16 (32 bytes). The register numbers and corresponding system values are described in the table below:

Required ValueRegister AddressRegister NumberNumber Of RegistersRepresentation
System uptime12232 bit unsigned integer
Mobile signal strength (RSSI in dBm)34232 bit integer
System temperature (in 0.1 °C)56232 bit integer
System hostname7816Text
GSM operator name232416Text
Router serial number394016Text
LAN MAC address555616Text
Router name717216Text
Currently active SIM card slot878816Text
Network registration info10310416Text
Network type11912016Text
Current WAN IP address139140232 bit unsigned integer
GPS latitude coordinate143144232 bit float
GPS longitude coordinate145146232 bit float
GPS fix time14714816Text (Unix timestamp×1000)
GPS date and time16316416Text (DDMMYYhhmmss)
GPS speed179180232 bit integer
GPS satellite count181182232 bit integer
GPS accuracy183184232 bit float
Mobile data received today (SIM1)185186232 bit unsigned integer
Mobile data sent today (SIM1)187188232 bit unsigned integer
Mobile data received this week (SIM1)189190232 bit unsigned integer
Mobile data sent this week (SIM1)191192232 bit unsigned integer
Mobile data received this month (SIM1)193194232 bit unsigned integer
Mobile data sent this month (SIM1)195196232 bit unsigned integer
Mobile data received last 24h (SIM1)197198232 bit unsigned integer
Mobile data sent last 24h (SIM1)199200232 bit unsigned integer
Active SIM card205206132 bit unsigned integer
Mobile data received last week (SIM1)292293232 bit unsigned integer
Mobile data sent last week (SIM1)294295232 bit unsigned integer
Mobile data received last month (SIM1)296297232 bit unsigned integer
Mobile data sent last month (SIM1)298299232 bit unsigned integer
Mobile data received today (SIM2)300301232 bit unsigned integer
Mobile data sent today (SIM2)302303232 bit unsigned integer
Mobile data received this week (SIM2)304305232 bit unsigned integer
Mobile data sent this week (SIM2)306307232 bit unsigned integer
Mobile data received this month (SIM2)308309232 bit unsigned integer
Mobile data sent this month (SIM2)310311232 bit unsigned integer
Mobile data received last 24h (SIM2)312313232 bit unsigned integer
Mobile data sent last 24h (SIM2)314315232 bit unsigned integer
Mobile data received last week (SIM2)316317232 bit unsigned integer
Mobile data sent last week (SIM2)318319232 bit unsigned integer
Mobile data received last month(SIM2)320321232 bit unsigned integer
Mobile data sent last month (SIM2)322323232 bit unsigned integer
Digital non-isolated input (4 PIN connector)324325132 bit unsigned integer
Digital open collector output (4 PIN connector)325326132 bit unsigned integer
Modem ID3283298Text
IMSI34834916Text

Set Parameters #

The Modbus daemon can also set some device parameters. These parameters and explanations on how to use them are described in the table below:

Value To SetRegister AddressRegister ValueDescription
Switch WiFi ON/OFF2031 | 0Turns WiFi ON or OFF
Switch mobile data connection (ON/OFF*)2041 | 0Turns mobile data connection ON or OFF
Switch SIM card2051 | 2 | 0Changes the active SIM card slot1 – switch to SIM12 – switch to SIM20 – switch from the the SIM card opposite of the one currently in use (SIM1 → SIM2 or SIM2 → SIM1
Reboot2061Reboots the router
Change APN207APN codeChanges APN.
The number of input registers may vary depending on the length of the APN, but the very first byte of the set APN command denotes the number of the SIM card for which to set the APN. This byte should be set to:1 – to set APN for SIM12 – to set APN for SIM2
Switch PIN 4 state3251|0Toggles PIN 4 ON or OFF, when output is selected

Modbus TCP Master #

A Modbus master device can request data from Modbus slaves. The Modbus TCP Master section is used to configure Modbus TCP slaves.

Networking rutos manual modbus modbus tcp master v1.png

To add a new slave, simply click the ‘Add’ button.

You can create a maximum of 10 slave configurations.

Slave device configuration #

The figure below is an example of the Slave device configuration and the table below provides information on the fields contained in that section:

Networking rutos manual modbus modbus tcp master slave configuration v1.png
FieldValueDescription
Enabledoff | on; default: offTurns communication with the slave device on or off.
Namestring; default: noneSlave device’s name, used for easier management purposes.
Slave IDinteger [0..255]; default: noneSlave ID. Each slave in a network is assigned a unique identifier ranging from 1 to 255. When the master requests data from a slave, the first byte it sends is the Slave ID. When set to 0, the slave will respond to requests addressed to any ID.
IP addressip; default: noneSlave device’s IP address.
Portinteger [0..65535]; default: noneSlave device’s Modbus TCP port.
Periodinteger [1..86400]; default: 60Interval at which requests are sent to the slave device.
Timeoutinteger [1..30]; default: 5Maximum response wait time.

Requests configuration #

A Modbus request is a way of obtaining data from Modbus slaves. The master sends a request to a slave specifying the function code to be performed. The slave then sends the requested data back to the Modbus master. You can create a maximum of 64 request configurations for each slave device.

The figure below is an example of the Requests configuration section and the table below provides information contained in the fields of that section:

Networking rutos manual modbus modbus tcp master requests configuration v1.png
FieldValueDescription
Namestring; default: UnnamedRequest name. Used for easier management purposes.
Data type8bit INT | 8bit UINT | 16bit INT, high byte first | 16bit INT, low byte first | 16bit UINT, high byte first | 16bit UINT, low byte first | 32bit float, Byte order 1,2,3,4 | 32bit float, Byte order 4,3,2,1 | 32bit float, Byte order 2,1,4,3 | 32bit float, Byte order 3,4,1,2; default: 16bit INT, high byte firstHow read data will be stored.
FunctionRead coils (1) | Read input coils (2) | Read holding registers (3) | Read input registers (4) | Set single coil (5) | Set single coil register (6) | Set multiple coils (15) | Set multiple holding registers (16); default: Read holding registers (3)Specifies the type of register being addressed by a Modbus request.
First Registerinteger [0..65535]; default: 1First Modbus register from which data will be read.
Register Count / Valuesinteger [1..2000]; default: 1Number of Modbus registers that will be read during the request.
Enabledoff | on; default: offTurns the request on or off.
Delete [ X ]– (interactive button)Deletes the request.

After having configured a request, you should see a new ‘Testing’ section appear. It is used to check whether the configuration works correctly. Simply press the ‘Test’ button and a response should appear in the box below.

Networking rutos manual modbus modbus tcp master requests configuration testing v1.png

Alarms Configuration #

Alarms are a way of setting up automated actions when some Modbus values meet user specified conditions. The figure below is an example of the Alarms Configuration list.

Networking rutos manual modbus modbus tcp master alarms configuration v1.png

It is empty by default. So, to begin editing click the ‘Add’ button and you should be redirected to a page such as this:

Networking rutos manual modbus modbus tcp master alarms configuration alarm configuration v1.png
FieldValueDescription
Enabledoff | on; default: offTurns the alarm on or off.
Function codeRead Coil Status (1) | Read Input Status (2) | Read Holding Registers (3) | Read Input Registers (4); default: Read Coil Status (1)Modbus function used for this alarm’s Modbus request.
Registerinteger [1..65536]; default: noneNumber of the Modbus coil/input/holding-register/input-register to read from.
ConditionMore than | Less than | Equal to | Not Equal to; default: Equal toWhen a value is obtained it will be compared against the value specified in the following field. The comparison will be made in accordance with the condition specified in this field.
Valuevarious; default: noneThe value against which the read data will be compared.
Valueinteger [0..65535]; default: noneThe value against which the read data will be compared.
Action frequencyEvery trigger | First trigger; default: Every triggerDescribes how frequently the specified action will be taken.
Redundancy protectionoff | on; default: offProtection against executing a configured action too often.
Redundancy protection periodinteger [1..86400]; default: noneDuration to activate redundancy protection for, measured in seconds. This field becomes visible only when ‘Redundancy protection’ is turned on.
ActionSMS | MODBUS Write Request; default: MODBUS Write RequestAction that will be taken if the condition is met. Possible actions:SMS – sends and SMS message to a specified recipient(s).Modbus Request – sends a Modbus Write request to a specified slave.
SMS: Messagestring; default: noneSMS message text.
SMS: Phone numberphone number; default: noneRecipient’s phone number.
MODBUS Write Request: IP addressip | host; default: noneModbus slave’s IP address.
MODBUS Write Request: Portinteger [0..65535]; default: noneModbus slave’s port.
MODBUS Write Request: Timeoutinteger [1..30]; default: 5Maximum time to wait for a response.
MODBUS Write Request: IDinteger [1..255]; default: noneModbus slave ID.
MODBUS Write Request: Modbus functionRead Force Single Coil (5) | Preset Single Register (6) | Force Multiple Coils (15) | Force Multiple Registers (16); default: Force Single Coil (5)A function code specifies the type of register being addressed by a Modbus request.
MODBUS Write Request: First registerinteger [0..65535]; default: noneBegins reading from the register specified in this field.
MODBUS Write Request: Valuesinteger [0..65535]; default: noneRegister/Coil values to be written (multiple values must be separated by space character).

Submit a Comment

Your email address will not be published. Required fields are marked *