beautypg.com

6 reference information – Kipp&Zonen 2AP Sun Tracker User Manual

Page 83

background image


REFERENCE

INFORMATION

82



6 REFERENCE

INFORMATION

This section describes the hardware and software interface between a 2AP and an external control
computer (the controller).
To accomplish this purpose the section will:

a. Describe the physical interface.
b. Describe in detail the information that will be exchanged.

6.1 PHYSICAL

INTERFACE


The controller and the 2AP communicate over a serial data link with the following message string
parameters. See section 3.2 for the communication cable connections.

Data Format:

8-bit ASCII

Handshaking: None
Communication Format:

RS232C

300 to 9600 Baud (default 9600)

8

Data bits

1

Stop Bit

No

Parity

Physical

Connection:

3

wire.

6.2 SOFTWARE

INTERFACE


The 2AP and the controller communicate in ASCII message strings. The controller initiates all
communication. All commands from the controller start with a command identifier. Only the first two
letters of the command identifier are necessary, but the entire identifier may be sent if desired. The
command identifier may be separated from any parameters by one or more blanks (ASCII 32).
Parameters are separated from one another by one or more blanks.

The 2AP provides framing with forward error detection (FED). A message starts with a two-
character command identifier and ends with a carriage return (ASCII code 13). Linefeed characters
may be inserted before or after the carriage return; they are discarded. Messages sent by the 2AP
always terminate in a linefeed and a carriage return (ASCII codes 10 and 13 in that order).

As a result of FED framing being used, each message has an additional parameter. This parameter
is a sequence of letters chosen to ensure that the 8-bit sum of all the characters in the message
(excluding linefeeds and the carriage return) is 0. Messages sent by the 2AP always terminate in a
sequence of (possibly no) carets (ASCII 94) followed by the necessary character to derive the
desired sum. The algorithm used to generate this checksum is presented in section 6.4.

Many commands are followed by a one-digit integer specifying which motor the command affects.
The integer 0 means the azimuth motor, 1 means the zenith motor and 2 means the auxiliary motor
(if present in the instrument). Most commands may be followed by numeric parameters. Numeric
parameters are always floating point, with optional decimal places and exponents.