Difference between revisions of "Template:Networking rutos manual rs485"

From Teltonika Networks Wiki
m (Text replacement - "Template: Networking_rutos_manual_latest_fw" to "Template: Networking_device_manual_latest_fw")
(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...")
(42 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{Template: Networking_device_manual_fw_disclosure
+
{{Template:Networking_rutos_manual_fw_disclosure
| series = {{{series}}}
+
| fw_version = {{{series}}}_R_00.02.04
| name  = {{{name}}}
+
| series     = {{{series}}}
| fw_version ={{Template: Networking_device_manual_latest_fw
 
| series = {{{series}}}
 
| name  = {{{name}}}
 
}}
 
 
}}
 
}}
 
<b>[[{{{name}}} RS485|RS485]] service was moved to [[{{{name}}} Serial Utilities|Serial Utilities]] page from FW version <i>{{{series}}}_R_00.07.03</i>.
 
{{#ifeq: {{{series}}} | RUT9 |<br><i><b>Note</b>: <b>[[{{{name}}} RS232/RS485 (legacy WebUI)#RS485|click here]]</b> for the old style WebUI (FW version {{Template: Networking_device_manual_latest_fw | series = RUT9XX}} and earlier) user manual page.</i>|}}
 
  
 
==Summary==
 
==Summary==
  
The <b>RS485</b> page is used to configure the operating parameter of RS485 serial connector.
+
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.
 
 
This manual page provides an overview of the RS485 page in {{{name}}} devices.
 
 
 
==General information==
 
{{#switch: {{{name}}}
 
| TRB145|RUT955|RUT956=
 
===RS485 connector pinout===
 
----
 
Below is a depiction of the RS485 connector pins:
 
 
 
<table class="wikitable" style="border: 1px solid black; background: white;">
 
    <tr>
 
        <th style="border: 1px solid black; width: 250px" colspan="3"><span style=color:#104996><b>RS485 connector pinout</b></span></th>
 
        <th style="border: 1px solid white; border-left: 1px solid black; background: white;" rowspan="7">[[File:Trb145_rs485_pinout_v1.png|130px|right|bottom]]</th>
 
    </tr>
 
    <tr>
 
        <td style="border: 1px solid black;">Pin</td>
 
        <td style="border: 1px solid black;">Name</td>
 
        <td style="border: 1px solid black;">Description</td>
 
    </tr>
 
    <tr>
 
        <td style="border: 1px solid black;">1</td>
 
        <td style="border: 1px solid black;">D_N</td>
 
        <td style="border: 1px solid black;">Driver negative signal</td>
 
    </tr>
 
    <tr>
 
        <td style="border: 1px solid black;">2</td>
 
        <td style="border: 1px solid black;">R_N</td>
 
        <td style="border: 1px solid black;">Receiver negative signal</td>
 
    </tr>
 
    <tr>
 
        <td style="border: 1px solid black;">3</td>
 
        <td style="border: 1px solid black;">GND</td>
 
        <td style="border: 1px solid black;">Device ground</td>
 
    </tr>
 
    <tr>
 
        <td style="border: 1px solid black;">4</td>
 
        <td style="border: 1px solid black;">D_P</td>
 
        <td style="border: 1px solid black;">Driver positive signal</td>
 
    </tr>
 
    <tr>
 
        <td style="border: 1px solid black;">5</td>
 
        <td style="border: 1px solid black;">R_P</td>
 
        <td style="border: 1px solid black;">Receiver positive signal</td>
 
    </tr>
 
    <tr>
 
        <td style="border: 1px solid black;">6</td>
 
        <td style="border: 1px solid black;">NC</td>
 
        <td style="border: 1px solid black;">Power input 9-30 VDC</td>
 
        <td style="border: 1px solid white; border-left: 1px solid black; width: 250px" colspan="1"><span style=color:white>filler text</span></td>
 
    </tr>
 
</table>
 
 
 
===Cable Type===
 
----
 
Recommended cable parameters:
 
  
<table class="nd-othertables">
 
    <tr>
 
        <th style="width: 300px">PARAMETER</th>
 
      <th style="width: 850px">VALUE</th>
 
    </tr>
 
    <tr>
 
      <td>Cable Type</td>
 
      <td>22-24 AWG, 2 – pair (used for full-duplex networks ) or 1-pair (used for half duplex networks). One addtitional wire for ground connection is needed</td>
 
    </tr>
 
    <tr>
 
      <td>Characteristic cable Impedance</td>
 
      <td>120 Ω @ 1MHz</td>
 
    </tr>
 
    <tr>
 
    <td>Capacitance (conductor to conductor)</td>
 
        <td>36 pF/m</td>
 
    </tr>
 
    <tr>
 
    <td>Propagation Velocity</td>
 
        <td>78% (1.3 ns/ft)</td>
 
    </tr>
 
</table>}}
 
 
===Maximum data rate vs. transmission line length===
 
===Maximum data rate vs. transmission line length===
 
----
 
----
The RS485 standard 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:
+
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]]
 
[[File:Services rs485 formula.PNG]]
Line 101: Line 16:
 
Where:
 
Where:
 
<ul>
 
<ul>
    <li><b>L<sub>max</sub></b> - maximum cable length in meters.</li>
+
<li> '''L<sub>max</sub>''' - maximum cable length in meters</li>
    <li><b>DR</b> - maximum data rate in bits per second.</li>
+
<li> '''DR''' - maximum data rate in bits per second</li>
 
</ul>
 
</ul>
  
Line 109: Line 24:
 
===2-Wire and 4-Wire Networks===
 
===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 (120 Ω each) 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:
+
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_v2.PNG]]
+
[[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 (120 Ω each):
+
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_v2.PNG]]
+
[[File:Services rs485 2wire.PNG]]
  
 
==RS485 Configuration==
 
