Template:Networking rut manual modbus: Difference between revisions
Gytispieze (talk | contribs) m (Text replacement - "\{\{Template: Networking_rutos_manual_fw_disclosure (.*) (.*) (.*) (.*) \}\}" to "{{Template: Networking_device_manual_fw_disclosure | series = {{{series}}} | name = {{{name}}} | fw_version ={{Template: Networking_device_manual_latest_fw | series = {{{series}}} | name = {{{name}}} }} }}") Tags: Mobile edit Mobile web edit |
No edit summary |
||
(21 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
{{Template: | {{Template: Networking_rutxxx_manual_fw_disclosure | ||
| | | fw_version = {{#switch: {{{series}}} | ||
| | | RUT2XX = {{{series}}}_R_00.01.13 | ||
| | | RUT9XX = {{{series}}}_R_00.06.06}} | ||
| series = {{{series}}} | |||
}} | }} | ||
==Summary== | ==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. | <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 chapter is an overview of the Modbus TCP functionality for {{{name}}} devices. | ||
This chapter | |||
==Modbus TCP== | ==Modbus TCP== | ||
Line 19: | Line 15: | ||
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_rut9xx_manual_modbus_modbus_tcp_v2.png|border|class=tlt-border]] | ||
{{Template: Networking_rut9xx_manual_modbus_modbus_tcp_table}} | |||
===Get Parameters=== | ===Get Parameters=== | ||
Line 68: | Line 23: | ||
Modbus parameters are held within <b>registers</b>. 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: | Modbus parameters are held within <b>registers</b>. 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: | ||
<br> <br> | <br> <br> | ||
{{#ifeq: {{{series}}} | | {{#ifeq: {{{series}}} | RUT2 | ||
| {{Template: Networking_{{lc:{{{series}}}}} | | {{Template: Networking_{{lc:{{{series}}}}}xx_manual_modbus_modbus_tcp_get_parameters_table}} | ||
| {{Template: Networking_{{lc:{{{name}}}}}_manual_modbus_modbus_tcp_get_parameters_table}} | | {{Template: Networking_{{lc:{{{name}}}}}_manual_modbus_modbus_tcp_get_parameters_table}} | ||
}} | }} | ||
{{#ifeq: {{{series}}} | | {{#ifeq: {{{series}}} | RUT2 | ||
| {{Template: Networking_device_manual_modbus_modbus_tcp_get_parameters_table_asterisk}} | | {{Template: Networking_device_manual_modbus_modbus_tcp_get_parameters_table_asterisk}} | ||
| | | | ||
Line 79: | Line 34: | ||
---- | ---- | ||
The Modbus daemon can also set some device parameters. These parameters and explanations on how to use them are described in the table below: | The Modbus daemon can also set some device parameters. These parameters and explanations on how to use them are described in the table below: | ||
<br><br> | <br> <br> | ||
{{#ifeq: {{{series}}} | | {{#ifeq: {{{series}}} | RUT2 | ||
| {{Template: Networking_{{lc:{{{series}}}}} | | {{Template: Networking_{{lc:{{{series}}}}}xx_manual_modbus_modbus_tcp_set_parameters_table}} | ||
| {{Template: Networking_{{lc:{{{name}}}}}_manual_modbus_modbus_tcp_set_parameters_table}} | | {{Template: Networking_{{lc:{{{name}}}}}_manual_modbus_modbus_tcp_set_parameters_table}} | ||
}} | }} | ||
Line 100: | Line 55: | ||
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: | 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: | [[File:{{{file_slave_configuration}}}]] | ||
<table class="nd-mantable"> | <table class="nd-mantable"> | ||
Line 135: | Line 90: | ||
<tr> | <tr> | ||
<td>Period</td> | <td>Period</td> | ||
<td>integer [1..6400]; default: <b> | <td>integer [1..6400]; default: <b>none</b></td> | ||
<td>Interval at which requests are sent to the slave device.</td> | <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..30]; default: <b> | <td>integer [1..30]; default: <b>none</b></td> | ||
<td>Maximum response wait time.</td> | <td>Maximum response wait time.</td> | ||
</tr> | </tr> | ||
Line 151: | Line 106: | ||
The figure below is an example of the Requests configuration section and the table below provides information contained in the fields of that section: | 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: | [[File:{{{file_requests}}}]] | ||
<table class="nd-mantable"> | <table class="nd-mantable"> | ||
Line 221: | Line 176: | ||
<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 Alarm configuration page and the table below provides information on fields that it contains: | <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 Alarm configuration page and the table below provides information on fields that it contains: | ||
[[File:{{{file_alarms}}}]] | |||
<table class="nd-mantable"> | <table class="nd-mantable"> | ||
Line 258: | Line 211: | ||
<tr> | <tr> | ||
<td>Action</td> | <td>Action</td> | ||
<td><span style="color: # | <td><span style="color: #0054a6; font-weight:bold;">SMS</span> | <span style="color: red; font-weight:bold;">Trigger output</span> | <span style="color: purple; font-weight:bold;">Modbus Request</span>; default: <b>SMS</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> | ||
Line 268: | Line 221: | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td><span style="color: # | <td><span style="color: #0054a6;">SMS:</span> Message</td> | ||
<td>string; default: <b>none</b></td> | <td>string; default: <b>none</b></td> | ||
<td>SMS message text.</td> | <td>SMS message text.</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td><span style="color: # | <td><span style="color: #0054a6;">SMS:</span> Phone number</td> | ||
<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: red;">Trigger output:</span> Output</td> | <td><span style="color: red;">Trigger output:</span> Output</td> | ||
<td>Open collector output | <td>Open collector output | Relay output | Both; default: <b>Open collector output</b></td> | ||
<td>Which output(s) will be triggered.</td> | <td>Which output(s) will be triggered.</td> | ||
</tr> | </tr> | ||
Line 325: | Line 277: | ||
</table> | </table> | ||
{{#ifeq: {{{ | {{#ifeq:{{{name}}} | RUT955 | | ||
{{Template:Networking_device_manual_modbus_serial | |||
| file_rs232 = {{{file_rs232}}} | |||
| file_rs485 = {{{file_rs485}}} | |||
| file_slave_settings = {{{file_slave_settings}}} | |||
| file_slave_request = {{{file_slave_request}}} | |||
| file_slave_alarm = {{{file_slave_alarm}}} | |||
}} | |||
|}} | |||
==Modbus Data to Server== | ==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: | 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: | [[File:{{{file_add_new_sender}}}]] | ||
===Data sender configuration=== | ===Data sender configuration=== | ||
Line 578: | Line 298: | ||
The figure below is an example of that window and the table below provides information on the fields that it contains: | The figure below is an example of that window and the table below provides information on the fields that it contains: | ||
[[File: | [[File:{{{file_sender_configuration}}}]] | ||
<table class="nd-mantable"> | <table class="nd-mantable"> | ||
Line 598: | Line 318: | ||
<tr> | <tr> | ||
<td>Protocol</td> | <td>Protocol</td> | ||
<td><span style="color: | <td><span style="color:tomato; font-weight:bold;">HTTP(S)</span> | <span style="color:darkcyan; font-weight:bold;">MQTT</span>; Default: <b>HTTP(S)</b></td> | ||
<td>Data sending protocol</td> | <td>Data sending protocol</td> | ||
</tr> | </tr> | ||
Line 622: | Line 342: | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td><span style="color: | <td><span style="color:tomato;">HTTP(S): </span>Data filtering</td> | ||
<td>All data | By slave ID | By slave IP; Default: <b>All data</b></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> | <td>Which data this sender will transfer to the server</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td><span style="color: | <td><span style="color:tomato;">HTTP(S): </span>Retry on fail</td> | ||
<td>yes | no; Default: <b>no</b></td> | <td>yes | no; Default: <b>no</b></td> | ||
<td>Specifies whether the data sender should retry failed attempts</td> | <td>Specifies whether the data sender should retry failed attempts</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td><span style="color: | <td><span style="color:tomato;">HTTP(S): </span>Custom header</td> | ||
<td>string; Default: <b>no</b></td> | <td>string; Default: <b>no</b></td> | ||
<td>Adds a custom header(s) to HTTP requests</td> | <td>Adds a custom header(s) to HTTP requests</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td><span style="color: | <td><span style="color:darkcyan;">MQTT: </span>Port</td> | ||
<td>integer [0..65535]; Default: <b>none</b></td> | <td>integer [0..65535]; Default: <b>none</b></td> | ||
<td>Port used to connect to host.</td> | <td>Port used to connect to host.</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td><span style="color: | <td><span style="color:darkcyan;">MQTT: </span>Keepalive</td> | ||
<td>integer [1..640]; Default: <b>none</b></td> | <td>integer [1..640]; Default: <b>none</b></td> | ||
<td>MQTT keepalive period in seconds.</td> | <td>MQTT keepalive period in seconds.</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td><span style="color: | <td><span style="color:darkcyan;">MQTT: </span>Topic</td> | ||
<td>string; Default: <b>none</b></td> | <td>string; Default: <b>none</b></td> | ||
<td>Write topic to which your data will be sent.</td> | <td>Write topic to which your data will be sent.</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td><span style="color: | <td><span style="color:darkcyan;">MQTT: </span>QoS</td> | ||
<td>0 {{!}} 1 {{!}} 2; Default: <b>0</b></td> | <td>0 {{!}} 1 {{!}} 2; Default: <b>0</b></td> | ||
<td>This field defines the guarantee of delivery for specific message.<br>Possible values are: | <td>This field defines the guarantee of delivery for specific message.<br>Possible values are: | ||
Line 660: | Line 380: | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td><span style="color: | <td><span style="color:darkcyan;">MQTT: </span>Use TLS</td> | ||
<td>yes | no; Default: <b>no</b></td> | <td>yes | no; Default: <b>no</b></td> | ||
<td>Turns TLS authentication on or off.</td> | <td>Turns TLS authentication on or off.</td> | ||
Line 676: | Line 396: | ||
Below is an example of the MQTT Gateway page. Refer to the table for information on MQTT Gateway configuration fields. | Below is an example of the MQTT Gateway page. Refer to the table for information on MQTT Gateway configuration fields. | ||
[[File: | [[File:Networking_rut9_manual_modbus_mqtt_gateway_v1.png|border|class=tlt-border]] | ||
<table class="nd-mantable"> | <table class="nd-mantable"> | ||
Line 796: | Line 516: | ||
==See also== | ==See also== | ||
{{Template: Networking_device_modbus_see_also}} | |||
[[Category:{{{name}}} Services section]] | [[Category:{{{name}}} Services section]] |
Revision as of 08:08, 29 September 2020
The information in this page is updated in accordance with the [[Media:_WEBUI.bin|]] firmware version.
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 chapter is an overview of the Modbus TCP functionality for {{{name}}} devices.
Modbus TCP
Modbus TCP provides users with the possibility to set or get system parameters. The Modbus daemon acts as slave device. That means it accepts connections from a master (client) and sends out a response or sets some system related parameter in accordance with the given query.
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 rut9xx manual modbus modbus tcp v2.png
Template:Networking rut9xx manual modbus modbus tcp table
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:
{{Template: Networking_{{{name}}}_manual_modbus_modbus_tcp_get_parameters_table}}
Set Parameters
The Modbus daemon can also set some device parameters. These parameters and explanations on how to use them are described in the table below:
{{Template: Networking_{{{name}}}_manual_modbus_modbus_tcp_set_parameters_table}}
* All ON/OFF commands only accept 0 and 1 values, which represent the following:
- 1 - ON
- 0 - OFF
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. You can create a maximum of 10 slave configurations.
Slave device configuration
The figure below is an example of the Slave device configuration and the table below provides information on the fields contained in that section:
[[File:{{{file_slave_configuration}}}]]
Field | Value | Description |
---|---|---|
Enabled | yes | no; default: no | 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..6400]; default: none | Interval at which requests are sent to the slave device. |
Timeout | integer [1..30]; default: none | 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 figure below is an example of the Requests configuration section and the table below provides information contained in the fields of that section:
[[File:{{{file_requests}}}]]
Field | Value | Description |
---|---|---|
Name | string; default: Unnamed Parameter | Request name. Used for easier management purposes. |
Data type | Hex | Ascii | 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 | How read data will be stored. |
Function | 1 | 2 | 3 | 4 | 5 | 6 | 15 | 16; default: 3 | A function code specifies the type of register being addressed by a Modbus request. The codes represent these functions:
|
First Register | integer [1..65536]; default: 1 | First Modbus register number from which data will be read. Note - {{{series}}} Modbus Master uses register numbers, which value is +1 higher than address value. |
Number of Registers | integer [1..2000]; default: none | Number of Modbus registers that will be read during the request. |
Enabled | yes | no; default: no | Turns the request on or off. |
Test | - (interactive button) | Generates a Modbus request according to given parameters in order to test the request configuration. You must first save the configuration before you can use the Test button. |
Delete | - (interactive button) | Deletes the request. |
Add | - (interactive button) | Adds a new request configuration. |
Alarm configuration
Alarms are a way of setting up automated actions when some Modbus values meet user specified conditions. The figure below is an example of the Alarm configuration page and the table below provides information on fields that it contains:
[[File:{{{file_alarms}}}]]
Field | Value | Description |
---|---|---|
Enabled | yes | no; default: no | 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 in Modbus request. |
Register | integer [0..65535]; default: none | Number of the Modbus coil/input/holding register/input register that will be read. |
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. |
Action | SMS | Trigger output | Modbus Request; default: SMS | 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. |
Trigger output: Output | Open collector output | Relay output | Both; default: Open collector output | Which output(s) will be triggered. |
Trigger output: I/O Action | Turn On | Turn Off | Invert; default: Turn On | Action that will taken on the specified output. |
Modbus Request: IP address | ip | host; default: none | Modbus slave's IP address. |
Modbus Request: Port | integer [0..65535]; default: none | Modbus slave's port. |
Modbus Request: Timeout | integer [1..30]; default: 5 | Maximum time to wait for a response. |
Modbus Request: ID | integer [1..255]; default: none | Modbus slave ID. |
Modbus Request: Modbus function | Read Coil Status (1) | Read Input Status (2) | Read Holding Registers (3) | Read Input Registers (4) | 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 Request: First register | integer [0..65535]; default: none | Begins reading from the register specified in this field. |
Modbus Request: Number of registers | integer [0..65535]; default: none | The number of registers that will be read from the first register. |
Modbus Data to Server
The Modbus Data to Server 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:{{{file_add_new_sender}}}]]
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:{{{file_sender_configuration}}}]]
Field | Value | Description |
---|---|---|
Enabled | yes | no; Default: no | Turns the data sender ON or OFF |
Name | string; Default: none | Data sender's name. used for easier management purposes |
Protocol | HTTP(S) | MQTT; Default: HTTP(S) | Data sending protocol |
JSON format | json string; Default: {"ID":"%i", "TS":"%t","ST":"%s","VR":"%a"} | Provides the possibility to fully customize the JSON segment |
Segment count | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | All; Default: 1 | Max segment count in one JSON string sent to server. |
URL / Host / Connection string | host | ip; Default: none | Address of the server to which the data will be sent. Important note: when using HTTPS, remember to add the https:// prefix before the URL. |
Period | integer [1..6400]; Default: none | Data sending frequency (in seconds) |
HTTP(S): Data filtering | All data | By slave ID | By slave IP; Default: All data | Which data this sender will transfer to the server |
HTTP(S): Retry on fail | yes | no; Default: no | Specifies whether the data sender should retry failed attempts |
HTTP(S): Custom header | string; Default: no | Adds a custom header(s) to HTTP requests |
MQTT: Port | integer [0..65535]; Default: none | Port used to connect to host. |
MQTT: Keepalive | integer [1..640]; Default: none | MQTT keepalive period in seconds. |
MQTT: Topic | string; Default: none | Write topic to which your data will be sent. |
MQTT: QoS | 0 | 1 | 2; Default: 0 | This field defines the guarantee of delivery for specific message. Possible values are: |
MQTT: Use TLS | yes | no; Default: no | Turns TLS authentication on or off. |
MQTT Gateway
The MQTT Gateway function is used to transfer Modbus data (send requests, receive responses) over MQTT. When it is enabled, the device (this {{{name}}}) subscribes to a REQUEST topic and publishes on a RESPONSE topic on a specified MQTT broker. It translates received MQTT message payload to a Modbus request and relays it to the specified Modbus TCP slave.
When the MQTT Gateway receives a response from the slave, it translates it to an MQTT message and publishes it on the RESPONSE topic.
Below is an example of the MQTT Gateway page. Refer to the table for information on MQTT Gateway configuration fields.
File:Networking rut9 manual modbus mqtt gateway v1.png
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 | string; default: request | MQTT topic for sending requests. |
Response topic | string; default: response | MQTT topic for subscribing to responses. |
Username | string; default: none | Username for authentication to the MQTT broker. Leave empty if you do not use client authentication. |
Password | string; default: none | Password for authentication to the MQTT broker. Leave empty if you do not use client authentication. |
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]]