Remote command protocol – Seaward ClareHAL User Manual
Page 132

131
Remote Command Protocol
1. Protocol Description
The Remote Command Protocol is an RS232 protocol that allows Clare
testers to be reliably and quickly configured from a remote host and
also allows the remote host to send commands to the instrument in
order for the system to automatically perform electrical tests.
The protocol is based on an ASCII-HEX notation. That is, every byte of
data is coded using two hex digits in the range ‘0’ through ‘9’, and ‘A’
through ‘F’. Upper case ASCII hex must be used throughout. This is a
common notation that allows easy detection of corrupted characters,
and avoids the need for special encodings of control characters etc.
The inefficiency of this encoding technique is of less concern than the
benefits of simplicity and reliability.
The protocol is also line based. This means that a carriage return
character, 0x0D, is used to terminate a command. This also implies
that a command must start at ‘the beginning’ of a line – there must be
no extraneous characters after the last CR and before the command,
otherwise the whole command will be ignored as garbage.
Any request that is not properly formatted (eg missing characters, bad
characters, bad length, bad CRC, etc), is silently ignored (as is a
command that does not start ‘at the beginning of a line’). A host that
does not receive an ACK, NAK, or interim ACK within a short period of
time must assume that the transmission was corrupted, and issue a
retry.
Within the protocol it is necessary to specify some values as multi-byte
values. In all cases the protocol is defined as a ‘big-endian’ protocol –
multi-byte values are always encoded with the most-significant-byte
first. Thus a binary value of say 0x1B9C is sent as ASCII characters
‘1B9C’ in that order. Beware: ‘big-endian’ encoding is opposite to that
found on PC architectures!
Requests from the host are formatted as follows:
Two ascii hex digits for an ever-incrementing command
sequence number. A host should increment it's
command sequence number before transmitting a
command (but not when transmitting retries of the
same command). The sequence number is copied to all
Your HAL tester