Sensorsoft ST6105C User Manual - page 18
Sensorsoft Thermometer User Manual
Receiving responses from the Sensorsoft Thermometer
Each response packet the Sensorsoft Thermometer returns is in the following format:
RESPONSE-byte
A single byte response code indicating the type of response. Valid codes are 90 hex or 94 hex.
PACKETlength-bytes
Two bytes indicating the total length of the packet from start to finish (includes CRC bytes).
DATA-byte(s)
Most responses return additional data in the form of byte(s). In response to a temperature
command, two bytes are returned for DATA-byte(s). In response to a status command, one byte is
returned for DATA-byte(s). See
SENSORSOFT DEVICE STATUS BYTE FORMAT
chart.
CRC-bytes
A two byte (16 bit) Cyclic Redundancy Check. This placeholder is filled with CRC bytes
calculated by the Sensorsoft device on the entire packet from the RESPONSE byte to the last
DATA-byte. These bytes allow the host to verify the integrity of the response packet. You may
choose to use or ignore these bytes depending on your programming skill or application.
The Sensorsoft device returns a normal RESPONSE-byte
(90 hex)
in acknowledgement that the
previous host command was received and executed without errors. The Sensorsoft device only
acknowledges correctly received commands that have no CRC errors. If the Sensorsoft device
detects a CRC error in a received command packet, it does not respond to the command. It is
considered the job of the host to time-out and re-transmit that command packet.
When an internal problem occurs inside the Sensorsoft device it sends out an abnormal response
byte
(94 hex)
in response to any command from the host. If the host receives this response byte, it
must immediately read and interpret the Sensorsoft device’s status to determine the problem. See
SENSORSOFT DEVICE STATUS BYTE FORMAT
chart.
The generator polynomial used for the CRC is hexadecimal 1021. The following references
provide information for readers who wish to use the CRC capability;
•
Calculating CRC’s by Bits and Bytes, Greg Morse, Byte Magazine, September 1986, Pg.
115-124
•
Implementing CRC's, Jack Crenshaw, Embedded Systems Programming Magazine, January
1992, Pg. 18-45
•
Technical Aspects of Data Communication, John McNamara, Digital Equipment Press 1982,
Pg. 110-122
•
Data and Computer Communications, 2nd edition, William Stallings, Macmillan Publishing,
Pg. 107-112
•
The modem reference: the complete guide to selection, installation, and applications, 2nd
edition, Michael A Banks, Brady Publishing 1991, Pg. 27-42
18