Page 18 of 28
Gamma Vacuum DIGITEL MPCq Users Manual
Document 900034, Rev B
14.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 acknowledgment 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
5.1 Field
5.2 Size
5.3 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 6. Response Code Error Codes” on page 18.)
3. RESPONSE CODE
2 ASCII 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. (See “Table 6. Response Code Error Codes” on page 18)
NOTE:
If there is not an applicable error code, a “00” will be transmitted.
4. RESPONSE DATA
As needed
ACSII 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 characters
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
6.1 Code
6.2 Description
00
Command executed successfuly.
01
Bad command format. Returned is command syntax is not valid.
02
Bad command code. Returned in command code is not valid.
03
Bad checksum. Returned if checksum is not valid.
04
Timeout. Returned if complete command packet was not received within 2 seconds from receiving the tilde start character.
06
Unknown error. Used for internal purpose.
07
Communication error. Returned if null character 0x00 is received or if buffer overflow occurred.
08
Bad parameter. Returned if command parameters are not valid.