S
ENSOR
C
OMMANDS AND
R
ESPONSES
16
Copyright LMI Technologies Inc. 2003
3.3
P
ROTOCOL
T
his section describes the contents of the packet used to transmit commands and data from the
host to the sensor and from the sensor to the host.
3.3.1
G
ENERAL
P
ACKET
P
ROTOCOL
The software protocol that occurs via the asynchronous RS-485 serial communication link
describes the packet or group of information that is transmitted and generally will consist of an
address, command, optional data and checksum or CRC.
3.3.2
P
ACKET
D
ESCRIPTION
The packet consists of a contiguous series of bytes with the same format being used to transmit
from the host to the sensor and from the sensor to the host.
The maximum size of any single packet is 259 bytes. If the data block to be transmitted
exceeds 259 bytes then the total data block must be transmitted with more than one packet. For
example, if the total data consists of 700 bytes then this will take a total of 3 packets of data to
be sent.
P
ACKET
F
ORMAT
[
STX
][
Address
][
CommandSize
][
Command
][
Data
..
Data
][Checksum]or[CRC]
[
STX
]
1 byte
Start transmission character (02h)
[
Address
]
1 byte
0 broadcast to all sensors.
1..255 addressing a specific sensor.
Note:
This byte identifies the sender when received by the host.
[
CommandSize
]1 byte Number of bytes from command to the last data byte. Maximum 255.
[
Command
] 1 byte
1..255 See command descriptions.
[
Data..Data
N byte Number of bytes is command dependent.
[
Checksum
]
1 byte 2s Complement sum of all bytes inclusive of STX and last data byte.
OR
[CRC]
2 byte 16 bit CRC of all bytes inclusive of STX and last data byte