The structure of a HART message is shown below:
The preamble, of between 5 and 20 bytes of hex FF (all 1"s), helps the receiver to synchronise to the character stream.
The start character may have one of several values, indicating the type of message: master to slave, slave to master, or burst message from slave; also the address format: short frame or long frame.
The address field includes both the master address (a single bit: 1 for a primary master, 0 for a secondary master) and the slave address. In the short frame format, the slave address is 4 bits containing the "polling address" (0 to 15). In the long frame format, it is 38 bits containing a "unique identifier" for that particular device. (One bit is also used to indicate if a slave is in burst mode.)
The command byte contains the HART command for this message. Universal commands are in the range 0 to 30; common practice commands are in the range 32 to 126; device-specific commands are in the range 128 to 253.
The byte count byte contains the number of bytes to follow in the status and data bytes. The receiver uses this to know when the message is complete. (There is no special "end of message" character.)
The status field (also known as the "response code") is two bytes, only present in the response message from a slave. It contains information about communication errors in the outgoing message, the status of the received command, and the status of the device itself.
The data field may or may not be present, depending on the particular command. A maximum length of 25 bytes is recommended, to keep the overall message duration reasonable. (But some devices have device-specific commands using longer data fields.) See also the HART data field.
Finally, the checksum byte contains an "exclusive-or" or "longitudinal parity" of all previous bytes (from the start character onwards). Together with the parity bit attached to each byte, this is used to detect communication errors.