MINI and MIX Series I/O modules/Modbus
version 1.3
www.gc5.pl
Page 51 / 73
5
Modbus TCP/IP modules
5.1
Modbus TCP/IP
The device simultaneously supports up to 4 Modbus TCP clients. If the fifth device will want
to connect to the module, TCP connection will be rejected. In order to secure the module
before filling up the call list, it was introduced a mechanism for monitoring each Modbus
TCP connection. There is a parameter called Modbus TCP Communication Timeout
(default 60s), If during this time will not come any request from the Modbus TCP client,
module will close the connection.
To read internal registers of the module need to generate the correct MODBUS TCP frame
with address according to the setting of dipswitch, If the address is different the frame will
be sent to the RS485 port.
If module receive an incorrect MODBUS TCP frame, it sends back a frame with error code:
0x01 - if the function code in the query is not supported
0x02 - if the address of the register is invalid
0x03 - If in the query disagrees the amount of data
If the query is correct, device instantly generates answer with the data or acknowledgment
of receipt of data, depending on the query.
5.2
Module as Modbus TCP/IP Gateway to RS485
All IP version modules have built in Modbus TCP/IP to RS485 gateway which allows to
connects using RS485 an additional I/O modules or 3
rd
party Modbus devices. In order to
ensure proper operation of Modbus Gateway please make sure that all parameters of
RS485 ( Baud Rate, Stop Bits ect.) of all the devices connected to RS485 ( Gateway and an
addition I/O modules/devices) are same.
Operation of gateway is based on checking the MODBUS address in the MODBUS TCP
query. If the address is different from the set on the dipswitch, data frame from query is
converted to MODBUS RTU/ASCII, and sent to the RS485 port. Then the module waits for
an answer from device connected to the RS485, if slave does not respond within the
estimated time defined by the RS485 Timeout (default 500ms), an exception response will
be given: error code 0x0B. If the slave answered the correct frame, it is converted to Modbus
TCP and sent to the master.
Module in gateway functionality in case of not receive valid frame, send error code 0x0B.
Some systems upon receipt of this error code, no repeats the query according to the
settings. No retry may result in immediate going point to down mode. That is why modules
have the ability to block the sending information about errors (Send Modbus Errors setting
from built in web or iSMA-Configurator). Then in the absence of any response, the system
retry the request according to the settings.