ADVANTECH Protocol MODBUS TCP2RTU Router App User Guide
- June 14, 2024
- Advantech
Table of Contents
ADVANTECH Protocol MODBUS TCP2RTU Router App
Product Information
The product is a device that supports the MODBUS TCP2RTU protocol. It is manufactured by Advantech Czech s.r.o., located in Usti nad Orlici, Czech Republic. The document number for the user manual is APP-0014-EN, with a revision date of 26th October, 2023.
Advantech Czech s.r.o. states that they are not liable for any incidental or consequential damages resulting from the use of this manual. All brand names mentioned in the manual are registered trademarks of their respective owners, and their use in this publication is for reference purposes only.
Product Usage Instructions
Configuration
To configure the product, follow these steps:
- Access the web interface by pressing the module name on the Router apps page of the router Web interface.
- In the left part menu of the web interface, navigate to the Configuration section.
- In the Configuration section, you will find items for Port 1, Port 2, and USB configuration.
- For Port Configuration:
- Enable Expansion port: This item enables the conversion of MODBUS TCP/IP protocol into MODBUS RTU.
- Baudrate: Set the baudrate for the MODBUS RTU connection on the Expansion port. If no MODBUS RTU device is connected to the serial interface, set it to None.
I/O & XC-CNT MODBUS TCP Server
The product has a Basic Characteristic and an Address Space of Router related to I/O & XC-CNT MODBUS TCP Server. For more information on these characteristics, refer to the user’s manual of the router or Expansion port.
Related Documents
For additional information and related documents, please consult the user manual provided by Advantech Czech s.r.o.
Advantech Czech s.r.o., Sokolska 71, 562 04 Usti nad Orlici, Czech Republic Document No. APP-0014-EN, revision from 26th October, 2023.
© 2023 Advantech Czech s.r.o. No part of this publication may be reproduced or
transmitted in any form or by any means, electronic or mechanical, including
photography, recording, or any information storage and retrieval system
without written consent. Information in this manual is subject to change
without notice, and it does not represent a commitment on the part of
Advantech.
Advantech Czech s.r.o. shall not be liable for incidental or consequential
damages resulting from the furnishing, performance, or use of this manual.
All brand names used in this manual are the registered trademarks of their
respective owners. The use of trademarks or other
designations in this publication is for reference purposes only and does not
constitute an endorsement by the trademark holder.
Used symbols
- Danger – Information regarding user safety or potential damage to the router.
- Attention – Problems that can arise in specific situations.
- Information – Useful tips or information of special interest.
- Example – Example of function, command or script.
Changelog
Protocol MODBUS TCP2RTU Changelog
-
v1.0.0 (2011-07-19)
First release -
v1.0.1 (2011-11-08)
Added automatic detection RS485 interface and control of RTS signal for RS485 line -
v1.0.2 (2011-11-25)
Minor improvements in HTML code -
v1.0.3 (2012-09-19)
Fixed unhandled exceptions
Added sending modbus error message 0x0B if reply timeout expire -
v1.0.4 (2013-02-01)
Added sending modbus error message 0x0B if bad crc is received -
v1.0.5 (2013-05-22)
Added read out functions of I/O and CNT port -
v1.0.6 (2013-12-11)
Added support of FW 4.0.0+ -
v1.0.7 (2014-04-01)
Increased size of internal buffer -
v1.0.8 (2014-05-05)
Added blocking of new clients when connected client is active -
v1.0.9 (2014-11-11)
Added TCP mode client
Added serial number and MAC address into modbus registers -
v1.1.0 (2015-05-22)
Improved requests processing -
v1.1.1 (2015-06-11)
Added test of data length in crc check -
v1.1.2 (2015-10-14)
Disabled signal SIG_PIPE -
v1.1.3 (2016-04-25)
Enabled keep-alive in TCP server mode -
v1.2.0 (2016-10-18)
Added support of two simultaneously working ports
Removed unnecessary options -
v1.2.1 (2016-11-10)
Fixed bug in uart read loop -
v1.3.0 (2017-01-27)
Added option Reject new connections
Added option Inactivity Timeout -
v1.4.0 (2017-07-10)
Added MWAN IPv4 address into MODBUS registers
Fixed reading of MAC address -
v1.5.0 (2018-04-23)
Added option “None” to serial device selection -
v1.6.0 (2018-09-27)
Added support of ttyUSB
Fixed file descriptor leaks (in ModulesSDK) -
v1.6.1 (2018-09-27)
Added expected ranges of values to JavaSript error messages -
v1.7.0 (2020-10-01)
Updated CSS and HTML code to match firmware 6.2.0+
Changed limit for “Reply Timeout” to 1..1000000ms -
v1.8.0 (2022-03-03)
Added additional values related to MWAN status -
v1.9.0 (2022-08-12)
Added additional device configuration CRC32 value -
v1.10.0 (2022-11-03)
Reworked license information -
v1.10.1 (2023-02-28)
Linked statically with zlib 1.2.13 -
1.11.0 (2023-06-09)
Added support for additional binary input and output GPIO pins
Description
Router app Protocol MODBUS TCP2RTU is not contained in the standard router firmware. Uploading of this router app is described in the Configuration manual (see Chapter Related Documents).
Modbus TCP2RTU router app provides the conversion of MODBUS TCP protocol to
MODBUS RTU protocol, which can by used on the serial line. RS232 or RS485/422
interface can be used for serial communication in the Advantech router.
There is a common part PDU For both protocols. MBAP header is used for
identification when sending MODBUS ADU to TCP/IP. Port 502 is dedicated for
MODBUS TCP ADU.
When sending a PDU to the serial line, the address of destination unit obtained from a MBAP header as UNIT ID is added to the PDU along with the checksum.
The module supports configuration of two independent serial interfaces, if available in the router. Auto-matic recognition of port RS485 from RS422 is supported. Detailed information about the serial interface can be found in the User’s manual of the router or Expansion port (RS485/422, see [2]).
Interface
Web interface is accessible by pressing the module name on the Router apps
page of the router Web interface.
The left part menu of the Web interface contains these sections: Status,
Configuration and Customiza-tion. Status section contains Stats which shows
statistical information and System Log which shows the same log as in the
router’s interface. Configuration section contains Port 1, Port 2 and USB
items and Customization contains only menu section switches back from the
module’s web page to the router’s web configuration pages. The main menu of
module’s GUI is shown on Figure 1.
Configuration
Port Configuration
Meaning of the individual items:
Expansion port| Expansion port, where the MODBUS RTU connection will be
established. If there is no a MODBUS RTU device connected to the serial
interface, it can be set up to “None” and this serial interface can be used
for communication with another device. Only internal registers of the router
can be read out in this case.
---|---
Item| Description
---|---
Parity| Control parity bit:
- none – No parity will be sent
- even – Even parity will be sent
- odd – Odd parity will be sent
Stop Bits
Split Timeout
| Number of stop bits
Time for breaking off message (see note below)
TCP Mode| Selection of mode:
- Server – TCP server
- Client – TCP client
Server Address
TCP Port
| Defines server address when selected mode is Client (in TCP Mode item).
TCP port on which the router listens to requests for MODBUS TCP connection.
For sending MODBUS ADU is reserved port 502.
Reply Timeout| Specifies the time interval in which it is expecting a
response. If the response doesn’t receive, it will be sent one of these error
codes:
-
0A – Transmission path unavailable
Gateway is not able to allocate internal transmission path from the input port to the output port. It is probably overloaded or incorrectly set. -
0B – The target device doesn’t response
The target device doesn’t response, may not be available.
Inactivity Timeout| Time period after which the TCP/UDP connection is
interrupted in case of inactivity
Reject new connections| When enabled, the router rejects any other connection
attempts – the router no longer supports multiple connections
Enable I/O and XC-CNT extensions| This option enables direct communication
with router.
I/O (binary inputs and outputs on the router) and internal registers
works on all platforms (v2, v2i, v3 and v4).
XC-CNT is expansion board for v2 routers. This form of communication
works on v2 platform only.
Unit ID| ID for direct communication with router. Values can be 1 to 255. The
value 0 is also accepted to communicate directly to a MOD- BUS/TCP or
MODBUS/UDP devices. Default value is 240.
All changes in settings will be applied after pressing the Apply button.
Note: If a time between the two received characters is recognized to be
longer than the Split Timeout parameter value in milliseconds, the message
from all received data is compiled and then it is sent.
USB Configuration
USB Configuration has nearly the same configuration items as PORT1 and PORT2.
Only difference is missing Enable I/O and XC-CNT extensions and Unit ID items.
I/O & XC-CNT MODBUS TCP Server
Basic Characteristic
I/O protocol and XC-CNT MODBUS TCP server is one of the router communication
protocol with a Modbus TCP2RTU router app based on the I/O interface and XC-
CNT expansion boards. Router provides current state of inputs in real time.
System can read it using message with 0x03 code (reading values of more
registers). Using messages with the code 0x10 (writing values of more
registers) system can control digital outputs and set the state counters.
Messages with different codes (e.g., 0x6 for writing value of a single
register) are not supported.
Address Space of Router
|
---|---
Address| Access| Description
0x0400| R/-| upper 16 bits of temperature in router [ ◦ C] (with sign)
0x0401| R/-| upper 16 bits of temperature in router [ ◦ C] (with sign)
0x0402| R/-| upper 16 bits of the supply voltage [mV]
0x0403| R/-| upper 16 bits of the supply voltage [mV]
0x0404| R/-| state of upper 16 bits of BIN2, always 0
0x0405| R/-| state of lower 16 bits of BIN2
0x0406| R/-| state of upper 16 bits of BIN3, always 0
0x0407| R/-| state of lower 16 bits of BIN3
0x0408| R/-| state of upper 16 bits of BIN0, always 0
0x0409| R/-| state of lower 16 bits of BIN0:
- bit 0 – level at the input BIN0
- bits 1 to 15 – not used, always 0
0x040A| R/-| state of upper 16 bits of BOUT0, always 0
0x040B| R/W| state of lower 16 bits of BOUT0:
- bit 0 – level at the output BOUT0
- bits 1 to 15 – not used, always 0
0x040C| R/-| state of upper 16 bits of BIN1, always 0
0x040D| R/-| state of lower 16 bits of BIN1:
- bit 0 – level at the input BIN1
- bits 1 to 15 – not used, always 0
0x040E| R/-| state of upper 16 bits of BOUT1, always 0
0x040F| R/W| state of lower 16 bits of BOUT1:
- bit 0 – level at the output BOUT1
- bits 1 to 15 – not used, always 0
Continued on next page
Address| Access| Description
---|---|---
| | Table 2: I/O
Address| Access| Description
0x0410| R/-| upper 16 bits of AN1 value, always 0
0x0411| R/-| lower 16 bits of AN1 value, value from 12-bit A-D con- verter
0x0412| R/-| upper 16 bits of AN2 value, always 0
0x0413| R/-| lower 16 bits of AN2 value, value from 12-bit A-D con- verter
0x0414| R/W| upper 16 bits of CNT1
0x0415| R/W| lower 16 bits of CNT1
0x0416| R/W| upper 16 bits of CNT2
0x0417| R/W| lower 16 bits of CNT2
0x0418| R/-| state of upper 16 binary inputs:
- bits 0 to 15 – not used, always 0
0x0419| R/-| state of lower 16 binary inputs:
- bit 0 – level at the input BIN1
- bit 1 – level at the input BIN2
- bit 2 – level at the input BIN3
- bit 3 – level at the input BIN4
- bits 4 to 15 – not used, always 0
0x041A| R/-| state of upper 16 binary outputs:
- bits 0 to 15 – not used, always 0
0x041B| R/W| state of lower 16 binary outputs:
- bit 0 – level at the output BOUT1
- bits 1 to 15 – not used, always 0
0x041C| R/-| not used, always 0
0x041D| R/-| not used, always 0
0x041E| R/-| not used, always 0
0x041F| R/-| not used, always 0
Address| Access| Description
---|---|---
0x0420| R/-| upper 16 bits of AN1 value, always 0
0x0421| R/-| lower 16 bits of AN1 value, value from 12-bit A-D converter
0x0422| R/-| upper 16 bits of AN2 value, always 0
0x0423| R/-| lower 16 bits of AN2 value, value from 12-bit A-D converter
0x0424| R/W| upper 16 bits of CNT1
0x0425| R/W| lower 16 bits of CNT1
0x0426| R/W| upper 16 bits of CNT2
0x0427| R/W| lower 16 bits of CNT2
0x0428| R/-| state of upper 16 binary inputs:
- bits 0 to 15 – not used, always 0
0x0429| R/-| state of lower 16 binary inputs:
- bit 0 – level at the input BIN1
- bit 1 – level at the input BIN2
- bit 2 – level at the input BIN3
- bit 3 – level at the input BIN4
- bits 4 to 15 – not used, always 0
0x042A| R/-| state of upper 16 binary outputs:
- bits 0 to 15 – not used, always 0
0x042B| R/W| state of lower 16 binary outputs:
- bit 0 – level at the output BOUT1
- bits 1 to 15 – not used, always 0
0x042C| R/-| not used, always 0
0x042D| R/-| not used, always 0
0x042E| R/-| not used, always 0
0x042F| R/-| not used, always 0
| | Table 4: XC-CNT – PORT2
Address| Access| Description
0x0430| R/-| upper 16 bits of serial number
0x0431| R/-| lower 16 bits of serial number
0x0432| R/-| 1st and 2nd byte of MAC address
0x0433| R/-| 3rd and 4th byte of MAC address
0x0434| R/-| 5th and 6th byte of MAC address
0x0435| R/-| 1st and 2nd byte of IP address MWAN
0x0436| R/-| 3rd and 4th byte of IP address MWAN
0x0437| R/-| number of active SIM
Continued on next page
Address| Access| Description
---|---|---
0x0430| R/-| upper 16 bits of serial number
0x0431| R/-| lower 16 bits of serial number
0x0432| R/-| 1st and 2nd byte of MAC address
0x0433| R/-| 3rd and 4th byte of MAC address
0x0434| R/-| 5th and 6th byte of MAC address
0x0435| R/-| 1st and 2nd byte of IP address MWAN
0x0436| R/-| 3rd and 4th byte of IP address MWAN
0x0437| R/-| number of active SIM
Address| Access| Description
---|---|---
0x0438| R/-| 1st and 2nd byte of MWAN Rx Data
0x0439| R/-| 3rd and 4th byte of MWAN Rx Data
0x043A| R/-| 5th and 6th byte of MWAN Rx Data
0x043B| R/-| 7th and 8th byte of MWAN Rx Data
0x043C| R/-| 1st and 2nd byte of MWAN Tx Data
0x043D| R/-| 3rd and 4th byte of MWAN Tx Data
0x043E| R/-| 5th and 6th byte of MWAN Tx Data
0x043F| R/-| 7th and 8th byte of MWAN Tx Data
0x0440| R/-| 1st and 2nd byte of MWAN Uptime
0x0441| R/-| 3rd and 4th byte of MWAN Uptime
0x0442| R/-| 5th and 6th byte of MWAN Uptime
0x0443| R/-| 7th and 8th byte of MWAN Uptime
0x0444| R/-| MWAN Registration
0x0445| R/-| MWAN Technology
0x0446| R/-| MWAN PLMN
0x0447| R/-| MWAN Cell
0x0448| R/-| MWAN Cell
0x0449| R/-| MWAN LAC
0x044A| R/-| MWAN TAC
0x044B| R/-| MWAN Channel
0x044C| R/-| MWAN Band
0x044D| R/-| MWAN Signal Strength
0x044E| R/-| CRC32 value of router configuration
0x044F| R/-| CRC32 value of router configuration
Notes:
- Serial number on addresses 0x0430 and 0x0431 are present only in case of 7 digit serial number, otherwise are values on those addresses empty.
- In case of absence XC-CNT board all corresponding values are 0.
- Information about the current fitting and configuration of XC-CNT boards can be found in the system log after starting the router app.
- Writing is in fact possible to all registers. Writing to the registry, which is not designed for writing, is always successful, however there is no physically change.
- Reading values from register address range 0x0437 – 0x044D works on all router platforms.
- Addresses in the table start from 0. If the implementation uses register numbers starting from 1, the register address needs to be increased by 1.
Related Documents
- Advantech Czech: Expansion Port RS232 – User Manual (MAN-0020-EN)
- Advantech Czech: Expansion Port RS485/422 – User Manual (MAN-0025-EN)
- Advantech Czech: Expansion Port CNT – User Manual (MAN-0028-EN)
You can obtain product-related documents on Engineering Portal at
icr.advantech.cz address.
To get your router’s Quick Start Guide, User Manual, Configuration Manual, or
Firmware go to the Router Models page, find the required model, and switch to
the Manuals or Firmware tab, respectively.
The Router Apps installation packages and manuals are available on the Router
Apps page.
For the Development Documents, go to the DevZone page.
References
- Advantech 4G, 5G Cellular Routers & Gateways for IoT applications - Engineering Portal
- Advantech 4G, 5G Cellular Routers & Gateways for IoT applications - Engineering Portal
- DevZone - Cellular Routers Engineering Portal
- Router Apps - Cellular Routers Engineering Portal
- Router Models - Cellular Routers Engineering Portal
Read User Manual Online (PDF format)
Read User Manual Online (PDF format) >>