Protocol Stack Trace Log

The protocol stack trace log provides the user with an indication of the Modbus messages received and sent by the Modbus TCP Slave Interface at the communications port level. Each logged message is time stamped.

The user may enable or disable trace logging by defining a trace log parameters record within the Modbus TCP Slave Interface configuration file..

When enabled, the Modbus TCP Slave Interface writes protocol stack trace messages to the file MTCPSI.err in the log sub-directory of the Project root directory.

Example

If the Project had been created in the directory C:\Program Files\GE Fanuc\Proficy CIMPLICITY\Projects\test\, then the trace message file specification is C:\Program Files\GE Fanuc\Proficy CIMPLICITY\Projects\test\log\mtcpsi_rp.err.

The following is an excerpt from an actual trace log file.

1999-11-09 16:35:34.876 Started Modbus TCP Slave Interface (MTCPSI_RP) – Using IP address 0.0.0.0

1999-11-09 16:37:29.010 Accepted connection [id = 524] from IP address 155.177.177.102 – bound to local IP address 155.177.177.102

1999-11-09 16:37:36.250 <- [id = 524] 000100000006 010300000064

1999-11-09 16:37:36.290 -> [id = 524] 0001000000CB

0103C8000100020003000400050006000700080009000A000B000C000D000E000F0010001100120013001400150016001700180019001A001B0001C001D001E001F0020002100220023002400250026002700280029002A002B002C002D002E002F0030003100320033003400350036003700380039003A003B003C003D003F0040004100420043004400450046004700480049004A004B004C004D004E004F0050005100520053005400550056005700580059005A005B005C005D005E005F00600061006200630064

.

The above will be repeated several times. It represents the Read Holding Registers transaction

.

1999-11-09 16:40:11.503 <- [id = 524] 0001000000CF

011000630064C8007F007F007F007F007F007F007F007F007F007F007F007F007F007F007F007F007F007F007F007F007F007F007F007F007F007F007F007F007F007F007F007F007F007F007F007F007F007F007F007F007F007F007F007F007F007F007F007F007F007F007F007F007F007F007F007F007F007F007F007F007F007F007F007F007F007F007F007F

1999-11-09 16:40:11.674 <- [id = 524] 000100000006 011000630064

.

The above will be repeated several times. It represents the Read Holding Registers transaction

.

1999-11-09 16:40:18.373 Closing connection [id = 524] with 1p address 155.177.177.102

The format for a trace log message is:

<date> <time> <direction> <slave address><function code> <data> <CRC>

Where:

<date>

is \the date the message was received or sent.

<time>

is the time the message was received or sent.

<direction>

is an arrow indicating whether the message is a request or response message.

Request (left arrow): <-

Response (right arrow): ->

 Note: the remaining fields are displayed as hex values (two characters per byte).

<slave address>

is the emulated slave device address.

<function code>

is one byte representing the requested operation. If an exception response is generated, the high bit is set.

<data>

is one or more bytes containing function parameters, data values, and/or exception code.

<CRC>

is trailing two bytes containing the cyclical redundancy check value. 

More information

Modbus TCP Slave troubleshooting.