Changes

Created page with "{{Template:Networking_rutos_manual_fw_disclosure | fw_version = {{{series}}}_R_00.02.04 | series = {{{series}}} }} ==Summary== The <b>RS485</b> function is designed to u..."
{{Template:Networking_rutos_manual_fw_disclosure
| fw_version = {{{series}}}_R_00.02.04
| series = {{{series}}}
}}

==Summary==

The <b>RS485</b> function is designed to utilize the serial interface of the device. Serial interfaces provide a possibility for legacy devices to gain access to IP networks. This chapter is an overview of the RS485 section in {{{name}}} devices.

===Maximum data rate vs. transmission line length===
----
The RS485 standart can be used for network lengths up to 1200 meters, but the maximum usable data rate decreases as the transmission length increases. A device operating at the maximum data transfer rate (10 Mbps) is limited to a transmission length of about 12 meters, while a distance up to 1200 meters can be achieved at 100 Kbps. A rough relation between maximum transmission length and data rate can be calculated using this approximation:

[[File:Services rs485 formula.PNG]]

Where:
<ul>
<li> '''L<sub>max</sub>''' - maximum cable length in meters</li>
<li> '''DR''' - maximum data rate in bits per second</li>
</ul>

Twisted pair is the preferred cable type for RS485 networks. Twisted pair cables pick up noise and other electromagnetically induced voltages as common mode signals, which are rejected by the differential receivers.

===2-Wire and 4-Wire Networks===
----
Below is an example of a 4-wire network electrical connection. There are 3 devices shown in the example. One of the devices is the "master" and other two are "slaves". Termination resistors are placed at each cable end. Four-wire networks consists of one master with its transmitter connected to each of the slaves' receivers on one twisted pair. The slave transmitters are all connected to the master receiver on a second twisted pair:

[[File:Services rs485 4wire.PNG]]

Example 2-wire network electrical connection: to enable a 2-wire RS485 configuration you need to connect D_P to R_P and D_N to R_N on the device’s RS485 socket. Termination resistors are placed at each cable end:

[[File:Services rs485 2wire.PNG]]

==RS485 Configuration==

The '''RS485 Configuration''' section is used to configure the parameters of the RS485 serial connection. Parameters used should be selected in accordance with the needs of the user and the type of device connected via the RS485 connector.

The figure below is an example of the RS485 Configuration section and the table below provides information on the fields contained in that section:

[[File:Trb145_webui_services_rs485_configuration_v1.png]]

