Do MODBUS TCP responses have a TCP header like the requests?

I am coding a MODBUS TCP Windows service in Python. When I use MODSCAN64 to communicate with my Windows Service, all looks good on the service side, but MODSCAN reports a Timeout error.

My hypothesis is that my response requires more information, hence MODSCAN is left waiting.

The MODBUS spec for TCP goes into great detail about the ADU and PDU of the request. The ADU includes the TCP header of seven bytes plus the MODBUS PDU (of variable length).

Nowehere in the spec do I see any mention that the response should also have a TCP header. Is one needed?

Or am I experiencing a real timeout? If so, how do I lengthen the timeout for TCP in MODSCAN64?

Here is a link to my stackoverflow question, which gives an example request and response from my application.
https://stackoverflow.com/questions/65078888/modscan64-gives-timeout-errors-for-all-responses
 
Is it adequate that the response's MBAP header be identical to the request header (apart from the length)? Or are there specifics to the slave that must be part of the header?
 
The response header is actually required to be identical to the request header (apart from the length).

The use of each field is explained in the spec (see the Server column below)
1606774830858.png
 
I revisited the version of the MODBUS spec I have - it is different from yours and the sections are numbered differently, less detailed and does not indicate that the response has a header. I will look at your spec.
 
There are a few Modbus specifications. All are listed here:
https://modbus.org/specs.php

Perhaps you were using the first link, MODBUS Protocol Specification, which is is the MODBUS APPLICATION PROTOCOL SPECIFICATION that mostly details the requests and responses.

You want the MODBUS TCP/IP link which is the MODBUS MESSAGING ON TCP/IP IMPLEMENTATION GUIDE and goes into more detail on the TCP implementation.
 
Top