16
Macintosh OS, etc.). Should another programming language be desired to implement the
examples, the gist of examples should be fairly easy to glean if they are viewed as pseudo code
– the examples should be easy to port to C++, Java, Pascal, BASIC, and other high level
languages, or even various forms of scripting languages.
4.2.1
Preparing the Command Byte
All remote control command codes for the Lambda SC require no more than one byte (8 bits)
of storage for each command. If using a programming language that make a distinction
between unsigned and signed bytes, always select unsigned only. “Unsigned” means that only
positive numbers can be stored, whereas “signed” means that either positive or negative
values can be stored. An unsigned byte can hold 256 different positive values (0 through 255).
A signed byte can store only 128 different positive values (0 through 127, and 127 different
negative values (-1 through –127). In the C programming language, an unsigned byte type is
expressed as “unsigned char” followed by the name of the variable, such as:
unsigned char command_byte;
…where “command_byte” is the name the programmer chooses to give the variable.
4.2.2
Command Transmission Protocol
The Lambda SC does not use any of the standard protocols commonly used for serial line or
USB communications between computers or between a computer and a peripheral device.
The Lambda SC controller, however, does generate a primitive form of protocol of which
control software running on the remote computer can, and should, make use. This protocol
consists of two main components: “confirmation command echo” and “command completion
indicator”. This command transmission protocol is used in the same manner for RS-232
serial and USB port connections.
4.2.2.1
Confirmation Command Echo
When the host computer sends a command to the Lambda SC, each byte received is
immediately echoed back to the host computer. This echoing back of each sent byte is a
confirmation that the byte has been received and will be acted upon shortly. A short period
after the last byte of a command has been echoed back, the Lambda SC sends a confirmation
byte (described next) that indicates the operation associated with the command completed.
4.2.2.2
Command Completion Indicator
When the Lambda SC completes the operation associated with the command it has just
received, it transmits back to the host computer a byte value of 13 decimal (0D hexadecimal,
00001101 binary). This byte value corresponds to an ASCII carriage return (often
abbreviated as “CR”).
LAMBDA SC USB INSTALLATION & CONFIGURATION – REV. 1.03 (20080617)