Changes

Created page with "{{Template:Networking_rutos_manual_fw_disclosure | fw_version = {{{series}}}_R_00.02.03 | series = {{{series}}} }} ==Summary== <b>Modbus</b> is a serial communications p..."
{{Template:Networking_rutos_manual_fw_disclosure
| fw_version = {{{series}}}_R_00.02.03
| series = {{{series}}}
}}

==Summary==

<b>Modbus</b> 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 {{{name}}} devices.

{{Template:Networking_rutos_manual_basic_advanced_webui_disclaimer
| series = {{{series}}}
}}

==Modbus TCP slave==

A <b>Modbus TCP slave</b> 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:

[[File:Networking_rutos_manual_modbus_modbus_tcp_slave_v1.png|border|class=tlt-border]]

<table class="nd-mantable">
<tr>
<th>Field</th>
<th>Value</th>
<th>Description</th>
</tr>
<tr>
<td>Enable</td>
<td>yes | no; default: <b>none</b></td>
<td>Turns Modbus TCP on or off.</td>
</tr>
<tr>
<td>Port</td>
<td>integer [0..65535]; default: '''502'''</td>
<td>TCP port used for Modbus communications.</td>
</tr>
<tr>
<td>Device ID</td>
<td>integer [0..255]; default: <b>1</b></td>
<td>The device's Modbus slave ID. When set to 0, it will respond to requests addressed to any ID.</td>
</tr>
<tr>
<td>Allow Remote Access</td>
<td>yes | no; default: <b>no</b></td>
<td>Allows remote Modbus connections by adding an exception to the device's firewall on the port specified in the field above.</td>
</tr>
<tr>
<td>Enable custom register block</td>
<td>yes | no; default: <b>no</b></td>
<td>Allow custom register block.</td>
</tr>
</table>

==Modbus TCP Master==

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

[[File:Networking_rutos_manual_modbus_modbus_tcp_master_v1.png|border|class=tlt-border]]

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 <b>Slave device configuration</b> and the table below provides information on the fields contained in that section:

[[File:Networking_rutos_manual_modbus_modbus_tcp_master_slave_configuration_v1.png|border|class=tlt-border]]

<table class="nd-mantable">
<tr>
<th>Field</th>
<th>Value</th>
<th>Description</th>
</tr>
<tr>
<td>Enabled</td>
<td>off | on; default: <b>off</b></td>
<td>Turns communication with the slave device on or off.</td>
</tr>
<tr>
<td>Name</td>
<td>string; default: <b>none</b></td>
<td>Slave device's name, used for easier management purposes.</td>
</tr>
<tr>
<td>Slave ID</td>
<td>integer [0..255]; default: <b>none</b></td>
<td>Slave 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.</td>
</tr>
<tr>
<td>IP address</td>
<td>ip; default: <b>none</b></td>
<td>Slave device's IP address.</td>
</tr>
<tr>
<td>Port</td>
<td>integer [0..65535]; default: <b>none</b></td>
<td>Slave device's Modbus TCP port.</td>
</tr>
<tr>
<td>Period</td>
<td>integer [1..86400]; default: <b>60</b></td>
<td>Interval at which requests are sent to the slave device.</td>
</tr>
<tr>
<td>Timeout</td>
<td>integer [1..30]; default: '''5'''</td>
<td>Maximum response wait time.</td>
</tr>
</table>

===Requests configuration===
----
A Modbus <b>request</b> 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:

[[File:Networking_rutos_manual_modbus_modbus_tcp_master_requests_configuration_v1.png|border|class=tlt-border]]

<table class="nd-mantable">
<tr>
<th>Field</th>
<th>Value</th>
<th>Description</th>
</tr>
<tr>
<td>Name</td>
<td>string; default: <b>Unnamed</b></td>
<td>Request name. Used for easier management purposes.</td>
</tr>
<tr>
<td>Data type</td>
<td>8bit 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: <b>16bit INT, high byte first</b></td>
<td>How read data will be stored.</td>
</tr>
<tr>
<td>Function</td>
<td>Read 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: <b>Read holding registers (3)</b></td>
<td>Specifies the type of register being addressed by a Modbus request.
</td>
</tr>
<tr>
<td>First Register</td>
<td>integer [0..65535]; default: <b>1</b></td>
<td>First Modbus register from which data will be read.</td>
</tr>
<tr>
<td>Register Count / Values</td>
<td>integer [1..2000]; default: <b>1</b></td>
<td>Number of Modbus registers that will be read during the request.</td>
</tr>
<tr>
<td>Enabled</td>
<td>off | on; default: <b>off</b></td>
<td>Turns the request on or off.</td>
</tr>
<tr>
<td>Delete [ X ]</td>
<td>- (interactive button)</td>
<td>Deletes the request.</td>
</tr>

