|
Cif Protocol
Computer interface
C&M Systems, Inc.
Waveguide Switching System
Serial Protocol and Commands
CIF0397.DOC
CIFDNL5.a51
This document covers control
standards for C&M 1:N waveguide
switching systems. This document is
specific to the DNL-5 downlink
switch 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.
(Computer Port)
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 (GND)
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; typically, 20 ms for a ten-byte
message at 9600 bps. Commands
requiring long execution times, such
as changing the channel on a backup
amplifier, generate an immediate
response indicating if the command
was accepted and whether or not
execution has begun.
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)
(May or may not be applicable.)
The response byte(s) range from 32
to 95.
Reject Byte(s)
(If applicable)
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
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[(sum message
bytei) - (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 bytei is the ith message
byte where 1 i N.
Example: Calculate the check byte
for the message {A1 } using the
checksum rule.
Character: {A1} 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
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. All
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
Dip Switch Bank 1 ( 8 position)
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
Dip Switch Bank 2 ( 8 position)
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) see next page
for 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
Dip Switch Bank 3 ( 3 position)
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
Default Settings:
Address = “A”
BAUD = 9600
{} message delimiters
Check Sum check byte returned
No parity
RS485 mode
Ignore bad Checksum
No CR or LF returned
Termination resistor not engaged
Therefore, 7 bit words.
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 should 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.
Example: {A0}x command
Returns {A0SWITCH1:2REV00)l
(checksum is a small L)
SWITCHx:yREVzz
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 (switch position - bit set if
switch is in that position, if both
zero, indicates that the switch has
no position):
Bit Definition
7 (MSB) Parity
6 Complement of bit 5
5 Switch #1 Position 1
4 Switch # 1 Position 2
3 Switch #2 Position 1
2 Switch #2 Position 2
1 Switch #3 Position 1
O (LSB) Switch #3 Position 2
Byte 2 (switch position - bit set if
w/g switch is in that position, if
both zero, indicates that the switch
has no position):
Bit Definition
7 (MSB) Parity
6 Complement of bit 5
5 Switch #4 Position 1
4 Switch #4 Position 2
3 0
2 0
1 0
O (LSB) 0
Byte 3 (waveguide switch position -
bit set if w/g switch is in that
position, if both zero, indicates
that the switch has no position):
Bit Definition
7 (MSB) Parity
6 Complement of bit 5
5 0
4 0
3 0
2 0
1 0
O (LSB) 0
Byte 4 (waveguide switch position -
bit set if w/g switch is in that
position, if both zero, indicates
that the switch has no position):
Bit Definition
7 (MSB) Parity
6 Complement of bit 5
5 0I
4 0
3 0
2 0
1 0
O (LSB) 0
Byte 5 (Amplifier status - bit is
set to indicate failure.
Bit Definition
7 (MSB) Parity
6 Complement of bit 5
5 LNB #A Fail
4 LNB #B Fail
3 LNB #C Fail
2 0
1 0
0 (LSB) 0
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 Contact Fault Polarity N.O.=1,
N.C.=0
1 Process Contact fault inputs
1=ENABLED
0 Process Current Monitoring Faults
0=ENABLED
Control Mode: MSB LSB
Local 0 0
REMSTD 1 0
REM422 0 1
CIF 1 1
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 Letter of priority
amplifier. The leading byte will be
ASCII Zero. If the switch controller
does not have priority selecting
capably, both the bytes will be
ASCII zero.
Example:
Command {A1}x
Response (A1* @@HC000A}t
NOTE: that the 5th byte in the
string above is a “space”.
This string indicates that switches
1 thru 4 are in position 1.
There is a fault on LNA C.
Controller is in Remote computer
mode.
Controller is in Auto
Contact faults are Normally Closed
(“Open” causes fault)
Process contact fault inputs
Do not process current monitoring
faults
Amplifier A has Priority
ASCII 2 – LNB current query for LNB
A. A string of bytes is returned to
indicate the approximate current
being used by LNB A: Current is in
Amps.
Example:
Command {A2}x
Response (A20.19A}H
This string says that the current
being used by LNB A is 0.19
Amps…..or 190 mA.
ASCII 3 – LNB current query for LNB
B. A string of bytes is returned to
indicate the approximate current
being used by LNB B: Current is in
Amps.
Example:
Command {A3}x
Response (A30.31B}S
This string says that the current
being used by LNB B is 0.31
Amps…..or 310 mA.
ASCII 4 – LNB current query for LNB
C. A string of bytes is returned to
indicate the approximate current
being used by LNB C: Current is in
Amps.
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.
Example to toggle switch 1 and 2.
Command {AA01}x
Response (AA)\
Example to toggle switch 3 and 4.
Command {AA03}x
Response (AA)\
ASCII B - Auto Command Places switch
controller in Auto mode.
Example:
Command {AB}x
Response (AB}]
ASCII C - Manual Command Places
switch controller in Manual mode.
Example:
Command {AC}x
Response (AB}^
ASCII G – Set Priority Command.
Priority amplifier has the form NN.
The first N is always a zero.
The only valid characters for the
second N are “A” or “C”
Example to set priority on amplifier
A.
Command {AG0A}x
Response (AG)b
Example:
Command {AG0B}x
Response (AGa}D
(This last examplr shows a reject
code being returned, because
amplifier B is not a valid priority
amplifier.)
|