Field
Size
Comment
5
CHECKSUM
2 ASCII hex characters
Computed checksum of packet
The calculated checksum must have its value in ASCII hexadecimal notation. It is
calculated by adding the decimal value of all characters in the packet (excluding start,
checksum, and terminator), and then dividing the result by 256. The integer remainder
converted to two ASCII hex digits is the checksum. When a remote device receives a
packet, the passed checksum is compared with a computed checksum and if they do not
match, the device discards the packet.
Note:
Checksum field can be bypassed by specifying “00”.
6
TERMINATOR
1 ASCII hex character
ASCII carriage return
ASCII value of carriage return character placed at the end of a command packet. There is
not a space between the checksum and terminator field.
12.2.
Gamma protocol response packet structure over serial connection
The response packet is made up of at least five fields and contains
information to let the controlling computer know the command requested
was either recognized and accepted (STATUS = “OK”), or an error condition
occurred (STATUS = “ER”). The minimum packet also contains a RESPONSE
CODE that is used either to pass an error code (if STATUS = “ER”), or is
available for each unit to use as needed for a STATUS return of “OK”. The
minimum response packet (simple acknowledgement with no data) would
consist of the following fields and would be 12 bytes long.
Table 5. Response packet structure over serial connection
Address space Status
space Response
code
space Response
data
space Checksum Terminator
2 bytes 1 byte 2 bytes 1 byte 2 bytes
1 byte variable
1 byte 2 bytes
1 byte
Field
Size
Comment
1
ADDRESS
2 ASCII 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.
2
STATUS
2 ASCII hex 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 followed by an error code.
See
Table: Response code error codes
.
3
RESPONSE CODE
2 ASCII hex characters
Range 00 through FF
Page 39
900031_J
900031_J - Serial communication