Commands, Definitions, Command set – Sensoray 417 User Manual
Page 14

13
Sensoray Model 417
Chapter
4
Programming
Commands
The 417 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 adheres to the above
format. The opcode—always present in the first command byte—specifies the function to be per-
formed. A channel number, present in the Channel field, is required by commands that address a
particular channel. In other commands, the Channel field is sometimes used as an extension of the
Opcode field.
Definitions
The following definitions and conventions are used throughout this chapter when describing com-
mands and responses:
•
The symbolic name “Chan” represents a coprocessor channel number. Valid channel
numbers range from 0 through 31, inclusive.
•
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.
•
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 and begins with the leftmost byte.
•
A command consists of a byte string which is passed from host to 417.
•
A command response consists of a byte string which is passed from 417 to host.
Command Set
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 code snippets are provided to illustrate command usage. All programming examples are
written in Visual Basic. If you are employing a different developer’s environment for your applica-
tion, these programming examples can be easily converted to the language of your choice.
Table 7: Format of first command byte
D7
D6
D5
D4
D3
D2
D1
D0
OPCODE
CHANNEL