==RS485 Configuration==
  
The <b>RS485 Configuration</b> section is used to set up the main operating parameters and the serial type of the RS485 connector.
+
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.
  
[[File:Networking_rutos_manual_rs485_rs485_configuration_data_bits_{{{data_bit}}}.png|border|class=tlt-border]]
+
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">
 
<table class="nd-mantable">
 
     <tr>
 
     <tr>
         <th>Field</th>
+
         <th>field name</th>
       <th>Value</th>
+
       <th>value</th>
       <th>Description</th>
+
       <th>description</th>
 
     </tr>
 
     </tr>
 
     <tr>
 
     <tr>
 
       <td>Enabled</td>
 
       <td>Enabled</td>
       <td>off | on; default: <b>off</b></td>
+
       <td>yes | no; Default: <b>no</b></td>
       <td>Turns the RS485 service on or off.</td>
+
       <td>Enables the RS485 service</td>
    </tr>
 
    <tr>
 
        <td>Baud rate</td>
 
        <td>{{{baud_rates}}}; default: <b>{{{baud_rate}}}</b></td>
 
        <td>Data rate for serial data transmission (in bits per second (bps)).</td>
 
 
     </tr>
 
     </tr>
 
     <tr>
 
     <tr>
     <td>Data bits</td>
+
     <td>Baud rate</td>
         <td>5 | 6 | 7 | 8; default: <b>7</b></td>
+
         <td>300 | 1200 | 2400 | 4800 | 9600 | 19200 | 38400 | 57600 | 115200; Default: <b>115200</b></td>
         <td>Number of data bits for each character.</td>
+
         <td>Data rate for serial data transmission (in bits per second)</td>
 
     </tr>
 
     </tr>
 
     <tr>
 
     <tr>
 
     <td>Parity</td>
 
     <td>Parity</td>
         <td>None | Odd | Even; default: <b>None</b></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.
 
         <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 | 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 | RTS/CTS | Xon/Xoff; default: <b>None</b></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.
 
         <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>
                 <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><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>
 
             </ul>
 
         </td>
 
         </td>
