Modbus - What is the Modbus Transaction Identifier
When sending a Modbus TCP frame, the frame is split into 6 different sections:
1) Transaction Identifier ( 2 bytes )
2) Protocol Identifier (2 bytes)
3) Length Field (2 bytes)
4) Unit Identifier (1 byte)
5) Function Code (1 byte)
6) Data bytes (n bytes)
The most important bytes for this frame are the Unit Identifier, the Function Code and the Data bytes. Some scanners will only use these bytes when polling for and displaying information via the Modbus TCP protocol.
However, other scanners will use the transaction identifier as a means of validating response messages.
The actual use for the transaction identifier is for synchronization between messages of server and client. So if a scanner checks the transaction identifier from the query it sent against the transaction identifier from the response it receives and the values do not match, it identifies the response message as an invalid Modbus message and will timeout.