MPCe/LPCe Users Manual
33
Field
Size
Comment
1. ADDRESS of unit
2 hex characters
Range 00 through FF
This field is filled in with the hexadecimal representation of the integer address of the unit. The range provides
255 unique addresses. The controlling computer will use this field to determine that the correct remote unit is
responding.
<SPACE>
2. STATUS MNEMONIC
2 ASCII characters
Either OK or ER
This field is made up of two ASCII characters and is either OK or ER. OK indicates success in recognizing the
command. ER indicates an error condition which can mean that the command is invalid, or that the remote unit
received the command but is still busy with a previous command. Specific information about ER is reported in the
RESPONSE CODE field.
<SPACE>
3. RESPONSE CODE
2 hex characters
Range 00 through FF
For an error condition with an incoming command, this field returns an error number to the controlling computer.
For non-error conditions, this field returns a status byte/word to the controlling computer, which is defined in the
MPC, and can vary with the needs of individual commands within a unit, as well as varying from unit to unit. Data
must be in ASCII printable format.
<SPACE>
4. DATA field(s), optional
as needed
ASCII printable characters only
Data field(s) are used to respond to commands requesting data. For example, a command requesting the current
voltage setting in a unit would have the reading placed in a data field. Data must be in ASCII printable format.
There is no limit on the number or size of data fields. Data is not required for all responses.
<SPACE>
5. CHECKSUM
2 hex characters
Computed checksum of packet
Checksum contains a simple computed checksum of the command packet. The value must be in ASCII
hexadecimal notation. The checksum is calculated by adding the decimal value of all characters in this packet
(including the space before the checksum field) and then dividing the result by 256 (base 10). The integer
remainder converted to two ASCII hex digits is the packet checksum. When the controlling computer receives a
response packet, the passed checksum is converted from the hex value to a binary integer and compared with a
computed checksum. If they are not the same, considers it an error, and repeats the last command. When
qualified technicians are testing the remote unit using a dumb terminal this returned checksum value can be
ignored.
6. Terminator character
2 hex characters
ASCII carriage return
This field is an ASCII carriage return placed at the end of a packet. This character is not the newline character
“\n” which is actually an ASCII linefeed, but can be assigned using the “\r” designation in a string. There is not a
space between the checksum and terminator field.