HART系列讲座(二):HART报文结构
The structure of a HART me age is shown below: The preamble, of between 5 and 20 bytes of hex FF (all 1"s), hel the receiver to synchronise to the character stream. The start character may have one of several values, indicating the type of me age: master to slave, slave to master, or burst me age from slave; also the addre format: short frame or long frame. The addre field includes both the master addre (a single bit: 1 for a primary master, 0 for a secondary master) and the slave addre . In the short frame format, the slave addre is 4 bits containing the "polling addre " (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 contai the HART command for this me age. Universal commands are in the range 0 to 30; common practice commands are in the range 32 to 126; device- ecific commands are in the range 128 to 253. The byte count byte contai the number of bytes to follow in the status and data bytes. The receiver uses this to know when the me age is complete. (There is no ecial "end of me age" character.) The status field (also known as the "re o e code") is two bytes, only present in the re o e me age from a slave. It contai information about communication errors in the outgoing me age, 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 me age duration reasonable. (But some devices have device- ecific commands using longer data fields.) See also the HART data field. Finally, the checksum byte contai 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.
|