Line 172: Line 79:
 
     <tr>
 
     <tr>
 
     <td>Serial type</td>
 
     <td>Serial type</td>
         <td>[[#Console|Console]] | [[#Over IP|Over IP]] | [[#Modem|Modem]] | [[#Modbus gateway|Modbus gateway]]; default: <b>Console</b></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>Specifies the serial connection type.<br><b>Look to the sections below for information on different RS485 serial type options.</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>
 
     <tr>
 
     <tr>
      <td>Full Duplex</td>
+
    <td>Echo</td>
      <td>off | on; default: <b>off</b></td>
+
        <td>yes | no; Default: <b>no</b></td>
      <td>Turns RS485 Full Duplex mode on or off.</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>
 
     </tr>
 
</table>
 
</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===
 
===Console===
 
----
 
----
<b>Console</b> mode requires no further configuration than the settings above and is used as a direct-access method to the device's shell interface. For this purpose you may want use such applications as PuTTY on Windows and microcom, minicom, picocom or similar applications on Linux.
+
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.
 
 
[[File:Networking_rutos_manual_usb_tools_printer_server_usb_to_serial_console.png|border|class=tlt-border]]
 
  
 
===Over IP===
 
===Over IP===
 
----
 
----
The <b>Over IP</b> serial type is used to manage serial connections over a TCP/IP network.  
+
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:Networking_rutos_manual_rs485_over_ip_v1.png|border|class=tlt-border]]
+
[[File:Trb145_webui_services_rs485_configuration_over_ip_v1.png]]
  
 
<table class="nd-mantable">
 
<table class="nd-mantable">
 
     <tr>
 
     <tr>
         <th style="width: 360px>Field</th>
+
         <th>field name</th>
       <th>Value</th>
+
       <th>value</th>
       <th>Description</th>
+
       <th>description</th>
 
     </tr>
 
     </tr>
 
     <tr>
 
     <tr>
 
       <td>Protocol</td>
 
       <td>Protocol</td>
       <td><span style="color: blue;">TCP</span> | <span style="color: green;">UDP</span>; default: <b>TCP</b></td>
+
       <td>TCP; Default: <b>TCP</b></td>
       <td>Protocol used in the communication process.</td>
+
       <td>Protocol used in the communication process</td>
    </tr>
 
    <tr>
 
      <td>Raw mode</td>
 
      <td>off {{!}} on; default; default: <b>off</b></td>
 
      <td>When enabled, all data will be transmitted transparently.</td>
 
 
     </tr>
 
     </tr>
 
     <tr>
 
     <tr>
 
     <td>Mode</td>
 
     <td>Mode</td>
         <td><span style="color: red;">Server</span> | <span style="color: purple;">Client</span> | <span style="color: orange;">Bidirect</span>; default: <b>Server</b></td>
+
         <td>Server | Client | Bidirect; Default: <b>Server</b></td>
         <td>This device's role in the connection:
+
         <td>Device's role in the connection:
 
             <ul>
 
             <ul>
                 <li><b>Server</b> - the device waits for incoming connections.</li>
+
                 <li><b>Server</b> - the device waits for incoming connections</li>
                 <li><b>Client</b> - the device initiates the connection.</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>
+
                 <li><b>Bidirect</b> - acts as client by default but waits for incoming connections at the same time</li>
 
             </ul>
 
             </ul>
 
         </td>
 
         </td>
Line 223: Line 127:
 
     <tr>
 
     <tr>
 
     <td>No leading zeros</td>
 
     <td>No leading zeros</td>
         <td>off | on; default: <b>off</b></td>
+
         <td>yes | no; Default: <b>no</b></td>
         <td>When checked, indicates that the first hex zeros should be skipped.</td>
