11
Key Mode 2
The response format is similar to Mode 1 but the “a” is replaced with six consecutive ASCII characters. It is intended
mainly for debugging purposes and hosts with limited processing capability.
In this mode the key press information is returned as 6 individual bytes. If a key has been pressed then the ASCII
character “1” (hex 0x31, decimal 49) is returned else ASCII character “0” (hex 0x30, decimal 48) is returned. As the
returned data is in ASCII notation a dumb terminal can be used to view the data stream.
Key1 is transmitted first.
example:
K000000
Command accepted, no keys pressed
K100010
Command accepted, Keys 1 and 5 have been pressed
E000100
Command error detected, key 4 pressed
?000001
Command unrecognised, key 6 pressed
P000000
Command rejected, unit being configured (Any key presses are discarded)
Operational Modes
The unit can be configured to expect data in a certain format. These formats are termed “Operational Modes” and range
from a simple VDU like mode (0) to a fully error checked mode (4).
The operational mode is configured using the display keypad and in-built menus. Refer to the instruction manual for
more information.
The modes are:
Mode 0:
Commands are executed immediately, no reply message except when specifically requested.
Plain text is written directly to the screen, no reply message.
Mode 1:
Commands are executed immediately, a response is returned to each command. Plain text is
written directly to the screen, no reply message.
Mode 2:
Multiple commands can be sent, but these are not executed until a “Command Implement” <CI>
command is sent. One reply is returned for each set of commands. An error in any of the
commands will result in a Command Error response. Plain text is ignored.
Mode 3:
As Mode 2 but the <CI> command is replaced by a <CCn> command where n is a single byte
simple checksum of all characters sent (including spaces) up to, but not including the <CCn>
command. The returned command has a similar single byte checksum appended to the end of
the response. The command string is not actioned if the checksum of the data received does not
match the parameter of the <CCn> command. Plain text is ignored
Mode 4:
As Mode 3 but the <CCn> is replaced by <CRnn> where nn is a 16-bit CRC code.
CRC Generation
The 16-bit CRC used in the protocol is the same as used for the well known Modbus Protocol. Details are as follows:
The CRC is started by first preloading a 16-bit register to all 1's. Then a process begins of applying successive eight-bit
bytes of the message to the current contents of the register. Only the eight bits of data in each character are used for
generating the CRC. Start and stop bits, and the parity bit, do not apply to the CRC.
During generation of the CRC, each eight-bit character is exclusive ORed with the register contents. The result is
shifted in the direction of the least significant bit (LSB), with a zero filled into the most significant bit (MSB) position.