</table>

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.

[[File:Networking_rutos_manual_modbus_modbus_tcp_master_requests_configuration_testing_v1.png|border|class=tlt-border]]

===Alarms Configuration===
----
<b>Alarms</b> 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.

[[File:Networking_rutos_manual_modbus_modbus_tcp_master_alarms_configuration_v1.png|border|class=tlt-border]]

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

[[File:Networking_rutos_manual_modbus_modbus_tcp_master_alarms_configuration_alarm_configuration_v1.png|border|class=tlt-border]]

<table class="nd-mantable">
<tr>
<th>Field</th>
<th>Value</th>
<th>Description</th>
</tr>
<tr>
<td>Enabled</td>
<td>off | on; default: <b>off</b></td>
<td>Turns the alarm on or off.</td>
</tr>
<tr>
<td>Function code</td>
<td>Read Coil Status (1) | Read Input Status (2) | Read Holding Registers (3) | Read Input Registers (4); default: <b>Read Coil Status (1)</b></td>
<td>Modbus function used for this alarm's Modbus request.</td>
</tr>
<tr>
<td>Register</td>
<td>integer [1..65536]; default: <b>none</b></td>
<td>Number of the Modbus coil/input/holding-register/input-register to read from.</td>
</tr>
<tr>
<td>Condition</td>
<td>More than | Less than | Equal to | Not Equal to; default: <b>Equal to</b></td>
<td>When 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.</td>
</tr>
<tr>
<td>Value</td>
<td>various; default: <b>none</b></td>
<td>The value against which the read data will be compared.</td>
</tr>
<tr>
<td>Value</td>
<td>integer [0..65535]; default: <b>none</b></td>
<td>The value against which the read data will be compared.</td>
</tr>
<tr>
<td>Action frequency</td>
<td>Every trigger | First trigger; default: <b>Every trigger</b></td>
<td>Describes how frequently the specified action will be taken.</td>
</tr>
<tr>
<td>Redundancy protection</td>
<td>off | on; default: <b>off</b></td>
<td>Protection against executing a configured action too often.</td>
</tr>
<tr>
<td>Redundancy protection period</td>
<td>integer [1..86400]; default: <b>none</b></td>
<td>Duration to activate redundancy protection for, measured in seconds. This field becomes visible only when 'Redundancy protection' is turned on.</td>
</tr>
<tr>
<td>Action</td>
<td>SMS | MODBUS Write Request; default: <b>MODBUS Write Request</b></td>
<td>Action that will be taken if the condition is met. Possible actions:
<ul>
<li><b>SMS</b> - sends and SMS message to a specified recipient(s).</li>
<li><b>Modbus Request</b> - sends a Modbus Write request to a specified slave.</li>
</ul>
</td>
</tr>
<tr>
<td><span style="color: #0054a6;">SMS: Message</span></td>
<td>string; default: <b>none</b></td>
<td>SMS message text.</td>
</tr>
<tr>
<td><span style="color: #0054a6;">SMS: Phone number</span></td>
<td>phone number; default: <b>none</b></td>
<td>Recipient's phone number.</td>
</tr>
<tr>
<td><span style="color: purple;">MODBUS Write Request: IP address</span></td>
<td>ip | host; default: <b>none</b></td>
<td>Modbus slave's IP address.</td>
</tr>
<tr>
<td><span style="color: purple;">MODBUS Write Request: Port</span></td>
<td>integer [0..65535]; default: <b>none</b></td>
<td>Modbus slave's port.</td>
</tr>
<tr>
<td><span style="color: purple;">MODBUS Write Request: Timeout</span></td>
<td>integer [1..30]; default: <b>5</b></td>
<td>Maximum time to wait for a response.</td>
</tr>
<tr>
<td><span style="color: purple;">MODBUS Write Request: ID</span></td>
<td>integer [1..255]; default: <b>none</b></td>
<td>Modbus slave ID.</td>
</tr>
<tr>
<td><span style="color: purple;">MODBUS Write Request: Modbus function</span></td>
<td>Read Force Single Coil (5) | Preset Single Register (6) | Force Multiple Coils (15) | Force Multiple Registers (16); default: <b>Force Single Coil (5)</b></td>
<td>A function code specifies the type of register being addressed by a Modbus request.</td>
</tr>
<tr>
<td><span style="color: purple;">MODBUS Write Request: First register</span></td>
<td>integer [0..65535]; default: <b>none</b></td>
<td>Begins reading from the register specified in this field.</td>
</tr>
<tr>
<td><span style="color: purple;">MODBUS Write Request: Values</span></td>
<td>integer [0..65535]; default: <b>none</b></td>
<td>Register/Coil values to be written (multiple values must be separated by space character).</td>
</tr>
</table>
{{#ifeq: {{{series}}} | RUTX ||
==MQTT Gateway==

The <b>MQTT Gateway</b> function is used to transfer Modbus data over MQTT. Refer to the table for information on MQTT gateway configuration fields.

[[File:Networking_rutos_manual_modbus_mqtt_gateway_v1.png|border|class=tlt-border]]

<table class="nd-mantable">
<tr>
<th>Field</th>
<th>Value</th>
<th>Description</th>
</tr>
<tr>
<td>Enable</td>
<td>off <nowiki>|</nowiki> on; default: <b>off</b></td>
<td>Turns MQTT gateway on or off.</td>
</tr>
<tr>
<td>Host</td>
<td>ip <nowiki>|</nowiki> host; default: <b>127.0.0.1</b></td>
<td>IP address or hostname of an MQTT broker.</td>
</tr>
<tr>
<td>Port</td>
<td>integer [0..65535]; default: <b>1883</b></td>
<td>Port number of the MQTT broker.</td>
</tr>
<tr>
<td>Request topic</td>
<td>alphanumeric string; default: <b>request</b></td>
<td>.</td>
</tr>
<tr>
<td>Response topic</td>
<td>alphanumeric string; default: <b>response</b></td>
<td>.</td>
</tr>
<tr>
<td>Username</td>
<td>string; default: <b>none</b></td>
<td>Username for authentication to the MQTT broker.</td>
</tr>
<tr>
<td>Password</td>
<td>string; default: <b>none</b></td>
<td>Password for authentication to the MQTT broker.</td>
</tr>
</table>|}}
==See also==

