Difference between revisions of "Template:Networking rutos manual modbus"
(72 intermediate revisions by 9 users not shown) | |||
Line 1: | Line 1: | ||
− | {{Template: | + | {{Template:Networking_rutos_manual_fw_disclosure |
− | | | + | | fw_version = {{{series}}}_R_00.02.05 |
− | + | | series = {{{series}}} | |
− | |||
− | |||
− | |||
− | |||
}} | }} | ||
− | + | ||
− | |||
==Summary== | ==Summary== | ||
Line 14: | Line 9: | ||
This manual page provides an overview of the Modbus functionality in {{{name}}} devices. | This manual page provides an overview of the Modbus functionality in {{{name}}} devices. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
{{Template:Networking_rutos_manual_basic_advanced_webui_disclaimer | {{Template:Networking_rutos_manual_basic_advanced_webui_disclaimer | ||
| series = {{{series}}} | | series = {{{series}}} | ||
}} | }} | ||
− | ==Modbus TCP | + | ==Modbus TCP slave== |
− | A <b>Modbus TCP | + | 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: | 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: | + | [[File:Networking_rutos_manual_modbus_modbus_tcp_slave.png|border|class=tlt-border]] |
<table class="nd-mantable"> | <table class="nd-mantable"> | ||
Line 47: | Line 30: | ||
<tr> | <tr> | ||
<td>Enable</td> | <td>Enable</td> | ||
− | <td>off | on; default: <b> | + | <td>off | on; default: <b>none</b></td> |
<td>Turns Modbus TCP on or off.</td> | <td>Turns Modbus TCP on or off.</td> | ||
</tr> | </tr> | ||
Line 58: | Line 41: | ||
<td>Device ID</td> | <td>Device ID</td> | ||
<td>integer [0..255]; default: <b>1</b></td> | <td>integer [0..255]; default: <b>1</b></td> | ||
− | <td>The device's Modbus | + | <td>The device's Modbus slave ID. When set to 0, it will respond to requests addressed to any ID.</td> |
− | |||
− | |||
− | |||
− | |||
− | |||
</tr> | </tr> | ||
<tr> | <tr> | ||
− | <td>Allow | + | <td>Allow Remote Access</td> |
<td>off | on; default: <b>off</b></td> | <td>off | on; default: <b>off</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> | <td>Allows remote Modbus connections by adding an exception to the device's firewall on the port specified in the field above.</td> | ||
Line 72: | Line 50: | ||
<tr> | <tr> | ||
<td>Keep persistent connection</td> | <td>Keep persistent connection</td> | ||
− | <td>off | on; default: <b> | + | <td>off | on; default: <b>off</b></td> |
− | <td>Allows keep the connection open after responding a Modbus TCP | + | <td>Allows keep the connection open after responding a Modbus TCP master request.</td> |
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>Connection timeout</td> | <td>Connection timeout</td> | ||
− | <td>integer | + | <td> integer; default: <b>0</b></td> |
− | <td>Sets TCP timeout in seconds after which the connection is forcefully closed.</td> | + | <td> Sets TCP timeout in seconds after which the connection is forcefully closed.</td> |
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>Enable custom register block</td> | <td>Enable custom register block</td> | ||
− | <td>off | | + | <td>off | on; default: <b>off</b></td> |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
<td>Allows the usage of custom register block.</td> | <td>Allows the usage of custom register block.</td> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
</tr> | </tr> | ||
</table> | </table> | ||
− | |||
− | |||
− | |||
− | |||
{{Template:Networking_rutos_manual_modbus_modbus_tcp_get_parameters_table | {{Template:Networking_rutos_manual_modbus_modbus_tcp_get_parameters_table | ||
Line 221: | Line 71: | ||
|analog = {{{analog}}} | |analog = {{{analog}}} | ||
|gps = {{{gps}}} | |gps = {{{gps}}} | ||
− | |||
}} | }} | ||
{{Template:Networking_rutos_manual_modbus_modbus_tcp_set_parameters_table | {{Template:Networking_rutos_manual_modbus_modbus_tcp_set_parameters_table | ||
− | |wifi = {{{wifi}}} | + | |wifi={{{wifi}}} |
− | |mobile = {{{mobile}}} | + | |mobile={{{mobile}}} |
− | |series = {{{series}}} | + | |series={{{series}}} |
− | |name = {{{name | + | |name={{{name}}} |
− | |||
}} | }} | ||
− | ==Modbus TCP | + | ==Modbus TCP Master== |
− | A <b>Modbus | + | A <b>Modbus Master</b> device can request data from Modbus slaves. The Modbus TCP Master section is used to configure Modbus TCP slaves. By default, the slave list is empty. To add a new slave, click the 'Add' button |
− | + | [[File:Networking_rutos_manual_modbus_modbus_tcp_master_modbus_tcp_slave_devices_add_button.png|border|class=tlt-border]] | |
− | + | After clicking 'Add' you will be redirected to the newly added slave's configuration page. | |
− | + | You can create a maximum of 10 slave configurations. | |
− | + | ===Slave Device Configuration=== | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | = | ||
---- | ---- | ||
− | The <b> | + | The <b>Slave Device Configuration</b> section is used to configure the parameters of Modbus TCP slaves that the Master (this {{{name}}} device) will be querying with requests. The figure below is an example of the Slave Device Configuration and the table below provides information on the fields contained in that section: |
− | [[File: | + | [[File:Networking_rutos_manual_modbus_modbus_tcp_master_slave_device_configuration.png|border|class=tlt-border]] |
<table class="nd-mantable"> | <table class="nd-mantable"> | ||
Line 264: | Line 104: | ||
<td>Enabled</td> | <td>Enabled</td> | ||
<td>off | on; default: <b>off</b></td> | <td>off | on; default: <b>off</b></td> | ||
− | <td>Turns communication with the | + | <td>Turns communication with the slave device on or off.</td> |
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>Name</td> | <td>Name</td> | ||
<td>string; default: <b>none</b></td> | <td>string; default: <b>none</b></td> | ||
− | <td> | + | <td>Slave device's name, used for easier management purposes.</td> |
</tr> | </tr> | ||
<tr> | <tr> | ||
− | <td> | + | <td>Slave ID</td> |
<td>integer [0..255]; default: <b>none</b></td> | <td>integer [0..255]; default: <b>none</b></td> | ||
− | <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> | ||
<tr> | <tr> | ||
<td>IP address</td> | <td>IP address</td> | ||
− | <td> | + | <td>ip; default: <b>none</b></td> |
− | <td> | + | <td>Slave device's IP address.</td> |
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>Port</td> | <td>Port</td> | ||
<td>integer [0..65535]; default: <b>none</b></td> | <td>integer [0..65535]; default: <b>none</b></td> | ||
− | <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> | ||
<tr> | <tr> | ||
Line 290: | Line 135: | ||
<td>integer [1..30]; default: '''5'''</td> | <td>integer [1..30]; default: '''5'''</td> | ||
<td>Maximum response wait time.</td> | <td>Maximum response wait time.</td> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
</tr> | </tr> | ||
</table> | </table> | ||
Line 320: | Line 140: | ||
===Requests Configuration=== | ===Requests Configuration=== | ||
---- | ---- | ||
− | A Modbus <b>request</b> is a way of obtaining data from Modbus | + | 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 Request Configuration list is empty by default. To add a new Request Configuration loon to the Add New Instance section. Enter a custom name into the 'Name' field and click the 'Add' button: | The Request Configuration list is empty by default. To add a new Request Configuration loon to the Add New Instance section. Enter a custom name into the 'Name' field and click the 'Add' button: | ||
− | [[File: | + | [[File:Networking_rutos_manual_modbus_modbus_tcp_master_requests_configuration_add_new_instance.png|border|class=tlt-border]] |
The new Request Configuration should become visible in the list: | The new Request Configuration should become visible in the list: | ||
− | [[File: | + | [[File:Networking_rutos_manual_modbus_modbus_tcp_master_requests_configuration.png|border|class=tlt-border]] |
<table class="nd-mantable"> | <table class="nd-mantable"> | ||
Line 345: | Line 163: | ||
<tr> | <tr> | ||
<td>Data type</td> | <td>Data type</td> | ||
− | <td>8bit INT | + | <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>Defines how read data will be stored.</td> | <td>Defines how read data will be stored.</td> | ||
</tr> | </tr> | ||
Line 365: | Line 183: | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
− | <td> | + | <td>No Brackets</td> |
<td>off | on; default: <b>off</b></td> | <td>off | on; default: <b>off</b></td> | ||
<td>Removes the starting and ending brackets from the request (only for read requests).</td> | <td>Removes the starting and ending brackets from the request (only for read requests).</td> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td>Delete [ X ]</td> | ||
+ | <td>- (interactive button)</td> | ||
+ | <td>Deletes the request.</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
Line 373: | Line 196: | ||
<td>off | on; default: <b>off</b></td> | <td>off | on; default: <b>off</b></td> | ||
<td>Turns the request on or off.</td> | <td>Turns the request on or off.</td> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
</tr> | </tr> | ||
</table> | </table> | ||
Line 383: | Line 201: | ||
<b>Additional note:</b> by default the newly added Request Configurations are turned off. You can use the on/off slider to the right of the Request Configuration to turn it on: | <b>Additional note:</b> by default the newly added Request Configurations are turned off. You can use the on/off slider to the right of the Request Configuration to turn it on: | ||
− | [[File: | + | [[File:Networking_rutos_manual_modbus_modbus_tcp_master_requests_configuration_on_off_slider.png|border|class=tlt-border]] |
---- | ---- | ||
− | After having configured a request, you should see a new 'Request Configuration Testing' section appear. It is used to check whether the configuration works correctly. Simply click the 'Test' button and a response should appear in the box below | + | After having configured a request, you should see a new 'Request Configuration Testing' section appear. It is used to check whether the configuration works correctly. Simply click the 'Test' button and a response should appear in the box below. A successful response to a test may look something like this: |
[[File:Networking_rutos_manual_modbus_modbus_tcp_master_requests_configuration_testing.png|border|class=tlt-border]] | [[File:Networking_rutos_manual_modbus_modbus_tcp_master_requests_configuration_testing.png|border|class=tlt-border]] | ||
Line 391: | Line 209: | ||
===Alarms Configuration=== | ===Alarms Configuration=== | ||
---- | ---- | ||
− | <b>Alarms</b> are a way of setting up automated actions when some Modbus values meet user-defined conditions. When the Modbus TCP | + | <b>Alarms</b> are a way of setting up automated actions when some Modbus values meet user-defined conditions. When the Modbus TCP Master (this {{{name}}} device) requests some information from a slave device it compares that data to with the parameters set in an Alarm Configuration. If the comparison meets the specified condition (more than, less than, equal to, not equal to), the Master performs a user-specified action, for example, a Modbus write request or switching the state of an output. |
The figure below is an example of the Alarms Configuration list. To create a new Alarm, click the 'Add' button. | The figure below is an example of the Alarms Configuration list. To create a new Alarm, click the 'Add' button. | ||
− | [[File: | + | [[File:Networking_rutos_manual_modbus_modbus_tcp_master_alarms_configuration_add_button.png|border|class=tlt-border]] |
After adding the Alarm you should be redirected to its configuration page which should look similar to this: | After adding the Alarm you should be redirected to its configuration page which should look similar to this: | ||
− | [[File: | + | [[File:Networking_rutos_manual_modbus_modbus_tcp_master_alarms_configuration.png|border|class=tlt-border]] |
<table class="nd-mantable"> | <table class="nd-mantable"> | ||
Line 415: | Line 233: | ||
<td>Function code</td> | <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>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. The Modbus TCP | + | <td>Modbus function used for this alarm's Modbus request. The Modbus TCP Master (this {{{name}}} device) perform this request as often as specified in the 'Period' field in [[#Slave_Device_Configuration|Slave Device Configuration]].</td> |
</tr> | </tr> | ||
<tr> | <tr> | ||
− | <td> | + | <td>Register</td> |
− | <td> | + | <td>integer [1..65536]; default: <b>none</b></td> |
− | <td> | + | <td>Number of the Modbus coil/input/holding-register/input-register to read from.</td> |
</tr> | </tr> | ||
<tr> | <tr> | ||
− | <td> | + | <td>Condition</td> |
− | <td> | + | <td>More than | Less than | Equal to | Not Equal to; default: <b>Equal to</b></td> |
− | <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> | ||
<tr> | <tr> | ||
− | <td> | + | <td>Value</td> |
<td>various; default: <b>none</b></td> | <td>various; default: <b>none</b></td> | ||
<td>The value against which the read data will be compared.</td> | <td>The value against which the read data will be compared.</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
− | <td> | + | <td>Value</td> |
− | <td> | + | <td>integer [0..65535]; default: <b>none</b></td> |
− | <td> | + | <td>The value against which the read data will be compared.</td> |
</tr> | </tr> | ||
<tr> | <tr> | ||
Line 444: | Line 262: | ||
<tr> | <tr> | ||
<td>Redundancy protection</td> | <td>Redundancy protection</td> | ||
− | <td>off | | + | <td>off | on; default: <b>off</b></td> |
<td>Protection against executing a configured action too often.</td> | <td>Protection against executing a configured action too often.</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
− | <td | + | <td>Redundancy protection period</td> |
<td>integer [1..86400]; default: <b>none</b></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> | <td>Duration to activate redundancy protection for, measured in seconds. This field becomes visible only when 'Redundancy protection' is turned on.</td> | ||
Line 454: | Line 272: | ||
<tr> | <tr> | ||
<td>Action</td> | <td>Action</td> | ||
− | <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: | <td>Action that will be taken if the condition is met. Possible actions: | ||
− | <ul> | + | <ul> |
− | <li><b>SMS</b> - sends and SMS message to a specified recipient(s).</li> | + | <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 | + | <li><b>Modbus Request</b> - sends a Modbus Write request to a specified slave.</li> |
− | |||
</ul> | </ul> | ||
</td> | </td> | ||
− | </tr> | + | </tr> |
<tr> | <tr> | ||
<td><span style="color: #0054a6;">SMS: Message</span></td> | <td><span style="color: #0054a6;">SMS: Message</span></td> | ||
Line 472: | Line 289: | ||
<td>phone number; default: <b>none</b></td> | <td>phone number; default: <b>none</b></td> | ||
<td>Recipient's phone number.</td> | <td>Recipient's phone number.</td> | ||
− | </tr> | + | </tr> |
<tr> | <tr> | ||
<td><span style="color: purple;">MODBUS Write Request: IP address</span></td> | <td><span style="color: purple;">MODBUS Write Request: IP address</span></td> | ||
<td>ip | host; default: <b>none</b></td> | <td>ip | host; default: <b>none</b></td> | ||
− | <td>Modbus | + | <td>Modbus slave's IP address.</td> |
</tr> | </tr> | ||
<tr> | <tr> | ||
<td><span style="color: purple;">MODBUS Write Request: Port</span></td> | <td><span style="color: purple;">MODBUS Write Request: Port</span></td> | ||
<td>integer [0..65535]; default: <b>none</b></td> | <td>integer [0..65535]; default: <b>none</b></td> | ||
− | <td>Modbus | + | <td>Modbus slave's port.</td> |
</tr> | </tr> | ||
<tr> | <tr> | ||
Line 491: | Line 308: | ||
<td><span style="color: purple;">MODBUS Write Request: ID</span></td> | <td><span style="color: purple;">MODBUS Write Request: ID</span></td> | ||
<td>integer [1..255]; default: <b>none</b></td> | <td>integer [1..255]; default: <b>none</b></td> | ||
− | <td>Modbus | + | <td>Modbus slave ID.</td> |
</tr> | </tr> | ||
<tr> | <tr> | ||
<td><span style="color: purple;">MODBUS Write Request: Modbus function</span></td> | <td><span style="color: purple;">MODBUS Write Request: Modbus function</span></td> | ||
− | <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> | <td>A function code specifies the type of register being addressed by a Modbus request.</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
− | + | <td><span style="color: purple;">MODBUS Write Request: First register</span></td> | |
− | |||
− | |||
− | |||
− | |||
− | <td><span style="color: purple;">MODBUS Write Request: First register | ||
<td>integer [0..65535]; default: <b>none</b></td> | <td>integer [0..65535]; default: <b>none</b></td> | ||
<td>Begins reading from the register specified in this field.</td> | <td>Begins reading from the register specified in this field.</td> | ||
Line 512: | Line 324: | ||
<td>integer [0..65535]; default: <b>none</b></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> | <td>Register/Coil values to be written (multiple values must be separated by space character).</td> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
</tr> | </tr> | ||
</table> | </table> | ||
{{#ifeq: {{{serial}}} | 1 | | {{#ifeq: {{{serial}}} | 1 | | ||
− | ==Modbus Serial | + | ==Modbus Serial Master== |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | The <b>Modbus Serial Master</b> page is used to configure the device as a Modbus RTU Master. Modbus RTU (remote terminal unit) is a serial communication protocol mainly used in communication via serial interfaces. | |
− | + | {{#ifeq: {{{rs232}}} | 1 | | |
− | + | ===RS232=== | |
− | |||
− | === | ||
---- | ---- | ||
− | This section is used to configure the Modbus Serial | + | This section is used to configure the Modbus Serial Master's <b>RS232</b> serial interface settings. Refer to the figure and table below for information on RS232 configuration. |
− | [[File: | + | [[File:Networking_rutos_manual_modbus_modbus_serial_master_rs232_configuration.png|border|class=tlt-border]] |
<table class="nd-mantable"> | <table class="nd-mantable"> | ||
Line 618: | Line 344: | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
− | <td> | + | <td>Enabled</td> |
− | <td>off | + | <td>off <nowiki>|</nowiki> on; default: <b>off</b></td> |
− | <td> | + | <td>Turns Modbus Serial Master configuration via RS232 on or off. Both this and RS232 from Services → [[{{{name}}} RS232|RS232]] cannot be enabled at the same time.</td> |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>Baud rate</td> | <td>Baud rate</td> | ||
− | <td>300 | + | <td>300 <nowiki>|</nowiki> 1200 <nowiki>|</nowiki> 2400 <nowiki>|</nowiki> 4800 <nowiki>|</nowiki> 9600 <nowiki>|</nowiki> 19200 <nowiki>|</nowiki> 38400 <nowiki>|</nowiki> 57600 <nowiki>|</nowiki> 115200; default: <b>115200</b></td> |
<td>Serial data transmission rate (in bits per second).</td> | <td>Serial data transmission rate (in bits per second).</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>Data bits</td> | <td>Data bits</td> | ||
− | <td> | + | <td>5 <nowiki>|</nowiki> 6 <nowiki>|</nowiki> 7 <nowiki>|</nowiki> 8; default: <b>8</b></td> |
<td>Number of data bits for each character.</td> | <td>Number of data bits for each character.</td> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>Parity</td> | <td>Parity</td> | ||
− | <td>Even | + | <td>None <nowiki>|</nowiki> Even <nowiki>|</nowiki> Odd; default: <b>None</b></td> |
<td>In serial transmission, parity is a method of detecting errors. An extra data bit is sent with each data character, arranged so that the number of 1 bits in each character, including the parity bit, is always odd or always even. If a byte is received with the wrong number of 1s, then it must have been corrupted. However, an even number of errors can pass the parity check. | <td>In serial transmission, parity is a method of detecting errors. An extra data bit is sent with each data character, arranged so that the number of 1 bits in each character, including the parity bit, is always odd or always even. If a byte is received with the wrong number of 1s, then it must have been corrupted. However, an even number of errors can pass the parity check. | ||
<ul> | <ul> | ||
<li><b>None</b> (<b>N</b>) - no parity method is used.</li> | <li><b>None</b> (<b>N</b>) - no parity method is used.</li> | ||
<li><b>Odd</b> (<b>O</b>) - the parity bit is set so that the number of "logical ones (1s)" has to be odd.</li> | <li><b>Odd</b> (<b>O</b>) - the parity bit is set so that the number of "logical ones (1s)" has to be odd.</li> | ||
− | <li><b>Even</b> (<b>E</b>) - the parity bit is set so that the number of "logical ones (1s)" has to be even.</li> | + | <li><b>Even</b> (<b>E</b>) - the parity bit is set so that the number of "logical ones (1s)" has to be even.</li> |
− | |||
</ul> | </ul> | ||
</td> | </td> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td>Stop bits</td> | ||
+ | <td>1 <nowiki>|</nowiki> 2; default: <b>1</b></td> | ||
+ | <td>Stop bits sent at the end of every character allow the receiving signal hardware to detect the end of a character and to resynchronise with the character stream. Electronic devices usually use one stop bit. Two stop bits are required if slow electromechanical devices are used.</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>Flow control</td> | <td>Flow control</td> | ||
− | <td>None | + | <td>None <nowiki>|</nowiki> RTS/CTS <nowiki>|</nowiki> Xon/Xoff; default: <b>None</b></td> |
<td>In many circumstances a transmitter might be able to send data faster than the receiver is able to process it. To cope with this, serial lines often incorporate a "handshaking" method, usually distinguished between hardware and software handshaking. | <td>In many circumstances a transmitter might be able to send data faster than the receiver is able to process it. To cope with this, serial lines often incorporate a "handshaking" method, usually distinguished between hardware and software handshaking. | ||
− | + | <ul> | |
<li><b>RTS/CTS</b> - hardware handshaking. RTS and CTS are turned OFF and ON from alternate ends to control data flow, for instance when a buffer is almost full.</li> | <li><b>RTS/CTS</b> - hardware handshaking. RTS and CTS are turned OFF and ON from alternate ends to control data flow, for instance when a buffer is almost full.</li> | ||
<li><b>Xon/Xoff</b> - software handshaking. The Xon and Xoff characters are sent by the receiver to the sender to control when the sender will send data, i.e., these characters go in the opposite direction to the data being sent. The circuit starts in the "sending allowed" state. When the receiver's buffers approach capacity, the receiver sends the Xoff character to tell the sender to stop sending data. Later, after the receiver has emptied its buffers, it sends an Xon character to tell the sender to resume transmission.</li> | <li><b>Xon/Xoff</b> - software handshaking. The Xon and Xoff characters are sent by the receiver to the sender to control when the sender will send data, i.e., these characters go in the opposite direction to the data being sent. The circuit starts in the "sending allowed" state. When the receiver's buffers approach capacity, the receiver sends the Xoff character to tell the sender to stop sending data. Later, after the receiver has emptied its buffers, it sends an Xon character to tell the sender to resume transmission.</li> | ||
− | </ul> | + | </ul> |
</td> | </td> | ||
− | </tr> | + | </tr> |
− | |||
− | |||
− | |||
− | |||
− | |||
</table> | </table> | ||
− | === | + | ====RS232 Slave Devices List==== |
---- | ---- | ||
− | + | The <b>RS232 Slave Devices List</b> section is used to configure the parameters of Modbus RUT slaves that the Master (this {{{name}}} device) will be querying with requests. | |
− | + | The list is empty by default. In order to create a new slave device configuration, click the 'Add' button. | |
− | + | [[File:Networking_rutos_manual_modbus_modbus_serial_master_rs232_slave_devices_list_add_button.png|border|class=tlt-border]] | |
− | + | Then click the 'Edit' button next to the newly added slave device in order to begin configuration. | |
− | + | [[File:Networking_rutos_manual_modbus_modbus_serial_master_rs232_slave_devices_list_edit_button.png|border|class=tlt-border]] | |
− | ==== | + | =====RS232 Slave Device Configuration===== |
---- | ---- | ||
− | The <b> | + | The <b>RS232 Slave Device Configuration</b> section is used to configure the parameters of Modbus RTU slaves that the Master (this {{{name}}} device) will be querying with requests. The figure below is an example of the RS232 Slave Device Configuration and the table below provides information on the fields contained in that section: |
− | [[File: | + | [[File:Networking_rutos_manual_modbus_modbus_serial_master_rs232_slave_device_configuration.png|border|class=tlt-border]] |
<table class="nd-mantable"> | <table class="nd-mantable"> | ||
Line 702: | Line 412: | ||
<tr> | <tr> | ||
<td>Enabled</td> | <td>Enabled</td> | ||
− | <td>off | + | <td>off <nowiki>|</nowiki> on; default: <b>off</b></td> |
− | <td>Turns communication with the | + | <td>Turns communication with the slave device on or off.</td> |
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>Name</td> | <td>Name</td> | ||
<td>string; default: <b>none</b></td> | <td>string; default: <b>none</b></td> | ||
− | <td> | + | <td>Slave device's name, used for easier management purposes.</td> |
</tr> | </tr> | ||
<tr> | <tr> | ||
− | <td> | + | <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> | |
− | |||
− | |||
− | |||
− | <td>integer [0..255]; default: <b> | ||
− | <td> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>Period</td> | <td>Period</td> | ||
− | <td>integer [1.. | + | <td>integer [1..86400]; default: <b>60</b></td> |
− | <td>Interval at which requests are sent to the | + | <td>Interval at which requests are sent to the slave device.</td> |
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>Timeout</td> | <td>Timeout</td> | ||
− | <td>integer [1.. | + | <td>integer [1..30]; default: <b>5</b></td> |
<td>Maximum response wait time.</td> | <td>Maximum response wait time.</td> | ||
</tr> | </tr> | ||
</table> | </table> | ||
− | |||
=====Requests Configuration===== | =====Requests Configuration===== | ||
---- | ---- | ||
− | A Modbus <b>request</b> is a way of obtaining data from Modbus | + | 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 Request Configuration list is empty by default. To add a new Request Configuration loon to the Add New Instance section. Enter a custom name into the 'Name' field and click the 'Add' button: | The Request Configuration list is empty by default. To add a new Request Configuration loon to the Add New Instance section. Enter a custom name into the 'Name' field and click the 'Add' button: | ||
− | [[File: | + | [[File:Networking_rutos_manual_modbus_modbus_tcp_master_requests_configuration_add_new_instance.png|border|class=tlt-border]] |
The new Request Configuration should become visible in the list: | The new Request Configuration should become visible in the list: | ||
− | [[File: | + | [[File:Networking_rutos_manual_modbus_modbus_tcp_master_requests_configuration.png|border|class=tlt-border]] |
<table class="nd-mantable"> | <table class="nd-mantable"> | ||
Line 769: | Line 461: | ||
<tr> | <tr> | ||
<td>Data type</td> | <td>Data type</td> | ||
− | <td>8bit INT | + | <td>8bit INT <nowiki>|</nowiki> 8bit UINT <nowiki>|</nowiki> 16bit INT, high byte first <nowiki>|</nowiki> 16bit INT, low byte first <nowiki>|</nowiki> 16bit UINT, high byte first <nowiki>|</nowiki> 16bit UINT, low byte first <nowiki>|</nowiki> 32bit float, Byte order 1,2,3,4 <nowiki>|</nowiki> 32bit float, Byte order 4,3,2,1 <nowiki>|</nowiki> 32bit float, Byte order 2,1,4,3 <nowiki>|</nowiki> 32bit float, Byte order 3,4,1,2; default: <b>16bit INT, high byte first</b></td> |
<td>Defines how read data will be stored.</td> | <td>Defines how read data will be stored.</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>Function</td> | <td>Function</td> | ||
− | <td>Read coils (1) | + | <td>Read coils (1) <nowiki>|</nowiki> Read input coils (2) <nowiki>|</nowiki> Read holding registers (3) <nowiki>|</nowiki> Read input registers (4) <nowiki>|</nowiki> Set single coil (5) <nowiki>|</nowiki> Set single coil register (6) <nowiki>|</nowiki> Set multiple coils (15) <nowiki>|</nowiki> 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>Specifies the type of register being addressed by a Modbus request. | ||
</td> | </td> | ||
Line 789: | Line 481: | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
− | <td> | + | <td>No Brackets</td> |
− | <td>off | + | <td>off <nowiki>|</nowiki> on; default: <b>off</b></td> |
<td>Removes the starting and ending brackets from the request (only for read requests).</td> | <td>Removes the starting and ending brackets from the request (only for read requests).</td> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
</tr> | </tr> | ||
<tr> | <tr> | ||
Line 802: | Line 489: | ||
<td>- (interactive button)</td> | <td>- (interactive button)</td> | ||
<td>Deletes the request.</td> | <td>Deletes the request.</td> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td>off/on slider</td> | ||
+ | <td>off <nowiki>|</nowiki> on; default: <b>off</b></td> | ||
+ | <td>Turns the request on or off.</td> | ||
</tr> | </tr> | ||
</table> | </table> | ||
Line 807: | Line 499: | ||
<b>Additional note:</b> by default the newly added Request Configurations are turned off. You can use the on/off slider to the right of the Request Configuration to turn it on: | <b>Additional note:</b> by default the newly added Request Configurations are turned off. You can use the on/off slider to the right of the Request Configuration to turn it on: | ||
− | [[File: | + | [[File:Networking_rutos_manual_modbus_modbus_tcp_master_requests_configuration_on_off_slider.png|border|class=tlt-border]] |
---- | ---- | ||
− | After having configured a request, you should see a new 'Request Configuration Testing' section appear. It is used to check whether the configuration works correctly. Simply click the 'Test' button and a response should appear in the box below | + | After having configured a request, you should see a new 'Request Configuration Testing' section appear. It is used to check whether the configuration works correctly. Simply click the 'Test' button and a response should appear in the box below. A successful response to a test may look something like this: |
[[File:Networking_rutos_manual_modbus_modbus_tcp_master_requests_configuration_testing.png|border|class=tlt-border]] | [[File:Networking_rutos_manual_modbus_modbus_tcp_master_requests_configuration_testing.png|border|class=tlt-border]] | ||
− | =====Modbus | + | =====Modbus Master Alarms===== |
---- | ---- | ||
− | <b>Alarms</b> are a way of setting up automated actions when some Modbus values meet user-defined conditions. When the Modbus Serial | + | <b>Alarms</b> are a way of setting up automated actions when some Modbus values meet user-defined conditions. When the Modbus Serial Master (this {{{name}}} device) requests some information from a slave device it compares that data to with the parameters set in an Alarm Configuration. If the comparison meets the specified condition (more than, less than, equal to, not equal to), the Master performs a user-specified action, for example, a Modbus write request or switching the state of an output. |
− | The figure below is an example of the Modbus | + | The figure below is an example of the Modbus Master Alarms list. To create a new Alarm, click the 'Add' button. |
− | [[File: | + | [[File:Networking_rutos_manual_modbus_modbus_serial_master_modbus_master_alarms_add_button.png|border|class=tlt-border]] |
+ | |||
+ | Then click the 'Edit' button next to the newly created Alarm to configuration. | ||
+ | |||
+ | [[File:Networking_rutos_manual_modbus_modbus_serial_master_modbus_master_alarms_edit_button.png|border|class=tlt-border]] | ||
After this you should be redirected to that Alarm's configuration page which should look similar to this: | After this you should be redirected to that Alarm's configuration page which should look similar to this: | ||
− | [[File: | + | [[File:Networking_rutos_manual_modbus_modbus_serial_master_modbus_master_alarms_alarm_configuration.png|border|class=tlt-border]] |
<table class="nd-mantable"> | <table class="nd-mantable"> | ||
Line 833: | Line 529: | ||
<tr> | <tr> | ||
<td>Enabled</td> | <td>Enabled</td> | ||
− | <td>off | + | <td>off <nowiki>|</nowiki> on; default: <b>off</b></td> |
<td>Turns the alarm on or off.</td> | <td>Turns the alarm on or off.</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>Function code</td> | <td>Function code</td> | ||
− | <td>Read Coil Status (1) | + | <td>Read Coil Status (1) <nowiki>|</nowiki> Read Input Status (2) <nowiki>|</nowiki> Read Holding Registers (3) <nowiki>|</nowiki> Read Input Registers (4); default: <b>Read Coil Status (1)</b></td> |
− | <td>Modbus function used for this alarm's Modbus request. The Modbus TCP | + | <td>Modbus function used for this alarm's Modbus request. The Modbus TCP Master (this {{{name}}} device) perform this request as often as specified in the 'Period' field in [[#RS485_Slave_Device_Configuration|RS485 Slave Device Configuration]].</td> |
</tr> | </tr> | ||
<tr> | <tr> | ||
− | <td> | + | <td>Register</td> |
− | <td> | + | <td>integer [1..65536]; default: <b>none</b></td> |
− | <td> | + | <td>Number of the Modbus coil/input/holding-register/input-register to read from.</td> |
</tr> | </tr> | ||
<tr> | <tr> | ||
− | <td> | + | <td>Condition</td> |
− | <td> | + | <td>More than <nowiki>|</nowiki> Less than <nowiki>|</nowiki> Equal to <nowiki>|</nowiki> Not Equal to; default: <b>Equal to</b></td> |
− | <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> | ||
<tr> | <tr> | ||
− | <td> | + | <td>Value</td> |
<td>various; default: <b>none</b></td> | <td>various; default: <b>none</b></td> | ||
<td>The value against which the read data will be compared.</td> | <td>The value against which the read data will be compared.</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
− | <td> | + | <td>Value</td> |
− | <td> | + | <td>integer [0..65535]; default: <b>none</b></td> |
− | <td> | + | <td>The value against which the read data will be compared.</td> |
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>Action frequency</td> | <td>Action frequency</td> | ||
− | <td>Every trigger | + | <td>Every trigger <nowiki>|</nowiki> First trigger; default: <b>Every trigger</b></td> |
<td>Describes how frequently the specified action will be taken.</td> | <td>Describes how frequently the specified action will be taken.</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>Redundancy protection</td> | <td>Redundancy protection</td> | ||
− | <td>off | + | <td>off <nowiki>|</nowiki> on; default: <b>off</b></td> |
<td>Protection against executing a configured action too often.</td> | <td>Protection against executing a configured action too often.</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
− | <td | + | <td>Redundancy protection period</td> |
<td>integer [1..86400]; default: <b>none</b></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> | <td>Duration to activate redundancy protection for, measured in seconds. This field becomes visible only when 'Redundancy protection' is turned on.</td> | ||
Line 878: | Line 574: | ||
<tr> | <tr> | ||
<td>Action</td> | <td>Action</td> | ||
− | <td> | + | <td>SMS <nowiki>|</nowiki> MODBUS Write Request; default: <b>MODBUS Write Request</b></td> |
<td>Action that will be taken if the condition is met. Possible actions: | <td>Action that will be taken if the condition is met. Possible actions: | ||
− | <ul> | + | <ul> |
− | <li><b>SMS</b> - sends and SMS message to a specified recipient(s).</li> | + | <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 | + | <li><b>Modbus Request</b> - sends a Modbus Write request to a specified slave.</li> |
− | |||
</ul> | </ul> | ||
</td> | </td> | ||
− | </tr> | + | </tr> |
<tr> | <tr> | ||
<td><span style="color: #0054a6;">SMS: Message</span></td> | <td><span style="color: #0054a6;">SMS: Message</span></td> | ||
Line 896: | Line 591: | ||
<td>phone number; default: <b>none</b></td> | <td>phone number; default: <b>none</b></td> | ||
<td>Recipient's phone number.</td> | <td>Recipient's phone number.</td> | ||
− | </tr> | + | </tr> |
<tr> | <tr> | ||
<td><span style="color: purple;">MODBUS Write Request: Timeout</span></td> | <td><span style="color: purple;">MODBUS Write Request: Timeout</span></td> | ||
Line 905: | Line 600: | ||
<td><span style="color: purple;">MODBUS Write Request: ID</span></td> | <td><span style="color: purple;">MODBUS Write Request: ID</span></td> | ||
<td>integer [1..255]; default: <b>none</b></td> | <td>integer [1..255]; default: <b>none</b></td> | ||
− | <td>Modbus | + | <td>Modbus slave ID.</td> |
</tr> | </tr> | ||
<tr> | <tr> | ||
<td><span style="color: purple;">MODBUS Write Request: Modbus function</span></td> | <td><span style="color: purple;">MODBUS Write Request: Modbus function</span></td> | ||
− | <td>Read Single Coil (5) | + | <td>Read Force Single Coil (5) <nowiki>|</nowiki> Preset Single Register (6) <nowiki>|</nowiki> Force Multiple Coils (15) <nowiki>|</nowiki> 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> | <td>A function code specifies the type of register being addressed by a Modbus request.</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
− | + | <td><span style="color: purple;">MODBUS Write Request: First register</span></td> | |
− | |||
− | |||
− | |||
− | |||
− | <td><span style="color: purple;">MODBUS Write Request: First register | ||
<td>integer [0..65535]; default: <b>none</b></td> | <td>integer [0..65535]; default: <b>none</b></td> | ||
<td>Begins reading from the register specified in this field.</td> | <td>Begins reading from the register specified in this field.</td> | ||
Line 926: | Line 616: | ||
<td>integer [0..65535]; default: <b>none</b></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> | <td>Register/Coil values to be written (multiple values must be separated by space character).</td> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
</tr> | </tr> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
</table> | </table> | ||
− | |}} | + | |}}|}}{{#ifeq: {{{rs485}}} | 1 | |
− | {{#ifeq: {{{ | + | <h3>RS485</h3> |
− | |||
---- | ---- | ||
− | This section is used to configure the Modbus Serial | + | This section is used to configure the Modbus Serial Master's <b>RS485</b> serial interface settings. Refer to the figure and table below for information on RS485 configuration. |
− | [[File: | + | [[File:Networking_rutos_manual_modbus_modbus_serial_master_rs485_configuration.png|border|class=tlt-border]] |
<table class="nd-mantable"> | <table class="nd-mantable"> | ||
Line 957: | Line 633: | ||
<tr> | <tr> | ||
<td>Enabled</td> | <td>Enabled</td> | ||
− | <td>off | + | <td>off <nowiki>|</nowiki> on; default: <b>off</b></td> |
− | <td>Turns Modbus Serial | + | <td>Turns Modbus Serial Master configuration via RS232 on or off. Both this and RS232 from Services → [[{{{name}}} RS232|RS232]] cannot be enabled at the same time.</td> |
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>Baud rate</td> | <td>Baud rate</td> | ||
− | <td>300 | + | <td>300 <nowiki>|</nowiki> 1200 <nowiki>|</nowiki> 2400 <nowiki>|</nowiki> 4800 <nowiki>|</nowiki> 9600 <nowiki>|</nowiki> 19200 <nowiki>|</nowiki> 38400 <nowiki>|</nowiki> 57600 <nowiki>|</nowiki> 115200; default: <b>115200</b></td> |
<td>Serial data transmission rate (in bits per second).</td> | <td>Serial data transmission rate (in bits per second).</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>Data bits</td> | <td>Data bits</td> | ||
− | <td>5 | + | <td>5 <nowiki>|</nowiki> 6 <nowiki>|</nowiki> 7 <nowiki>|</nowiki> 8; default: <b>8</b></td> |
<td>Number of data bits for each character.</td> | <td>Number of data bits for each character.</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>Parity</td> | <td>Parity</td> | ||
− | <td>None | + | <td>None <nowiki>|</nowiki> Even <nowiki>|</nowiki> Odd; default: <b>None</b></td> |
<td>In serial transmission, parity is a method of detecting errors. An extra data bit is sent with each data character, arranged so that the number of 1 bits in each character, including the parity bit, is always odd or always even. If a byte is received with the wrong number of 1s, then it must have been corrupted. However, an even number of errors can pass the parity check. | <td>In serial transmission, parity is a method of detecting errors. An extra data bit is sent with each data character, arranged so that the number of 1 bits in each character, including the parity bit, is always odd or always even. If a byte is received with the wrong number of 1s, then it must have been corrupted. However, an even number of errors can pass the parity check. | ||
<ul> | <ul> | ||
Line 983: | Line 659: | ||
<tr> | <tr> | ||
<td>Stop bits</td> | <td>Stop bits</td> | ||
− | <td>1 | + | <td>1 <nowiki>|</nowiki> 2; default: <b>1</b></td> |
<td>Stop bits sent at the end of every character allow the receiving signal hardware to detect the end of a character and to resynchronise with the character stream. Electronic devices usually use one stop bit. Two stop bits are required if slow electromechanical devices are used.</td> | <td>Stop bits sent at the end of every character allow the receiving signal hardware to detect the end of a character and to resynchronise with the character stream. Electronic devices usually use one stop bit. Two stop bits are required if slow electromechanical devices are used.</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>Flow control</td> | <td>Flow control</td> | ||
− | <td>None | + | <td>None <nowiki>|</nowiki> RTS/CTS <nowiki>|</nowiki> Xon/Xoff; default: <b>None</b></td> |
<td>In many circumstances a transmitter might be able to send data faster than the receiver is able to process it. To cope with this, serial lines often incorporate a "handshaking" method, usually distinguished between hardware and software handshaking. | <td>In many circumstances a transmitter might be able to send data faster than the receiver is able to process it. To cope with this, serial lines often incorporate a "handshaking" method, usually distinguished between hardware and software handshaking. | ||
<ul> | <ul> | ||
Line 998: | Line 674: | ||
</table> | </table> | ||
− | ==== | + | ====RS485 Slave Devices List==== |
---- | ---- | ||
− | The <b> | + | The <b>RS485 Slave Devices List</b> section is used to configure the parameters of Modbus RUT slaves that the Master (this {{{name}}} device) will be querying with requests. |
+ | |||
+ | The list is empty by default. In order to create a new slave device configuration, click the 'Add' button. | ||
− | + | [[File:Networking_rutos_manual_modbus_modbus_serial_master_rs485_slave_devices_list_add_button.png|border|class=tlt-border]] | |
− | + | Then click the 'Edit' button next to the newly added slave device in order to begin configuration. | |
− | ===== | + | [[File:Networking_rutos_manual_modbus_modbus_serial_master_rs485_slave_devices_list_edit_button.png|border|class=tlt-border]] |
+ | |||
+ | =====RS485 Slave Device Configuration===== | ||
---- | ---- | ||
− | The <b> | + | The <b>RS485 Slave Device Configuration</b> section is used to configure the parameters of Modbus RTU slaves that the Master (this {{{name}}} device) will be querying with requests. The figure below is an example of the RS485 Slave Device Configuration and the table below provides information on the fields contained in that section: |
− | [[File: | + | [[File:Networking_rutos_manual_modbus_modbus_serial_master_rs485_slave_device_configuration.png|border|class=tlt-border]] |
<table class="nd-mantable"> | <table class="nd-mantable"> | ||
Line 1,020: | Line 700: | ||
<tr> | <tr> | ||
<td>Enabled</td> | <td>Enabled</td> | ||
− | <td>off | + | <td>off <nowiki>|</nowiki> on; default: <b>off</b></td> |
− | <td>Turns communication with the | + | <td>Turns communication with the slave device on or off.</td> |
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>Name</td> | <td>Name</td> | ||
<td>string; default: <b>none</b></td> | <td>string; default: <b>none</b></td> | ||
− | <td> | + | <td>Slave device's name, used for easier management purposes.</td> |
</tr> | </tr> | ||
<tr> | <tr> | ||
− | <td> | + | <td>Slave ID</td> |
<td>integer [0..255]; default: <b>none</b></td> | <td>integer [0..255]; default: <b>none</b></td> | ||
− | <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> | ||
<tr> | <tr> | ||
<td>Period</td> | <td>Period</td> | ||
<td>integer [1..86400]; default: <b>60</b></td> | <td>integer [1..86400]; default: <b>60</b></td> | ||
− | <td>Interval at which requests are sent to the | + | <td>Interval at which requests are sent to the slave device.</td> |
</tr> | </tr> | ||
<tr> | <tr> | ||
Line 1,046: | Line 726: | ||
=====Requests Configuration===== | =====Requests Configuration===== | ||
---- | ---- | ||
− | A Modbus <b>request</b> is a way of obtaining data from Modbus | + | 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 Request Configuration list is empty by default. To add a new Request Configuration loon to the Add New Instance section. Enter a custom name into the 'Name' field and click the 'Add' button: | The Request Configuration list is empty by default. To add a new Request Configuration loon to the Add New Instance section. Enter a custom name into the 'Name' field and click the 'Add' button: | ||
Line 1,056: | Line 734: | ||
The new Request Configuration should become visible in the list: | The new Request Configuration should become visible in the list: | ||
− | [[File: | + | [[File:Networking_rutos_manual_modbus_modbus_tcp_master_requests_configuration.png|border|class=tlt-border]] |
<table class="nd-mantable"> | <table class="nd-mantable"> | ||
Line 1,071: | Line 749: | ||
<tr> | <tr> | ||
<td>Data type</td> | <td>Data type</td> | ||
− | <td>8bit INT | + | <td>8bit INT <nowiki>|</nowiki> 8bit UINT <nowiki>|</nowiki> 16bit INT, high byte first <nowiki>|</nowiki> 16bit INT, low byte first <nowiki>|</nowiki> 16bit UINT, high byte first <nowiki>|</nowiki> 16bit UINT, low byte first <nowiki>|</nowiki> 32bit float, Byte order 1,2,3,4 <nowiki>|</nowiki> 32bit float, Byte order 4,3,2,1 <nowiki>|</nowiki> 32bit float, Byte order 2,1,4,3 <nowiki>|</nowiki> 32bit float, Byte order 3,4,1,2; default: <b>16bit INT, high byte first</b></td> |
<td>Defines how read data will be stored.</td> | <td>Defines how read data will be stored.</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>Function</td> | <td>Function</td> | ||
− | <td>Read coils (1) | + | <td>Read coils (1) <nowiki>|</nowiki> Read input coils (2) <nowiki>|</nowiki> Read holding registers (3) <nowiki>|</nowiki> Read input registers (4) <nowiki>|</nowiki> Set single coil (5) <nowiki>|</nowiki> Set single coil register (6) <nowiki>|</nowiki> Set multiple coils (15) <nowiki>|</nowiki> 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>Specifies the type of register being addressed by a Modbus request. | ||
</td> | </td> | ||
Line 1,091: | Line 769: | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
− | <td> | + | <td>No Brackets</td> |
− | <td>off | + | <td>off <nowiki>|</nowiki> on; default: <b>off</b></td> |
<td>Removes the starting and ending brackets from the request (only for read requests).</td> | <td>Removes the starting and ending brackets from the request (only for read requests).</td> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
</tr> | </tr> | ||
<tr> | <tr> | ||
Line 1,104: | Line 777: | ||
<td>- (interactive button)</td> | <td>- (interactive button)</td> | ||
<td>Deletes the request.</td> | <td>Deletes the request.</td> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td>off/on slider</td> | ||
+ | <td>off <nowiki>|</nowiki> on; default: <b>off</b></td> | ||
+ | <td>Turns the request on or off.</td> | ||
</tr> | </tr> | ||
</table> | </table> | ||
Line 1,115: | Line 793: | ||
[[File:Networking_rutos_manual_modbus_modbus_tcp_master_requests_configuration_testing.png|border|class=tlt-border]] | [[File:Networking_rutos_manual_modbus_modbus_tcp_master_requests_configuration_testing.png|border|class=tlt-border]] | ||
− | =====Modbus | + | =====Modbus Master Alarms===== |
---- | ---- | ||
− | <b>Alarms</b> are a way of setting up automated actions when some Modbus values meet user-defined conditions. When the Modbus Serial | + | <b>Alarms</b> are a way of setting up automated actions when some Modbus values meet user-defined conditions. When the Modbus Serial Master (this {{{name}}} device) requests some information from a slave device it compares that data to with the parameters set in an Alarm Configuration. If the comparison meets the specified condition (more than, less than, equal to, not equal to), the Master performs a user-specified action, for example, a Modbus write request or switching the state of an output. |
− | The figure below is an example of the Modbus | + | The figure below is an example of the Modbus Master Alarms list. To create a new Alarm, click the 'Add' button. |
[[File:Networking_rutos_manual_modbus_modbus_serial_master_modbus_master_alarms_add_button.png|border|class=tlt-border]] | [[File:Networking_rutos_manual_modbus_modbus_serial_master_modbus_master_alarms_add_button.png|border|class=tlt-border]] | ||
+ | |||
+ | Then click the 'Edit' button next to the newly created Alarm to configuration. | ||
+ | |||
+ | [[File:Networking_rutos_manual_modbus_modbus_serial_master_modbus_master_alarms_edit_button.png|border|class=tlt-border]] | ||
After this you should be redirected to that Alarm's configuration page which should look similar to this: | After this you should be redirected to that Alarm's configuration page which should look similar to this: | ||
− | [[File: | + | [[File:Networking_rutos_manual_modbus_modbus_serial_master_modbus_master_alarms_alarm_configuration.png|border|class=tlt-border]] |
<table class="nd-mantable"> | <table class="nd-mantable"> | ||
Line 1,135: | Line 817: | ||
<tr> | <tr> | ||
<td>Enabled</td> | <td>Enabled</td> | ||
− | <td>off | + | <td>off <nowiki>|</nowiki> on; default: <b>off</b></td> |
<td>Turns the alarm on or off.</td> | <td>Turns the alarm on or off.</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>Function code</td> | <td>Function code</td> | ||
− | <td>Read Coil Status (1) | + | <td>Read Coil Status (1) <nowiki>|</nowiki> Read Input Status (2) <nowiki>|</nowiki> Read Holding Registers (3) <nowiki>|</nowiki> Read Input Registers (4); default: <b>Read Coil Status (1)</b></td> |
− | <td>Modbus function used for this alarm's Modbus request. The Modbus TCP | + | <td>Modbus function used for this alarm's Modbus request. The Modbus TCP Master (this {{{name}}} device) perform this request as often as specified in the 'Period' field in [[#RS485_Slave_Device_Configuration|RS485 Slave Device Configuration]].</td> |
</tr> | </tr> | ||
<tr> | <tr> | ||
− | <td> | + | <td>Register</td> |
− | <td> | + | <td>integer [1..65536]; default: <b>none</b></td> |
− | <td> | + | <td>Number of the Modbus coil/input/holding-register/input-register to read from.</td> |
</tr> | </tr> | ||
<tr> | <tr> | ||
− | <td> | + | <td>Condition</td> |
− | <td> | + | <td>More than <nowiki>|</nowiki> Less than <nowiki>|</nowiki> Equal to <nowiki>|</nowiki> Not Equal to; default: <b>Equal to</b></td> |
− | <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> | ||
<tr> | <tr> | ||
− | <td> | + | <td>Value</td> |
<td>various; default: <b>none</b></td> | <td>various; default: <b>none</b></td> | ||
<td>The value against which the read data will be compared.</td> | <td>The value against which the read data will be compared.</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
− | <td> | + | <td>Value</td> |
− | <td> | + | <td>integer [0..65535]; default: <b>none</b></td> |
− | <td> | + | <td>The value against which the read data will be compared.</td> |
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>Action frequency</td> | <td>Action frequency</td> | ||
− | <td>Every trigger | + | <td>Every trigger <nowiki>|</nowiki> First trigger; default: <b>Every trigger</b></td> |
<td>Describes how frequently the specified action will be taken.</td> | <td>Describes how frequently the specified action will be taken.</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>Redundancy protection</td> | <td>Redundancy protection</td> | ||
− | <td>off | + | <td>off <nowiki>|</nowiki> on; default: <b>off</b></td> |
<td>Protection against executing a configured action too often.</td> | <td>Protection against executing a configured action too often.</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
− | <td | + | <td>Redundancy protection period</td> |
<td>integer [1..86400]; default: <b>none</b></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> | <td>Duration to activate redundancy protection for, measured in seconds. This field becomes visible only when 'Redundancy protection' is turned on.</td> | ||
Line 1,180: | Line 862: | ||
<tr> | <tr> | ||
<td>Action</td> | <td>Action</td> | ||
− | <td> | + | <td>SMS <nowiki>|</nowiki> MODBUS Write Request; default: <b>MODBUS Write Request</b></td> |
<td>Action that will be taken if the condition is met. Possible actions: | <td>Action that will be taken if the condition is met. Possible actions: | ||
− | <ul> | + | <ul> |
− | <li><b>SMS</b> - sends and SMS message to a specified recipient(s).</li> | + | <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 | + | <li><b>Modbus Request</b> - sends a Modbus Write request to a specified slave.</li> |
</ul> | </ul> | ||
</td> | </td> | ||
− | </tr> | + | </tr> |
<tr> | <tr> | ||
<td><span style="color: #0054a6;">SMS: Message</span></td> | <td><span style="color: #0054a6;">SMS: Message</span></td> | ||
Line 1,197: | Line 879: | ||
<td>phone number; default: <b>none</b></td> | <td>phone number; default: <b>none</b></td> | ||
<td>Recipient's phone number.</td> | <td>Recipient's phone number.</td> | ||
− | </tr> | + | </tr> |
<tr> | <tr> | ||
<td><span style="color: purple;">MODBUS Write Request: Timeout</span></td> | <td><span style="color: purple;">MODBUS Write Request: Timeout</span></td> | ||
Line 1,206: | Line 888: | ||
<td><span style="color: purple;">MODBUS Write Request: ID</span></td> | <td><span style="color: purple;">MODBUS Write Request: ID</span></td> | ||
<td>integer [1..255]; default: <b>none</b></td> | <td>integer [1..255]; default: <b>none</b></td> | ||
− | <td>Modbus | + | <td>Modbus slave ID.</td> |
</tr> | </tr> | ||
<tr> | <tr> | ||
<td><span style="color: purple;">MODBUS Write Request: Modbus function</span></td> | <td><span style="color: purple;">MODBUS Write Request: Modbus function</span></td> | ||
− | <td>Read Single Coil (5) | + | <td>Read Force Single Coil (5) <nowiki>|</nowiki> Preset Single Register (6) <nowiki>|</nowiki> Force Multiple Coils (15) <nowiki>|</nowiki> 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> | <td>A function code specifies the type of register being addressed by a Modbus request.</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
− | + | <td><span style="color: purple;">MODBUS Write Request: First register</span></td> | |
− | |||
− | |||
− | |||
− | |||
− | <td><span style="color: purple;">MODBUS Write Request: First register | ||
<td>integer [0..65535]; default: <b>none</b></td> | <td>integer [0..65535]; default: <b>none</b></td> | ||
<td>Begins reading from the register specified in this field.</td> | <td>Begins reading from the register specified in this field.</td> | ||
Line 1,230: | Line 907: | ||
</table> | </table> | ||
|}} | |}} | ||
+ | ==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. | |
− | |||
− | The <b>MQTT | ||
− | |||
− | |||
− | |||
− | |||
− | + | [[File:Networking_rutos_manual_modbus_mqtt_gateway.png|border|class=tlt-border]] | |
− | |||
− | [[File: | ||
<table class="nd-mantable"> | <table class="nd-mantable"> | ||
Line 1,251: | Line 921: | ||
<tr> | <tr> | ||
<td>Enable</td> | <td>Enable</td> | ||
− | <td>off | + | <td>off <nowiki>|</nowiki> on; default: <b>off</b></td> |
<td>Turns MQTT gateway on or off.</td> | <td>Turns MQTT gateway on or off.</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>Host</td> | <td>Host</td> | ||
− | <td>ip | + | <td>ip <nowiki>|</nowiki> host; default: <b>127.0.0.1</b></td> |
<td>IP address or hostname of an MQTT broker.</td> | <td>IP address or hostname of an MQTT broker.</td> | ||
</tr> | </tr> | ||
Line 1,273: | Line 943: | ||
<td>alphanumeric string; default: <b>response</b></td> | <td>alphanumeric string; default: <b>response</b></td> | ||
<td>MQTT topic for subscribing to responses.</td> | <td>MQTT topic for subscribing to responses.</td> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
</tr> | </tr> | ||
<tr> | <tr> | ||
Line 1,288: | Line 953: | ||
<td>string; default: <b>none</b></td> | <td>string; default: <b>none</b></td> | ||
<td>Password for authentication to the MQTT broker.</td> | <td>Password for authentication to the MQTT broker.</td> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
</tr> | </tr> | ||
</table> | </table> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
===Request messages=== | ===Request messages=== | ||
---- | ---- | ||
− | + | Modbus request data sent in the MQTT payload should be generated in accordance with the following format: | |
− | + | <b>0 <COOKIE> <IP_TYPE> <IP> <PORT> <TIMEOUT> <SLAVE_ID> <MODBUS_FUNCTION> <REGISTER_NUMBER> <REGISTER_COUNT/VALUE></b> | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
Explanation: | Explanation: | ||
<ul> | <ul> | ||
− | <li><b>Cookie</b> - a 64-bit unsigned integer in range [0..2<sup>64</sup> | + | <li><b>0</b> - must be 0, which signifies a textual format (currently the only one implemented).</li> |
+ | <li><b>Cookie</b> - a 64-bit unsigned integer in range [0..2<sup>64</sup>]). A cookie is used in order to distinguish which response belongs to which request, each request and the corresponding response contain a matching cookie: a 64-bit unsigned integer.</li> | ||
<li><b>IP type</b> - host IP address type. Possible values: | <li><b>IP type</b> - host IP address type. Possible values: | ||
<ul> | <ul> | ||
Line 1,446: | Line 972: | ||
<li><b>1</b> - IPv6 address;</li> | <li><b>1</b> - IPv6 address;</li> | ||
<li><b>2</b> - hostname that will be resolved to an IP address.</li> | <li><b>2</b> - hostname that will be resolved to an IP address.</li> | ||
− | </ul> | + | </ul></li> |
− | + | <li><b>IP</b> - IP address of a Modbus TCP slave. IPv6 must be presented in full form (e.g., <i>2001:0db8:0000:0000:0000:8a2e:0370:7334</i>).</li> | |
− | <li><b>IP</b> - IP address of a Modbus TCP | + | <li><b>Port</b> - port number of the Modbus TCP slave.</li> |
− | <li><b>Port</b> - port number of the Modbus TCP | + | <li><b>Timeout</b> - timeoutfor Modbus TCP connection, in seconds. Range [1..999].</li> |
− | <li><b>Timeout</b> - | + | <li><b>Slave ID</b> - Modbus TCP slave ID. Range [1..255].</li> |
− | <li><b> | + | <li><b>Modbus function</b> - Only these are supported at the moment: |
− | <li><b>Modbus function</b> - | ||
<ul> | <ul> | ||
− | |||
− | |||
<li><b>3</b> - read holding registers;</li> | <li><b>3</b> - read holding registers;</li> | ||
− | |||
− | |||
<li><b>6</b> - write to a single holding register;</li> | <li><b>6</b> - write to a single holding register;</li> | ||
− | |||
<li><b>16</b> - write to multiple holding registers.</li> | <li><b>16</b> - write to multiple holding registers.</li> | ||
− | </ul> | + | </ul></li> |
− | + | <li><b>Register number</b> - number of the first register (in range [1..65536]) from which the registers will be read/written to. | |
− | <li><b> | ||
<li><b>Register count/value</b> - this value depends on the Modbus function: | <li><b>Register count/value</b> - this value depends on the Modbus function: | ||
<ul> | <ul> | ||
− | + | <li><b>3</b> - <u>register count</u> (in range [1..125]); must not exceed the boundary (first register number + register count <= 65537);</li> | |
− | + | <li><b>6</b> - <u>register value</u> (in range [0..65535]);</li> | |
− | <li><b>3</b> - <u> | ||
− | |||
− | |||
− | <li><b>6</b> - <u> | ||
− | |||
<li><b>16</b> - <u>register count</u> (in range [1..123]); must not exceed the boundary (first register number + register count <= 65537); and <u>register values</u> separated with commas, without spaces (e.g., <i>1,2,3,654,21,789</i>); there must be exactly as many values as specified (with register count); each value must be in the range of [0..65535].</li> | <li><b>16</b> - <u>register count</u> (in range [1..123]); must not exceed the boundary (first register number + register count <= 65537); and <u>register values</u> separated with commas, without spaces (e.g., <i>1,2,3,654,21,789</i>); there must be exactly as many values as specified (with register count); each value must be in the range of [0..65535].</li> | ||
− | </ul> | + | </ul></li> |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
</ul> | </ul> | ||
Line 1,499: | Line 1,002: | ||
===Examples=== | ===Examples=== | ||
---- | ---- | ||
− | Below are a few <b>examples</b> of controlling/monitoring the internal Modbus TCP | + | Below are a few <b>examples</b> of controlling/monitoring the internal Modbus TCP Slave on {{{name}}}. |
---- | ---- | ||
<b>Reboot the device</b> | <b>Reboot the device</b> | ||
Line 1,524: | Line 1,027: | ||
65432 OK 0 5590</pre></li> | 65432 OK 0 5590</pre></li> | ||
</ul> | </ul> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
==See also== | ==See also== | ||
− | + | {{Template: Networking_device_modbus_see_also}} | |
− | |||
− | |||
[[Category:{{{name}}} Services section]] | [[Category:{{{name}}} Services section]] |
Revision as of 13:33, 1 September 2020
Template:Networking rutos manual fw disclosure
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 {{{name}}} 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 "Advanced" button, located at the top of the WebUI.
Modbus TCP slave
A 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:
Field | Value | Description |
---|---|---|
Enable | off | on; default: none | Turns Modbus TCP on or off. |
Port | integer [0..65535]; default: 502 | TCP port used for Modbus communications. |
Device ID | integer [0..255]; default: 1 | The device's Modbus slave ID. When set to 0, it will respond to requests addressed to any ID. |
Allow Remote Access | off | on; default: off | Allows remote Modbus connections by adding an exception to the device's firewall on the port specified in the field above. |
Keep persistent connection | off | on; default: off | Allows keep the connection open after responding a Modbus TCP master request. |
Connection timeout | integer; default: 0 | Sets TCP timeout in seconds after which the connection is forcefully closed. |
Enable custom register block | off | on; default: off | Allows the usage of 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 value | register address | register number | number of registers | representation |
---|---|---|---|---|
System uptime | 1 | 2 | 2 | 32 bit unsigned integer |
System hostname | 7 | 8 | 16 | Text |
Router serial number | 39 | 40 | 16 | Text |
LAN MAC address | 55 | 56 | 16 | Text |
Router name | 71 | 72 | 16 | Text |
Current WAN IP address | 139 | 140 | 2 | 8 bit unsigned integer |
Digital non-isolated input | 324 | 325 | 1 | 16 bit unsigned integer |
Digital open collector output | 325 | 326 | 1 | 16 bit unsigned integer |
PIN 3 direction | 326 | 327 | 1 | 16 bit unsigned integer |
PIN 4 direction | 327 | 328 | 1 | 16 bit unsigned integer |
Unix timestamp | 364 | 365 | 2 | 32 bit unsigned integer |
Local ISO time | 366 | 367 | 12 | Text |
UTC time | 378 | 379 | 12 | Text |
LAN IP | 394 | 395 | 2 | 8 bit unsigned integer |
Set Parameters
The Modbus daemon can also set some device parameters.
value to set | register address | register number | register value | description |
---|---|---|---|---|
Hostname | 7 | 8 | Hostname (in decimal form) | Changes hostname |
Device name | 71 | 72 | Device name (in decimal form) | Changes device name |
Reboot | 206 | 207 | 1 | Reboots the router |
Switch PIN 3 state | 324 | 325 | 1|0 | Toggles PIN 3 ON or OFF, when output is selected |
Switch PIN 4 state | 325 | 326 | 1|0 | Toggles PIN 4 ON or OFF, when output is selected |
Switch PIN 3 direction | 326 | 327 | 1|0 | Toggles PIN 3 direction between INPUT (0) or OUTPUT (1) |
Switch PIN 4 direction | 327 | 328 | 1|0 | Toggles PIN 4 direction between INPUT (0) or OUTPUT (1) |
Change LAN IP | 394 | 395 | IPv4 (in decimal form) | Changes device LAN IP |
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. By default, the slave list is empty. To add a new slave, click the 'Add' button
After clicking 'Add' you will be redirected to the newly added slave's configuration page.
You can create a maximum of 10 slave configurations.
Slave Device Configuration
The Slave Device Configuration section is used to configure the parameters of Modbus TCP slaves that the Master (this {{{name}}} device) will be querying with requests. The figure below is an example of the Slave Device Configuration and the table below provides information on the fields contained in that section:
Field | Value | Description |
---|---|---|
Enabled | off | on; default: off | Turns communication with the slave device on or off. |
Name | string; default: none | Slave device's name, used for easier management purposes. |
Slave ID | integer [0..255]; default: none | 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. |
IP address | ip; default: none | Slave device's IP address. |
Port | integer [0..65535]; default: none | Slave device's Modbus TCP port. |
Period | integer [1..86400]; default: 60 | Interval at which requests are sent to the slave device. |
Timeout | integer [1..30]; default: 5 | Maximum 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 Request Configuration list is empty by default. To add a new Request Configuration loon to the Add New Instance section. Enter a custom name into the 'Name' field and click the 'Add' button:
The new Request Configuration should become visible in the list:
Field | Value | Description |
---|---|---|
Name | string; default: Unnamed | Name of this Request Configuration. Used for easier management purposes. |
Data type | 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: 16bit INT, high byte first | Defines how read data will be stored. |
Function | 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: Read holding registers (3) | Specifies the type of register being addressed by a Modbus request. |
First Register | integer [0..65535]; default: 1 | First Modbus register from which data will be read. |
Register Count / Values | integer [1..2000]; default: 1 | Number of Modbus registers that will be read during the request. |
No Brackets | off | on; default: off | Removes the starting and ending brackets from the request (only for read requests). |
Delete [ X ] | - (interactive button) | Deletes the request. |
off/on slider | off | on; default: off | Turns the request on or off. |
Additional note: by default the newly added Request Configurations are turned off. You can use the on/off slider to the right of the Request Configuration to turn it on:
After having configured a request, you should see a new 'Request Configuration Testing' section appear. It is used to check whether the configuration works correctly. Simply click the 'Test' button and a response should appear in the box below. A successful response to a test may look something like this:
Alarms Configuration
Alarms are a way of setting up automated actions when some Modbus values meet user-defined conditions. When the Modbus TCP Master (this {{{name}}} device) requests some information from a slave device it compares that data to with the parameters set in an Alarm Configuration. If the comparison meets the specified condition (more than, less than, equal to, not equal to), the Master performs a user-specified action, for example, a Modbus write request or switching the state of an output.
The figure below is an example of the Alarms Configuration list. To create a new Alarm, click the 'Add' button.
After adding the Alarm you should be redirected to its configuration page which should look similar to this:
Field | Value | Description |
---|---|---|
Enabled | off | on; default: off | Turns the alarm on or off. |
Function code | Read 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. The Modbus TCP Master (this {{{name}}} device) perform this request as often as specified in the 'Period' field in Slave Device Configuration. |
Register | integer [1..65536]; default: none | Number of the Modbus coil/input/holding-register/input-register to read from. |
Condition | More than | Less than | Equal to | Not Equal to; default: Equal to | 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. |
Value | various; default: none | The value against which the read data will be compared. |
Value | integer [0..65535]; default: none | The value against which the read data will be compared. |
Action frequency | Every trigger | First trigger; default: Every trigger | Describes how frequently the specified action will be taken. |
Redundancy protection | off | on; default: off | Protection against executing a configured action too often. |
Redundancy protection period | integer [1..86400]; default: none | Duration to activate redundancy protection for, measured in seconds. This field becomes visible only when 'Redundancy protection' is turned on. |
Action | SMS | MODBUS Write Request; default: MODBUS Write Request | Action that will be taken if the condition is met. Possible actions:
|
SMS: Message | string; default: none | SMS message text. |
SMS: Phone number | phone number; default: none | Recipient's phone number. |
MODBUS Write Request: IP address | ip | host; default: none | Modbus slave's IP address. |
MODBUS Write Request: Port | integer [0..65535]; default: none | Modbus slave's port. |
MODBUS Write Request: Timeout | integer [1..30]; default: 5 | Maximum time to wait for a response. |
MODBUS Write Request: ID | integer [1..255]; default: none | Modbus slave ID. |
MODBUS Write Request: Modbus function | Read 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 register | integer [0..65535]; default: none | Begins reading from the register specified in this field. |
MODBUS Write Request: Values | integer [0..65535]; default: none | Register/Coil values to be written (multiple values must be separated by space character). |
MQTT Gateway
The MQTT Gateway function is used to transfer Modbus data over MQTT. Refer to the table for information on MQTT Gateway configuration fields.
Field | Value | Description |
---|---|---|
Enable | off | on; default: off | Turns MQTT gateway on or off. |
Host | ip | host; default: 127.0.0.1 | IP address or hostname of an MQTT broker. |
Port | integer [0..65535]; default: 1883 | Port number of the MQTT broker. |
Request topic | alphanumeric string; default: request | MQTT topic for sending requests. |
Response topic | alphanumeric string; default: response | MQTT topic for subscribing to responses. |
Username | string; default: none | Username for authentication to the MQTT broker. |
Password | string; default: none | Password for authentication to the MQTT broker. |
Request messages
Modbus request data sent in the MQTT payload should be generated in accordance with the following format:
0 <COOKIE> <IP_TYPE> <IP> <PORT> <TIMEOUT> <SLAVE_ID> <MODBUS_FUNCTION> <REGISTER_NUMBER> <REGISTER_COUNT/VALUE>
Explanation:
- 0 - must be 0, which signifies a textual format (currently the only one implemented).
- Cookie - a 64-bit unsigned integer in range [0..264]). A cookie is used in order to distinguish which response belongs to which request, each request and the corresponding response contain a matching cookie: a 64-bit unsigned integer.
- IP type - host IP address type. Possible values:
- 0 - IPv4 address;
- 1 - IPv6 address;
- 2 - hostname that will be resolved to an IP address.
- IP - IP address of a Modbus TCP slave. IPv6 must be presented in full form (e.g., 2001:0db8:0000:0000:0000:8a2e:0370:7334).
- Port - port number of the Modbus TCP slave.
- Timeout - timeoutfor Modbus TCP connection, in seconds. Range [1..999].
- Slave ID - Modbus TCP slave ID. Range [1..255].
- Modbus function - Only these are supported at the moment:
- 3 - read holding registers;
- 6 - write to a single holding register;
- 16 - write to multiple holding registers.
- Register number - number of the first register (in range [1..65536]) from which the registers will be read/written to.
- Register count/value - this value depends on the Modbus function:
- 3 - register count (in range [1..125]); must not exceed the boundary (first register number + register count <= 65537);
- 6 - register value (in range [0..65535]);
- 16 - register count (in range [1..123]); must not exceed the boundary (first register number + register count <= 65537); and register values separated with commas, without spaces (e.g., 1,2,3,654,21,789); there must be exactly as many values as specified (with register count); each value must be in the range of [0..65535].
Response messages
A special response message can take one of the following forms:
<COOKIE> OK - for functions 6 and 16 <COOKIE> OK <VALUE> <VALUE> <VALUE>... - for function 3, where <VALUE> <VALUE> <VALUE>... are read register values <COOKIE> ERROR: ... - for failures, where ... is the error description
Examples
Below are a few examples of controlling/monitoring the internal Modbus TCP Slave on {{{name}}}.
Reboot the device
- Request:
0 65432 0 192.168.1.1 502 5 1 6 206 1
- Response:
65432 OK
Retrieve uptime
- Request:
0 65432 0 192.168.1.1 502 5 1 3 2 2
- Response:
65432 OK 0 5590
If you're using Eclipse Mosquitto (MQTT implementation used on {{{name}}}), Publish/Subscribe commands may look something like this:
Retrieve uptime
- Request:
mosquitto_pub -h 192.168.1.1 -p 1883 -t request -m "0 65432 0 192.168.1.1 502 5 1 3 2 2"
- Response:
mosquitto_sub -h 192.168.1.1 -p 1883 -t response 65432 OK 0 5590
See also
Template:Networking device modbus see also
[[Category:{{{name}}} Services section]]