beautypg.com

Commands – Sensoray 518 User Manual

Page 17

background image

16

Commands

The 518 is accessed through a simple yet powerful built-in command set. Commands vary in
length depending on the size of encapsulated data. In some cases, invocation of a command will
cause the coprocessor to return data to the host. In such cases, the host must read the command
response before issuing another command.

Each command consists of at least one byte. The first byte of each command typically adheres to
the above format. The opcode -- always present in the first command byte -- specifies the
function to be performed. The channel number is required only in commands that address a
particular channel.

These conventions are used in describing commands and responses:

1. The symbolic name CHAN represents a coprocessor channel number. Valid channel

numbers range from 0 through 7, inclusive.

2. A byte is represented as a number or expression contained by parenthesis. For example,

(16 + CHAN) represents a byte having a value equal to 16 plus a channel number.

3. A byte string is represented as an ordered sequence of bytes separated by commas. The

sequence is defined from left to right. For example, the byte string (95+CHAN),(5),(0)
contains three bytes.

4. A command consists of a byte string, which is passed from host to 518 in the proper

sequence.

5. A command response consists of a byte string, which is passed from 518 to host in the

proper sequence.

The remainder of this chapter discusses the coprocessor command set. Each command
function is described along with the associated command and response byte strings.
Sample program segments are listed to illustrate command usage. The program segments
are all written in QuickBasic but can be easily converted to the programming language of
your choice.

D7

D6

D5

D4

D3

D2

D1

D0

OPCODE

CHANNEL