ModTest Manual v2.14 - 5.2. Message tracing
To enable message tracing, select the→ checkbox.
If message tracing is enabled, each Modbus message sent or received is logged as two lines.
The first line begins with the time that the message was sent or received. This is followed by the character '<' for an incoming message or the character '>' for an outgoing message. The '<' or '>' is followed by the transaction identifier (only for TCP packets), slave identifier, PDU length (in bytes), function code, and then the first few bytes of the body of the message (in hex).
The second line of a message trace provides an interpretation of the main fields in the message. This line also begins with the time. After the time is the word "Request" for a request message, or "Response" for a normal response message. "Request" or "Response" is followed by the function code (expressed in words) and the main fields of the message (address, count, etc.).
Here is an example of an outgoing and an incoming message:
16:11:20.324: > transid 5 slave 1 pdulen 5 func 3: 00 c8 00 01 16:11:20.325: Request: Read Holding Registers: address 200, count 1 16:11:20.326: < transid 5 slave 1 pdulen 4 func 3: 02 00 00 16:11:20.327: Response: Read Holding Registers: byte count 2, data bytes 2
If the message is an error response, the second line will contain "Error response" followed by the error code (expressed in words). For example:
16:23:43.186: > transid 10 slave 1 pdulen 5 func 3: 00 64 00 01 16:23:43.188: Request: Read Holding Registers: address 100, count 1 16:23:43.192: < transid 10 slave 1 pdulen 2 func 131: 02 16:23:43.193: Error response: Illegal data address
If ModTest receives any data that is not correctly formatted as a Modbus message, it will also trace this data. The data is displayed in hex on a separate line, preceded by the time and the character '<'. This line is followed by a line with the word "Discarded" followed by the number of bytes discarded and an explanation of what is wrong with the format. For example:
15:18:13.554: < 00 01 00 00 00 06 01 03 00 64 02 01 15:18:13.555: Discarded 12 bytes: CRC failed
Troubleshooting help is available for the "Error response" and "Discarded" lines. Click on the line in the log window (or move to it with the keyboard and press space) to display the help.