Serial Protocol and
Commands for the UPL_2 1:1 downlink controller.
This document covers control
standards for C&M UPL_2 1:1 uplink controller.
Control Modes
Only one control point can be
assigned to each control mode. Only one control mode
ever has control of the system at one time; control
being the ability to change the system state. All
user interfaces have access to system status.
The rules and hierarchy that
apply to these three control modes are:
-All control points will always
provide status. Commands that modify either the w/g
switch positions or the w/g switch controller's
state will be accepted only from the valid control
point.
-The Local panel can always
toggle between all control points. The front panel
is the "super user" and may transfer the control
point at any time.
-No control transfer may be
commanded via the CIF port. Comments Regarding Each
Control Mode
CIF (Computer Interface)
The CIF port allows the user to
integrate a system into his monitor and control
system. Software issues regarding the CIF port, such
as protocol and command set, are listed later in
this document. A CIF port can be user selected to
either RS-232 operation or RS-422/485 (4-wire)
operation.
The C&M Systems standard pin out
for the CIF connector is:
CIF Connector Pin Listing
Rear Panel Female D-shell Pin
Number, Signal Name (signal direction relative to
unit)
I SHIELD
2 TX (RS-232)
3 RX- (RS-422/485)
or
RX (RS-232)
4 TX- (RS-422/485)
5 GND
6 TX+ (RS-422/485)
7 not connected
8 not connected
9 RX+ (RS-422/485)
Introduction - CIF Port
Protocol and Command Set
The CIF protocol uses ASCII
characters in a packet message structure to provide
serial asynchronous communications between a
computer and the switch controller. The CIF protocol
includes commands for controlling and monitoring the
switch controller. Switch controller control
commands are executed if the controller is in CIF
control mode. Switch controller monitoring commands
are valid at all times unless otherwise stated.
Unless otherwise specified, all
numbers are base 10.
Protocol Message
Structure
The CIF protocol uses a packet
style message structure. Each packet typically
includes a header byte, address byte, command byte,
any necessary parameter byte(s), an ending byte and
a checkbyte. The word "byte", in the context of this
document, refers to a 7-bit ASCII character. In the
serial message stream, each character includes 7
data bits, 1 start bit, 1 stop bit. The parity bit
will exist if either Even, Odd, or Mark parity are
chosen. No parity bit will be included if None is
chosen. Since 7 data bits are used, ASCII characters
0 through 127 are the "alphabet" for all valid
messages. To avoid incompatibilities with existing
controllers, the actual alphabet used avoids most
control characters. The protocol provides choices
for header/ending byte format, checksum format, and
suffix CR/LF characters which are described later.
The user's computer generates and
sends packets to the switch controller that can
contain only one command and associated parameters.
The switch controller can process only one received
packet at a time; packets are not queued for
processing. If a command is sent to the switch
controller CIF port, a response will be returned
within 100 ms;.
If the switch controller was able
to execute a command received via the CIF, the
response message will indicate what command was
executed and return any necessary parameters. In the
case of a query command, the returned parameters are
referred to as Status Bytes and are described in a
separate section.
If the switch controller was not
able to execute a command received via the CIF, a
reject code will be included in the response
message. If the STX/ETX header/ending byte message
format was used, the header byte will be NAK, thus
indicating a rejection. Command and Response Format
Command Received by Switch
Controller HEADER BYTE, ADDRESS BYTE, COMMAND BYTE,
PARAMETERS AS REQUIRED, ENDING BYTE, CHECK BYTE
Response Returned When Command is
Accepted HEADER BYTE, ADDRESS BYTE, COMMAND BYTE,
RESPONSE BYTE(S),ENDING BYTE,CHECK BYTE
Response Returned When Command is
Rejected HEADER BYTE, ADDRESS BYTE, COMMAND BYTE,
REJECT CODE(S), ENDING BYTE, CHECK BYTE
To avoid problems with control
characters, etc., device addresses, commands,
parameters, and responses are limited to standard
ASCII values 32 through 126.
Header and Ending Bytes
Two message formats are supported
- STX/ETX header ending bytes and printable ASCII
header/ending bytes.
STX/ETX option
Commands:
Header byte = STX (ASCII 02)
Ending byte = ETX (ASCII 03)
Responses:
Header byte = ACK (ASCII 06) is
used if the switch controller accepted the command.
Header byte = NAK (ASCII 21) is
used if the switch controller rejected the command.
A reject code(s) should indicate
why the command was rejected.
Ending byte = ETX (ASCII 03)
ASCII option
All commands and responses:
Header byte= { (ASCII 123)
Ending byte = } (ASCII 125)
Address Byte
The address byte provides the
computer port with an address. It may be set from 48
to 111.
Command Byte
The range of command bytes is
from 32 to 111.
Response Byte(s)
The response byte(s) range from
32 to 95.
Reject Byte(s)
If a command is not accepted, a
reject code is returned.
ASCII Character Decimal Meaning
a 97 Command byte not recognized.
b 98 Illegal parameter or
parameter out of range.
c 99 CIF is not enabled and the
command can't be executed.
d 100 Command cannot be executed
because the backup amplifier is already in
use.
e 101 Not executed because the
switch controller is in Auto.
f 102 Not executed because the
backup amplifier has failed.
g 103 Not executed, VRPC not
present in the system.
h 104 Other control point takes
precedence over CIF request.
i 105 RF Power command is
rejected because no amplifier is routed to the
monitored output (Antenna or
Load).Check Byte
Two options are available:
Longitudinal Parity - The check
byte is the exclusive OR of all message bytes
including the header and ending bytes. CR and LF are
not included in the calculation - CR and LF are
described on the next page.
Checksum - This formula provides
a printable ASCII checksum.
N
Checksum = 32 + MOD95[( message
byte) - (32 * N)]
i=1
where: MOD95 is the operation
modulo 95.
N is the total number of bytes in
the message including header and ending bytes
message byte is the ith message
byte where 1 i N.
Example: Calculate the check byte
for the message {A1 } using the checksum rule.
Character: { A 1 } ASCII: 123 65
49 125 i 1 2 3 4
Check Byte = 32 +
MOD95[(123+65+49+125) - (32*4)]
= 32 + MOD95[234]
=32+44
= 76 which translates to the
ASCII character L
Notes:
1. The sum check byte cannot be
used with the STX/ETX option.
2. Parity errors will cause the
command to be ignored and no response message to be
issued.
3. If any character is received
before or during the transmission of a response
message, the response
message will be deleted. This
will not interfere with the execution of a command.
Carriage Returns and Line Feeds
The user may chose to use
carriage returns and line feeds; they are appended
to the command response. If CR and or LF are
enabled, a command will not be processed until the
CR and or LF are received. A11 responses to commands
will be followed by a CR and or LF. CR and LF
characters are not included for check byte
calculations.
User Selectable Serial Port
Parameters
Hardware: RS-232 or RS-422/485
(4-wire)
Termination Resistor for
RS-422/485 receive.
Serial Format:
Address - 48 through 111 (if DIP
switches are set outside of this range, use closest
range end)
Baud - 9600, 4800, 2400, 1200
Parity - Even, Odd, None, Mark
Protocol (header/ending bytes) -
STX/ETX or ASCII {}
Check Byte Type - XOR or Sum
Bad Check Byte - Accept bad check
byte, yes/no
CR/LF - Select CR, LF, CR LF, or
none
DIP Switches (each bank contains
eight DIP switches)
Note: 0ff= 1 and 0n = 0
Bank 1 - CIF Address
1 LSB
2
3
4
5
6
7 MSB
8 Parity (see chart 1)
Chart 1:
Parity (Bank 1, bit 8) (Bank 2,
bit 8)
NONE 0 0
EVEN 0 1
ODD 1 0
MARK 1 1
Bank 2
1 0=STX/ETX message deliminiters
1={} message delimiters
2 0=XOR check byte
1=Check Sum check byte
3 1=Process commands with
incorrect checkbytes
4 1=CR received and transmitted
5 1=LF received and transmitted
6 Baud (see chart 2)
7 Baud (see chart 2)
8 Parity (see chart 1)
Chart 2:
BAUD (BIT 6) (BIT 7)
1200 0 0
2400 0 1
4800 1 0
9600 1 1
RS422/232 selection
S3 - Switch 1:
0N = Terminating Resistors
Engaged
0FF = Terminating Resistors
Disengaged
S3 - Switch 2:
0N = RS422/485
0FF = RS232
S3 - Switch 3:
0N = RS422/485
0FF = RS232
CIF Commands
Commands are sent from a computer
to the switch controller. Refer to the previous
section for the proper formats for commands. The
command types are:
Query Commands - These commands
return switch controller information. The returned
bytes are called status bytes.
Switch Controller Commands -
These commands cause the switch controller to take
some action.
Interface Commands - These
commands invoke special CIF features.
Since the switching controller
can control up to six amplifiers and twelve
switches, the command set can accommodate this
number. For systems using few amplifiers or
switches, the user will ignore the extra information
displayed in the Summary Status response and the
commands sent to non-existent amplifiers should be
answered with reject code ‘b'.
Query Commands
ASCII O - ID/Version Query
A string of bytes is returned
which can be used to identify the controller.
Query…..{A0}x
Response…..{A0SWITCH1:1REV00}K
where:
x' is the number of backup
amplifier(s)
y' is the number of non-backup
amplifiers.
zz' is a two digit CIF software
revision number
ASCII 1 - Switch Position Summary
Status 1 ( switches 1 to 12) A string of bytes is
returned to indicate waveguide switch position.
Response bytes should be:
Byte 1 (waveguide switch position
- bit set if w/g switch is in that position, if both
zero, indicates that switch is hung up): Bit
Definition 7(MSB) Parity
6 Complement of bit 5
5 W/G Switch #1 Position 1
4 W/G Switch # 1 Position 2
3 W/G Switch #2 Position 1
2 W/G Switch #2 Position 2
1 W/G Switch #3 Position 1
O(LSB) W/G Switch #3 Position 2
Byte 2 (waveguide switch position
- bit set if w/g switch is in that position, if both
zero, indicates that switch is hung up):
Bit Definition
7(MSB) Parity
6 Complement of bit 5
5 W/G Switch #4 Position 1
4 W/G Switch #4 Position 2
3 W/G Switch #5 Position 1
2 W/G Switch #5 Position 2
1 W/G Switch #6 Position 1
O(LSB) W/G Switch #6 Position 2
Byte 3 (waveguide switch position
- bit set if w/g switch is in that position, if both
zero, indicates that switch is hung up):
Bit Definition
7(MSB) Parity
6 Complement of bit 5
5 W/G Switch #7 Position 1
4 W/G Switch #7 Position 2
3 W/G Switch #8 Position 1
2 W/G Switch #8 Position 2
1 W/G Switch #9 Position 1
O(LSB) W/G Switch #9 Position 2
Byte 4 (waveguide switch position
- bit set if w/g switch is in that position, if both
zero, indicates that switch is stuck): Bit
Definition 7(MSB) Parity
6 Complement of bit 5
5 W/G Switch #10 Position I
4 W/G Switch # 10 Position 2
3 W/G Switch #11 Position 1
2 W/G Switch #11 Position 2
1 W/G Switch #12 Position 1
O(LSB) W/G Switch #12 Position 2
Byte 5 (Amplifier status - bit is
set to indicate Amplifier failure. Decision is based
upon Summary Fault relay, whichever is used to
indicate failure):
Bit Definition
7 (MSB) Parity
6 Complement of bit 5
5 HPA #1 Fail
4 HPA #2 Fail
3 HPA #3 Fail
2 HPA #4 Fail
1 HPA #5 Fail
0 (LSB) HPA #6 Fail
Byte 6 (switch controller
status):
Bit Definition
7(MSB) Parity
6 Complement of bit 5
5 Auto/Manual Status - bit is =1
for Auto;=0 for Manual
4 Control Mode MSB
3 Control Mode LSB
2 External Interlock Alarm
1 RELAY CONTACT FAULTS 1=ENABLED
0 SUPPLY CURRENT SENSE FAULTS
1=ENABLED
Control Mode: MSB LSB
Local 0 0
REMSTD 1 0
REM422 0 1
CIF 1 1
NOTE: For the UPL-2 bytes
7-10 will return zeroes.
Byte 7 and 8 - Channel Number.
This will give the channel number of the priority
amplifier. If the channel number is less than 9 the
leading byte will be ASCII Zero. If the switch
controller does not have Priority setting
capabilities or the switch controller does not have
channel changing capabilities, in both cases byte 7
and 8 will be ASCII Zero.
Byte 9 and 10 - Priority
Amplifier. This give the number of priority
amplifier. In case this number is
less than 9, the leading byte
will be ASCII Zero.
If the switch controller does not
have priority selecting capably, both the bytes will
be ASCII zero.
Switch Controller
Commands
ASCII A - Waveguide Switch Toggle
Command Each waveguide switch is assigned a number
01 through 12. This number identifies the switch in
the status report and is also used for the toggle
command. To toggle the waveguide switch, append the
waveguide switch number in the form NN to the
command A. Numbers less than 9 will have 0 as the
first N.
ASCII B - Auto Command Places
switch controller in Auto mode.
ASCII C - Manual Command Places
switch controller in Manual mode.