3DM
®
-GX5-35
DCP Manual
6.
MIP Packet Reference
6.1
Structure
Commands and Data are sent and received as fields in the LORD “MIP” packet format. Below is the
general definition of the structure:
The packet always begins with the start-of-packet sequence “ue” (0x75, 0x65). The “Descriptor Set”
byte in the header specifies which command or data set is contained in fields of the packet. The
payload length byte specifies the sum of all the field length bytes in the payload section.
6.2
Payload Length Range
The payload section can be empty or can contain one or more fields. Each field has a length byte and a
descriptor byte. The field length byte specifies the length of the entire field including the field length byte
and field descriptor byte. The descriptor byte specifies the command or data that is contained in the
field data. The descriptor can only be from the set of descriptors specified by the descriptor set byte in
the header. The field data can be anything but is always rigidly defined. The definition of a descriptor is
fundamentally described in a “.h” file that corresponds to the descriptor set that the descriptor belongs
to.
LORD Sensing provides a “Packet Builder” functionality in the “MIP Monitor” software utility to simplify
the construction of a MIP packet. Most commands will have a single field in the packet, but multiple field
packets are possible. Extensive examples complete with checksums are given in the command
reference section.
6.3
MIP Checksum Range
The checksum is a 2 byte Fletcher checksum and encompasses all the bytes in the packet:
6.4
16-bit Fletcher Checksum Algorithm (C Language)
for(i=0; i<checksum_range; i++)
{
checksum= mip_packet[i];
checksum= checksum_byte1;
}
checksum = ((u16) checksum_byte1 << 8) + (u16) checksum_byte2;
92