+
         <td>When checked, indicates that the first hex zeros should be skipped</td>
    </tr>
 
    <tr>
 
    <td><span style="color: red;">Server settings</span>: Port</td>
 
        <td>integer [0..65535]; default: <b>none</b></td>
 
        <td>Internal port number used to listen for incoming connections.</td>
 
 
     </tr>
 
     </tr>
 
     <tr>
 
     <tr>
    <td><span style="color: red;">Server settings</span> | <span style="color: blue;">TCP</span>: Timeout (s)</td>
+
      <td><span style="color: red;">Client settings</span>: Server address</td>
        <td>integer [0..32767]; default: <b>300</b></td>
+
      <td>ip | host; Default: <b>none</b></td>
        <td>Specifies an inactivity time limit (in seconds) after which an inactive clients is disconnected.</td>
+
      <td>IP address or hostname of the server that the client will connect to</td>
 
     </tr>
 
     </tr>
 
     <tr>
 
     <tr>
     <td><span style="color: orange;">Bidirect</span>: Output</td>{{#switch:{{{series}}}
+
     <td><span style="color: red;">Client settings</span>: TCP port</td>
| TRB2=<td>Configurable Input/Output (2) {{!}} Configurable Input/Output (3) {{!}} Configurable Input/Output (4); default: <b>Configurable Input/Output (2)</b></td>
+
        <td>integer [0..65535]; Default: <b>none</b></td>
| TRB1=<td>Configurable Input/Output (3) {{!}} Configurable Input/Output (4); default: <b>Configurable Input/Output (3)</b></td>
+
         <td>Server's port number</td>
| RUT9=<td>Output (4) {{!}} Isolated Output (3,4,8) {{!}} Relay (5,10); default: <b>Output (4)</b></td>}}
 
         <td>Specifies which output to manage.</td>
 
 
     </tr>
 
     </tr>
 
     <tr>
 
     <tr>
     <td><span style="color: orange;">Bidirect</span>: Output state</td>
+
     <td><span style="color: red;">Client settings</span>: Reconnect interval (s)</td>
         <td>0 {{!}} 1; default: <b>0</b></td>
+
         <td>integer; Default: <b>none</b></td>
         <td>Default output state value, when the application is started.</td>
+
         <td>Time period (in seconds) between reconnection attempts in case a connection fails</td>
 
     </tr>
 
     </tr>
 
     <tr>
 
     <tr>
     <td><span style="color: red;">Server settings</span> | <span style="color: green;">UDP</span>: Number of clients</td>
+
     <td><span style="color: purple;">Server settings</span>: TCP port</td>
         <td>1-10; default: <b>1</b></td>
+
         <td>integer [0..65535]; Default: <b>none</b></td>
         <td>Specifies how many UDP clients will be supported simultaneously (predefined clients does not count towards this limit).</td>
+
         <td>Internal TCP port number used to listen for incoming connections </td>
 
     </tr>
 
     </tr>
 
     <tr>
 
     <tr>
     <td><span style="color: red;">Server settings</span> | <span style="color: green;">UDP</span>: Predefined client 1 address</td>
+
     <td><span style="color: purple;">Server settings</span>: Timeout (s)</td>
         <td>ip4; default: <b>none</b></td>
+
         <td>integer; Default: <b>none</b></td>
         <td>Specifies IP address for predefined connection 1.</td>
+
         <td>Disconnects clients after they remain inactive for an amount time (in seconds) specified in this field</td>
 
     </tr>
 
     </tr>
 
     <tr>
 
     <tr>
     <td><span style="color: red;">Server settings</span> | <span style="color: green;">UDP</span>: Predefined port 1</td>
+
     <td>Output</td>
         <td>port; default: <b>none</b></td>
+
         <td>OC Output | Relay Output; Default: <b>OC Output</b></td>
         <td>Specifies port number for predefined connection 1.</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>
 
     <tr>
 
     <tr>
     <td><span style="color: red;">Server settings</span> | <span style="color: green;">UDP</span>: Predefined client 2 address</td>
+
     <td>Output state</td>
         <td>ip4; default: <b>none</b></td>
+
         <td>1 | 0; Default: <b>0</b></td>
        <td>Specifies IP address for predefined connection 2.</td>
