日本語 English

ModbusTcpMes
Modbus TCP Communication Test and Command Tool

Overview

ModbusTcpMes is an application that helps you build Modbus commands and sends them to the target device
Tested on: Win10

Modbus Command Example

Read holding registers

Send:
00 01 00 00 00 06 01 03 00 00 00 02
Response:
00 01 00 00 00 07 01 03 04 00 64 00 C8

Related pages

For details of the commands, see Modbus

How to Use

ModbusTcpMes screen
ModbusTcpMes screen

Destination and port

For the destination, specify the IP address of the Modbus device
The port for Modbus is fixed at 502

Unit ID (HEX)

Specify the unit ID assigned to the Modbus device in hexadecimal

Function

Select a function and set its operands
Not every Modbus device supports every function. Check the manual for the supported functions
Function List
FUNCNameDescriptionOperands
01Read Coil StatusRead coilsAddress, quantity
02Read Input StatusRead discrete inputsAddress, quantity
03Read Holding RegisterRead holding registersAddress, quantity
04Read Input RegisterRead input registersAddress, quantity
05Force Single CoilWrite coilAddress, data
06Preset Single RegisterWrite holding registerAddress, data
08DiagnosticsDiagnosticsDiagnostic sub-function, data
11Fetch Communication Event CounterGet comm event counterNone
12Fetch Communication Event LogGet comm event logNone
15Force Multiple CoilsWrite multiple coilsAddress, quantity, byte count, data
16Preset Multiple RegistersWrite multiple registersAddress, quantity, byte count, data 1...
17Report Slave IDReport slave IDNone
Write Data Format
CommandHow to write dataExample
(05) Force Single Coil0000 = OFF, FF00 = ONFF00
(06) Preset Single Register12AB (in hexadecimal)12AB
(15) Force Multiple CoilsTo write 1100 0000 01
0000 0011 10
(reverse the bit order within each byte)
0000 0011 10
(06) Preset Multiple RegistersWrite multiple words in successionTo write 2 words
1234ABCD

About addresses

To specify coil address 20, specify 19 (20 minus 1)
Likewise, specify discrete inputs, holding registers and input registers as the number minus 1

Modbus Exception Codes
CodeDescription
01Illegal function
02Illegal data address
03Illegal data value

Command Creation Steps

  1. Select the function
  2. Enter the operands
  3. Press the [Create Command] button and the Modbus command is created in the command box
    The command is shown as bytes joined with '-'
  4. The created command can be sent as-is, or edited
    When editing, separate bytes with '-'

Sending Commands

Press [Send] to send the data in the send command box

The sent and received data are shown in the DUMP box

Response

Normal

The reply contains the function followed by the data
Normal example
FunctionByte countData
0x030x020x00 0x01

Error

In an error response, the function is returned with its most significant bit ON
Error example
FunctionException code
0x830x02

FAQ

Does it support Modbus RTU?

This tool is for Modbus TCP only.

Can the port number be changed?

It uses the standard port 502.

Can it be used with devices other than PLCs?

It can be used with any Modbus TCP device.

Download

By downloading, you are deemed to have agreed to the Terms of Use

Comments