21
PROGRAMMER’S GUIDE
5
This network module can be used as:
• TCP/IP Modbus gateway
• Tool that helps to access the ModBus network using HTTP requests
• Modbus transmitter between Modbus Slave devices, which can automatically send data from one
device to another.
5.1 HTTP requests
The default IP address is 192.168.0.51, referred as “address”.
• IP address changing: „http://address/IP(x.x.x.x)”. Е.g. „http://address/IP(192.168.0.60)” – IP address will
be changed to 192.168.0.60.
• RS485 baudrate changing (default 19200): „http://address/SPEED(parameter)” –. Available param-
eter values: 2400, 4800, 9600, 19200, 38400, 57600, 115200. Е.g. „http://address/SPEED(57600)“ – RS485
baudrate is changed to 57600.
• Parity changing: „http://address/PARITY(parameter)” – (default 0 (None)). Avai¬lable parameter val-
ues: 0 – None, 1 – Even, 2 – Odd. Е.g. „http://address/PARITY(1)” – parity is changed to 1 (Even).
• Setting date and time: „http://address/TIME(Y,M,D,WD,h,m,s)”. Parameters: Y – year, M – month, D –
day, WD – weekday, h – hours, m – minutes, s – seconds. Е.g. „http://address/TIME (14,01,01,01,12,30,30)“
– time is changed to į 2014-01-01 12:30:30.
• Modbus request (without CRC): „http://address/FUNC(a,b,c,d,e)”. Parameters:
o a – format of returned value: 1 – float, 2 – integer, 3 – full Modbus response, 4 – if request
returns more than 1 value, all values are semicolon separated
o b – device address
o c – Modbus function code
o d – decimal representation of variable address
o e – value (for writing request) or amount (for reading request, when reading some consecu-
tive addresses)
• Full Modbus request (with CRC): „http://address/F(request)”. Е.g. „http://address/
F(1106000100039A9B)“. Function returns a full Modbus response.
• The main MB-GATEWAY parameters in XML format: „http://address/INFO”
• http://address/TON – enabling Modbus transmitter state.
• http://address/TON(filename) – enabling Modbus transmiter state providing the request file. Е.g.
„http://address/TON(custom.txt)” – activated
• http://address/TOFF – disabling Modbus transmitter state.
5.2 Modbus transmitter
Modbus transmitter is a tool that allows to interconnect some Modbus Slave devices. This tool is disabled
by default, but if the file “tranceiv.txt” is created on the MicroSD card, then the Modbus transmitter starts
automatically when module is turned on.
This function can be enabled and disabled using HTTP requests: “http://address/TON” to activate, “http://
adresas/TOFF” to deactivate. If you would like to not start this tool automatically or you need to change
transmitter requests using HTTP requests, you can use HTTP request “http://address/TON(filename)”. The
Modbus transmitter wil work using the specified file. E.g.:„http://address/TON(custom.txt)“ – requests from
“custom.txt” file will be processed.
The data reading command, direction symbol “>” and command to save received data is entered to each
line of Modbus transmitter request file. Until this function is active, commands are processed as a consecu-
tive loop.
EN