+
         <td>Output state value during which the application reverts to server mode (this field becomes visible only in Bidirect mode)</td>
    </tr>
 
    <tr>
 
    <td><span style="color: red;">Server settings</span> | <span style="color: green;">UDP</span>: Predefined port 2</td>
 
        <td>port; default: <b>none</b></td>
 
         <td>Specifies port number for predefined connection 2.</td>
 
    </tr>
 
    <tr>
 
      <td><span style="color: purple;">Client settings</span>: Server Address</td>
 
      <td>ip | host; default: <b>none</b></td>
 
      <td>IP address or hostname of the server that this client will connect to.</td>
 
    </tr>
 
    <tr>
 
    <td><span style="color: purple;">Client settings</span>: Port</td>
 
        <td>integer [0..65535]; default: <b>none</b></td>
 
        <td>Server's listening port number.</td>
 
    </tr>
 
    <tr>
 
    <td><span style="color: purple;">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>Serial device read time</td>
 
        <td>integer [0..1000]; default: <b>none</b></td>
 
        <td>Specifies custom read time for the serial device.</td>
 
    </tr>
 
    <tr>
 
    <td>Full Duplex</td>
 
        <td>0 {{!}} 1; default: <b>0</b></td>
 
        <td>Enables RS485 Full-Duplex.</td>
 
    </tr>
 
    <tr>
 
    <td><span style="color: red;">Server settings</span> | <span style="color: blue;">TCP</span>: Max clients</td>
 
        <td>integer [1..32]; default: <b>32</b></td>
 
        <td>Specifies how many clients are allowed to connect simultaneously.</td>
 
    </tr>
 
    <tr>
 
    <td><span style="color: blue;">TCP</span>: Always reconnect</td>
 
        <td>off | on; default: <b>off</b></td>
 
        <td>When enabled, a new TCP connection will be made after sending every data package.</td>
 
 
     </tr>
 
     </tr>
 
</table>
 
</table>
  
{{#ifeq: {{{modem}}} | 1 |
+
===Modbus gateway===
===Modem===
 
 
----
 
----
The <b>Modem</b> serial type is used to manage modem functionality which could be accessed using shell interface. For this purpose you may want use such applications  with CR/LF (Carriage Return, Line Feed) capable applications like PuTTY on Windows and  microcom, minicom, cutecom or similar applications on Linux.  
+
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.
  
[[File:Networking_rutos_manual_usb_tools_printer_server_usb_to_serial_modem.png|border|class=tlt-border]]
+
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:
  
<table class="nd-mantable">
+
[[File:Trb145_webui_services_rs485_configuration_modbus_gateway_v1.png]]
    <tr>
 
        <th>Field</th>
 
      <th>Value</th>
 
      <th>Description</th>
 
    </tr>
 
      <tr>
 
        <td>Mode</td>
 
      <td>Partial control {{!}} Full control; default: <b>Partial control</b></td>
 
      <td>Specifies modem control mode.
 
          <ul>
 
            <li><b>Partial control</b> - enables modem control with AT commands,  mobile connection will be controlled by RUTOS.
 
            <li><b>Full control</b> - enables modem control with AT commands,  mobile connection will be controlled by user.
 
          </ul>
 
        </td>
 
    </tr>
 
</table>
 
 
 
}}
 
 
 
===Modbus gateway===
 
----
 
The <b>Modbus gateway</b> serial type allows redirecting TCP data coming to a specified port to an RTU specified by the Slave ID. The Slave ID can be specified by the user or be obtained directly from the Modbus header.
 
 
 
[[File:Networking_rutos_manual_rs485_rs485_configuration_modbus_gateway.png|border|class=tlt-border]]
 
  
 
<table class="nd-mantable">
 
<table class="nd-mantable">
 
     <tr>
 
     <tr>
         <th>Field</th>
+
         <th>field name</th>
       <th>Value</th>
+
       <th>value</th>
       <th>Description</th>
