Field
Size
Comment
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. See
Table: Response code error codes
.
Note:
If there is not an applicable error code, a “00” will be transmitted.
4
RESPONSE DATA
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.
Note:
Optional, only required if the command code requires it.
5
CHECKSUM
2 ASCII 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.
6
TERMINATOR
1 ASCII hex character
ASCII carriage return
ASCII value of carriage return character placed at the end of a packet. There is not a
space between the checksum and terminator field.
Table 6. Response code error codes
Code
Description
0
Command executed successfully.
1
Bad command format. Returned is command syntax is not valid.
2
Bad command code. Returned in command code is not valid.
3
Bad checksum. Returned if checksum is not valid.
4
Timeout. Returned if complete command packet was not received within 2
seconds from receiving the tilde start character.
6
Unknown error. Used for internal purpose.
7
Communication error. Returned if null character 0x00 is received or if buffer
overflow occurred.
8
Bad parameter. Returned if command parameters are not valid.
Page 40
900031_J
900031_J - Serial communication