<table class="nd-mantable">
<tr>
<th>field name</th>
<th>value</th>
<th>description</th>
</tr>
<tr>
<td>Enabled</td>
<td>yes | no; Default: <b>no</b></td>
<td>Enables the RS485 service</td>
</tr>
<tr>
<td>Baud rate</td>
<td>300 | 1200 | 2400 | 4800 | 9600 | 19200 | 38400 | 57600 | 115200; Default: <b>115200</b></td>
<td>Data rate for serial data transmission (in bits per second)</td>
</tr>
<tr>
<td>Parity</td>
<td>None | Odd | Even; 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.
<ul>
<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>Even</b> (<b>E</b>) - the parity bit is set so that the number of "logical ones (1s)" has to be even</li>
</ul>
</td>
</tr>
<tr>
<td>Flow control</td>
<td>None | RTS/CTS | 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.
<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>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
</ul>
</td>
</tr>
<tr>
<td>Serial type</td>
<td>[[TRB145_RS485#Console|Console]] | [[TRB145_RS485#Over_IP|Over IP]] | [[TRB145_RS485#Modem|Modem]] | [[TRB145_RS485#Modbus_gateway|Modbus gateway]] | [[TRB145_RS485#NTRIP_client|NTRIP client]]; Default: <b>Console</b></td>
<td>Serial connection type. More information on each serial type can be seen below or by clicking on a link in the value section</td>
</tr>
<tr>
<td>Echo</td>
<td>yes | no; Default: <b>no</b></td>
<td>Toggles RS485 echo ON or OFF. RS485 echo is a loopback test usually used to check whether the RS485 cable is working properly</td>
</tr>
</table>

==Serial types==

An RS485 serial connection can function in different ways depending on user needs and what devices are connected to the RS485 connector. This section of the chapter is an overview of all different RS485 serial types.

===Console===
----
In '''Console''' mode the serial interface is set up as a Linux console that can be used to control the device (much like a regular SSH connection, except established via RS485). It can be used for debugging purposes, to get the status of the device or to control it. Click '''[[Command_line_interfaces#RS232.2FRS485_console_.28only_with_RUT955.29|here]]''' to find a guide on how to set up RS485 in console mode.

===Over IP===
----
In '''Over IP''' serial type the device provides a connection to a TPC/IP network for the devices connected via the serial interface. The figure below is an example of available configuration fields for the Over IP serial type and the table below provides information on these fields:

[[File:Trb145_webui_services_rs485_configuration_over_ip_v1.png]]

<table class="nd-mantable">
<tr>
<th>field name</th>
<th>value</th>
<th>description</th>
</tr>
<tr>
<td>Protocol</td>
<td>TCP; Default: <b>TCP</b></td>
<td>Protocol used in the communication process</td>
</tr>
<tr>
<td>Mode</td>
<td>Server | Client | Bidirect; Default: <b>Server</b></td>
<td>Device's role in the connection:
<ul>
<li><b>Server</b> - the device waits for incoming connections</li>
<li><b>Client</b> - the device initiates the connection</li>
<li><b>Bidirect</b> - acts as client by default but waits for incoming connections at the same time</li>
</ul>
</td>
</tr>
<tr>
<td>No leading zeros</td>
<td>yes | no; Default: <b>no</b></td>
<td>When checked, indicates that the first hex zeros should be skipped</td>
</tr>
<tr>
<td><span style="color: red;">Client settings</span>: Server address</td>
<td>ip | host; Default: <b>none</b></td>
<td>IP address or hostname of the server that the client will connect to</td>
</tr>
<tr>
<td><span style="color: red;">Client settings</span>: TCP port</td>
<td>integer [0..65535]; Default: <b>none</b></td>
<td>Server's port number</td>
</tr>
<tr>
<td><span style="color: red;">Client settings</span>: Reconnect interval (s)</td>
<td>integer; Default: <b>none</b></td>
<td>Time period (in seconds) between reconnection attempts in case a connection fails</td>
</tr>
<tr>
<td><span style="color: purple;">Server settings</span>: TCP port</td>
<td>integer [0..65535]; Default: <b>none</b></td>
<td>Internal TCP port number used to listen for incoming connections </td>
</tr>
<tr>
<td><span style="color: purple;">Server settings</span>: Timeout (s)</td>
<td>integer; Default: <b>none</b></td>
<td>Disconnects clients after they remain inactive for an amount time (in seconds) specified in this field</td>
</tr>
<tr>
<td>Output</td>
<td>OC Output | Relay Output; Default: <b>OC Output</b></td>
<td>Output to indicate that the application switched from client (default) to server state (this field becomes visible only in Bidirect mode)</td>
</tr>
<tr>
<td>Output state</td>
<td>1 | 0; Default: <b>0</b></td>
<td>Output state value during which the application reverts to server mode (this field becomes visible only in Bidirect mode)</td>
</tr>
</table>

===Modbus gateway===
----
The <b>Modbus gateway</b> serial type allows redirecting TCP data coming to a specified port to the RTU specified by the Slave ID. The Slave ID can be specified by the user or be obtained directly from the Modbus header.

The figure below is an example of available configuration fields for the Modbus gateway serial type and the table below provides information on these fields:

[[File:Trb145_webui_services_rs485_configuration_modbus_gateway_v1.png]]

<table class="nd-mantable">
<tr>
<th>field name</th>
<th>value</th>
<th>description</th>
</tr>
<tr>
<td>Listening IP</td>
<td>ip; Default: <b>0.0.0.0</b></td>
<td>IP address on which the Modbus gateway will wait for incoming connections</td>
</tr>
<tr>
<td>Port</td>
<td>integer [0..65535]; Default: <b>502</b></td>
<td>Port number used to listen for incoming connections</td>
</tr>
<tr>
<td>Slave ID configuration</td>
<td>User defined | Obtained from TCP; Default: <b>User defined</b></td>
<td>Specifies whether slave IDs should be user defined or automatically obtained from TCP</td>
</tr>
<tr>
<td>Slave ID/Permitted slave IDs</td>
<td>integer | range of integers | multiple integers; Default: <b>1</b>/<b>1-247</b></td>
<td>Slave ID or range of permitted slave IDs. The way this field is named and its function depends on the value of the "Slave ID configuration" field. <br> A range of IDs can be specified by placing a <b>hyphen</b> (<b>-</b>) between two integer numbers. For example, if you permit slave IDs in the range of 10 to 20, you would specify it as: <b>10-20</b><br>You can also specify multiple values that are not connected in a range using <b>commas</b> (<b>,</b>). For example, to specify 6, 50 and 100 as permitted slave IDs, you would have to use: <b>6,50,100</b></td>
</tr>
</table>

[[Category:{{{name}}} Services section]]

Navigation menu