+
       <th>description</th>
 
     </tr>
 
     </tr>
 
     <tr>
 
     <tr>
 
       <td>Listening IP</td>
 
       <td>Listening IP</td>
       <td>ip; default: <b>0.0.0.0</b></td>
+
       <td>ip; Default: <b>0.0.0.0</b></td>
       <td>IP address to listen for incoming connections. The default value (<i>0.0.0.0</i>) means that this device will listen for incoming connections on any interface or IP address.</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 to listen for incoming connections.</td>
 
    </tr>
 
    <tr>
 
    <td>Slave ID configuration type</td>
 
        <td><span style="color: red;">User defined</span> | <span style="color: purple;">Obtained from TCP</span>;<br>default: <b><span style="color: red;">User defined</span></b></td>
 
        <td>Specifies whether slave IDs are user defined or automatically obtained from TCP.</td>
 
 
     </tr>
 
     </tr>
 
     <tr>
 
     <tr>
     <td><span style="color: red;">Slave ID</span> | <span style="color: purple;">Permitted slave IDs</span></td>
+
     <td>Port</td>
         <td><span style="color: red;">integer</span> | <span style="color: purple;">range of integers</span>;<br>default: <b><span style="color: red;">1</span> or <span style="color: purple;">1-247</span></b></td>
+
         <td>integer [0..65535]; Default: <b>502</b></td>
         <td>Specifies the slave ID of 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 hyphen (<i>-</i>) between two integer numbers. For example, if you permit slave IDs in the range of 10 to 20, you would specify it as: <i>10-20</i><br>You can also specify multiple values that are not connected in a range using commas (<i>,</i>). For example, to specify 6, 50 and 100 as permitted slave IDs, you would have to use: <i>6,50,100</i></td>
+
         <td>Port number used to listen for incoming connections</td>
 
     </tr>
 
     </tr>
 
     <tr>
 
     <tr>
     <td>Open port automatically</td>
+
     <td>Slave ID configuration</td>
         <td>off | on; default: <b>on</b></td>
+
         <td>User defined | Obtained from TCP; Default: <b>User defined</b></td>
         <td>Automatically adds a traffic rule in the firewall configuration to open the required port for serial communication.<br><b><u>Caution:</u></b> use with care if listening IP is left as the default value (<i>0.0.0.0</i>). Leaving it as such will leave the device open for remote connections on the specified port.</td>
+
         <td>Specifies whether slave IDs should be user defined or automatically obtained from TCP</td>
 
     </tr>
 
     </tr>
 
     <tr>
 
     <tr>
     <td>Full duplex</td>
+
     <td>Slave ID/Permitted slave IDs</td>
         <td>off | on; default: <b>off</b></td>
+
         <td>integer | range of integers | multiple integers; Default: <b>1</b>/<b>1-247</b></td>
         <td>Turns RS485 full duplex on or off.</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>
 
     </tr>
 
</table>
 
</table>
 
==IP Filter==
 
 
The <b>IP Filter</b> section is used for configuring which network is allowed to communicate with the device. You may add a new instance by selecting the Interface and pressing Add.
 
 
[[File:Networking_rutos_manual_console_ip_filter.png|border|class=tlt-border]]
 
 
Then enter the IP address and save.
 
 
[[File:Networking_rutos_manual_console_ip_filter_instance.png|border|class=tlt-border]]
 
  
 
[[Category:{{{name}}} Services section]]
 
[[Category:{{{name}}} Services section]]

Revision as of 16:15, 7 May 2020

Template:Networking rutos manual fw disclosure

Summary

The RS485 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:

Services rs485 formula.PNG

Where:

  • Lmax - maximum cable length in meters
  • DR - maximum data rate in bits per second

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:

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:

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:

Trb145 webui services rs485 configuration v1.png

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

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 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:

Trb145 webui services rs485 configuration over ip v1.png

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

Modbus gateway


The Modbus gateway 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:

Trb145 webui services rs485 configuration modbus gateway v1.png

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

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