beautypg.com

Manual-19 – Rane SR 2 User Manual

Page 19

background image

Manual-19

<msgtype> The msgtype is a one byte set of flags indicating options, bit 7=MSB:

bit 0)

set = checksum is valid

bit 1)

set = there has been an error (response only)

bit 2-5) reserved, cleared to 0

bit 6)

always 1

bit 7)

always 0

If the controller wants the SR 2 to verify the checksum, it would send a value of

$41, or an ASCII ‘A’. If the controller wants the SR 2 to ignore the checksum, it

would send a value of $40, or an ASCII ‘@’.

The SR 2 echoes back the <msgtype> it was sent. In the case of an error, the SR 2

sets bit 1.

<devtype> The SR 2 device type value is $32, or an ASCII ‘2’. The SR 2 also ac-

cepts a value of $30, or an ASCII ‘0’, the universal device type used for polling.

The SR 2 always returns its device type of $32.

<checksum> The checksum is defined as the sum of the ASCII encoded values of

the <command/data> section. The sum is then masked with $007F to produce

one byte with the MSB set to zero.

The controller would send a valid checksum as defined above if it sent a value of

$41 for the <msgtype>. The SR 2 then verifies the sent checksum by calculat-

ing the checksum from the data it received in the <command/data> section of

the sent message. On the other hand, if the controller sent a value of $40 for the

<msgtype> the SR 2 ignores the sent checksum. The controller must always send

a checksum less than or equal to $7F, even if it intends for the SR 2 to ignore it.

The SR 2 <checksum> response is based on the <msgtype> it was sent. If the SR

2 received a <msgtype> of $41, it returns a valid checksum (as defined) calculated

from it’s response data. If the SR 2 received a <msgtype> of $40, it returns zero.

<command/data> The general format is . The

commas are part of the structure and act as delimiters between

the ASCII encoded commands and data. Concatenation of commands is limited

to four commands. Text string arguments are delimited with quotes ("String").

If the string argument contains quotes, an accent character (`) placed in the

string argument will be interpreted by the SR 2 as a double quote character (").

The ASCII value for the accent character is $60, not to be confused with a single

quote character ('), ASCII value $27. For example: string argument: "A string that

contains 'quotes' " is interpreted as: A string that contains "quotes".

The controller sends commands/arguments for the SR 2 to process. This section of

the message is limited to 40 characters for the SR 2. See the SR 2 Command Set

section for details of valid commands.