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
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
Not every Modbus device supports every function. Check the manual for the supported functions
| FUNC | Name | Description | Operands |
|---|---|---|---|
| 01 | Read Coil Status | Read coils | Address, quantity |
| 02 | Read Input Status | Read discrete inputs | Address, quantity |
| 03 | Read Holding Register | Read holding registers | Address, quantity |
| 04 | Read Input Register | Read input registers | Address, quantity |
| 05 | Force Single Coil | Write coil | Address, data |
| 06 | Preset Single Register | Write holding register | Address, data |
| 08 | Diagnostics | Diagnostics | Diagnostic sub-function, data |
| 11 | Fetch Communication Event Counter | Get comm event counter | None |
| 12 | Fetch Communication Event Log | Get comm event log | None |
| 15 | Force Multiple Coils | Write multiple coils | Address, quantity, byte count, data |
| 16 | Preset Multiple Registers | Write multiple registers | Address, quantity, byte count, data 1... |
| 17 | Report Slave ID | Report slave ID | None |
| Command | How to write data | Example |
|---|---|---|
| (05) Force Single Coil | 0000 = OFF, FF00 = ON | FF00 |
| (06) Preset Single Register | 12AB (in hexadecimal) | 12AB |
| (15) Force Multiple Coils | To write 1100 0000 01 0000 0011 10 (reverse the bit order within each byte) | 0000 0011 10 |
| (06) Preset Multiple Registers | Write multiple words in succession | To 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
| Code | Description |
|---|---|
| 01 | Illegal function |
| 02 | Illegal data address |
| 03 | Illegal data value |
Command Creation Steps
- Select the function
- Enter the operands
-
Press the [Create Command] button and the Modbus command is created in the command box
The command is shown as bytes joined with '-'
-
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
| Function | Byte count | Data |
|---|---|---|
| 0x03 | 0x02 | 0x00 0x01 |
Error
| Function | Exception code |
|---|---|
| 0x83 | 0x02 |
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