{{Template: Networking_device_modbus_see_also}}

[[Category:{{{name}}} Services section]]
<!--






==Modbus Data to Server==

The Modbus <b>Data to Server</b> function provides you with the possibility to set up senders that transfer data collected from Modbus slaves to remote servers. To add a new data sender, enter the server's address, specify the data sending period and click the "Add" button:

[[File:Networking_rutx_manual_modbus_add_new_data_sender_v1.png]]

===Data sender configuration===
----
When you add a new data sender, you will be redirected to its configuration window. The figure below is an example of that window and the table below provides information on the fields that it contains:

[[File:Networking_rutx_manual_modbus_data_sender_configuration_v1.png]]

<table class="nd-mantable">
<tr>
<th>Enabled</th>
<th>off | on; Default: <b>off</b></th>
<th>Turns the data sender ON or OFF</th>
</tr>
<tr>
<td>Name</td>
<td>string; Default: <b>none</b></td>
<td>Data sender's name. used for easier management purposes</td>
</tr>
<tr>
<td>Protocol</td>
<td>HTTP; Default: <b>HTTP</b></td>
<td>Data sending protocol</td>
</tr>
<tr>
<td>JSON format</td>
<td>json string; Default: <b>{"ID":"%i", "TS":"%t","ST":"%s","VR":"%a"}</b></td>
<td>Provides the possibility to fully customize the JSON segment</td>
</tr>
<tr>
<td>Segment count</td>
<td>1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10; Default: <b>1</b></td>
<td>Max segment count in one JSON string sent to server</td>
</tr>
<tr>
<td>URL</td>
<td>host | ip; Default: <b>none</b></td>
<td>Address of the server to which the data will be sent.</td>
</tr>
<tr>
<td>Period</td>
<td>integer [1..6400]; Default: <b>60</b></td>
<td>Data sending frequency (in seconds)</td>
</tr>
<tr>
<td>Data filtering</td>
<td>All data | By slave ID | By slave IP; Default: <b>All data</b></td>
<td>Which data this sender will transfer to the server</td>
</tr>
<tr>
<td>Retry on fail</td>
<td>off | on; Default: <b>no</b></td>
<td>Specifies whether the data sender should retry failed attempts (Retry until successful)</td>
</tr>
<tr>
<td>Custom header</td>
<td>string; Default: <b>no</b></td>
<td>Adds a custom header(s) to HTTP requests</td>
</tr>
</table>
-->

Navigation menu