Tamarisk
®
320
Software ICD
6
2
M
E S S A G E
F
O R M A T
-
G
E N E R A L
The serial protocol allows the user to control and monitor status of the thermal imaging module.
Every message transmitted or received over the serial interface uses the same message format. The
message contains the following components:
1.
Start Character
– this is always 0x01. It identifies the start of a new message. Note
that the start character is not guaranteed to be unique in the serial data stream. Other
fields within the message may also contain this value.
2.
Command Byte
– This byte determines the type of command to be performed. For
responses, this byte identifies the type of response.
3.
Parameter Length
– this byte specifies the count of any additional parameter bytes
included in the message. If the message does not require any additional parameter
bytes this value will be zero. Note that the overall message length is limited by the
MTU size (see below).
4.
Parameters
– These bytes contain any parameters, or other data for the message.
Generally, the content and format of this data will depend on the specific message
type. However, a few general rules apply:
♦
When parameter bytes contain strings, these are typically null-terminated arrays of
ASCII codes.
♦
When data bytes contain integer or floating-point values, these are sent in big-endian
order – e.g., the MSB is sent first. This statement is true for both 16 and 32-bit
values.
5.
Checksum
– This is the frame check sequence for the message. It includes all bytes in
the message from the start character to the last parameter byte. It is calculated with the
formula in paragraph 2.1.
The Maximum Transfer Unit (MTU) size of the serial stream is 252 bytes. .
The parameter length for most messages is an even number of bytes (there are exceptions). This is
due to the 16-bit legacy architectures for which the protocol was developed.
The message format is illustrated below:
Table 1 – General Message Format
Byte
Value/Type
Description
1
0x01 (always)
Start of message.
2
Unsigned integer
Command ID.
3
0 to 252
Parameters length.
4 to
(N + 3)
Message
dependent
Additional Data (0 to 252 bytes).
(N + 4)
checksum
Frame check sequence. See paragraph 2.1.