The MIL.py GUI Interface

# Introduction

The **MIL.py** program is a diagnostic Graphical User Interface (GUI)
for manipulating 1553 devices (Remote Terminals or RT's). Users are
expected to be familiar with the basic principles of operation for the
MIL/STD1553B bus. The terms used in this document presume this
familiarity.

The program communicates with a generic 1553 record in the EPICS Channel
Access Server that resides on one of the DØ front-end computer nodes.
The EPICS generic 1553 record has several read/write fields that control
its actions.

The program is written in the Python scripting language and may be
executed on any computer that has a Python interpreter with the EPICS
Channel Access (CA) extension. Currently, the CA extension is supported
on most UNIX-style systems, Linux, and Windows and Windows NT.

The user display window is organized vertically into five frames:

-   The menu frame

-   The control frame

-   The put data frame

-   The get data frame

-   The control button frame

# Menu Frame

## Scan Rate Menu

The scan rate of the 1553 device is set from the **Scan** menu. It
determines the rate at which EPICS executes the selected action (**T**
or **R**) for the 1553 device. This also sets the rate at which the
display is updated. There is a choice of update rates ranging from 10Hz.
to 0.1 Hz. A **Passive** rate means that the device is only executed in
response to the **Get** and **Put** buttons. When a **Passive** rate is
selected, the user's display is updated at a 1 Hz. rate. Normally, for
the **Put** or **R** mode, the scan rate should be set to **Passive**.

## Units Menu

The display units can be set from the **Units** menu. The choices are
**Dec** (decimal) or **Hex** (hexadecimal).

## Quit

Selecting this button terminates the program.

# Control Frame

The control frame contains fields that:

-   Specify the parameters for the next 1553-bus transaction

-   Display the state of the last transaction.

## Channel

This field selects the 1553 channel or bus index. The channel indexes
start at 0. Each 1553-bus controller has two, independent 1553 channels.

## RT Address

This field selects the remote terminal (RT) address. The RT address may
range from 0 to 30. An address of 31 selects all of the RT devices on
the bus (broadcast mode).

## Subaddress/Mode

This field selects the subaddress/mode register within the remote
terminal device. A subaddress value of 0 or 31 designates mode control
in which the **Word Count/Mode Control** field is interpreted as a mode
code and the data put frame has a single data word. Subaddress values of
1 through 30 designate normal data transmission.

## Word Count/Mode Code

For a subaddress value in the range from 1 to 30, this field designates
the number of data words to be read or written. A value of 0 indicates
an actual word count of 32. For a subaddress value of 0 or 31, this
field designates the mode code.

## T/R

This field selects the direction of data transmission. A value of **T**
indicates that the remote terminal should transmit (a read or get
operation) and a value of **R** indicates that the remote terminal
should receive (a write or put operation). Clicking the **Get** or
**Put** buttons automatically sets this field in addition to performing
the selected action.

## Status

The status field displays the status code from the last operation. The
status code is bit encoded and the display units are hexadecimal. A zero
status code indicates success and the display field has a light green
background. A non-zero status code indicates an error or abnormal
condition and the display field has a light red background.

# Put Data Frame

The put data frame displays the data values that will be sent by the
next put **(R)** operation. The **Subaddress** and **Word Count** fields
determine the number of data values displayed. For mode control
subaddresses (0 and 31), a single data word is displayed. For normal
data subaddresses (1 through 30), the **Word Count** field sets the
number of data words displayed.

The user may edit any of the data words in the put data frame by
selecting the word with the left mouse button. Once a word has been
selected, the standard keyboard editing conventions apply.

# Get Data Frame

The get data frame displays the data values that were received from the
last get (**T)** operation. The **Subaddress** and **Word Count** fields
determine the number of data values displayed. For mode control
subaddresses (0 and 31), no data words are displayed. For normal data
subaddresses (1 through 30), the **Word Count** field sets the number of
data words displayed.

# Control Button Frame

There are two command buttons at the bottom of the window: **GET** and
**PUT**

## PUT

Clicking the **PUT** button causes the data words in the put data frame
to be written to the device. The number of words written is determined
by the **Count** field. Clicking this button sets the **T/R** field in
the Control Frame to **R.**

## GET

Clicking on the **GET** button causes data words from the device to be
read into the get data frame. The number of words read is determined by
the **Count** field. Clicking this button sets the **T/R** field in the
Control Frame to **T.**

# Running the Program

At the present time, the program may be run from the online cluster
(nodes d0ola and d0olb), the Linux-build nodes (d0lxbld1 through
d0lxbld4), or any workstation on which the D0 Python system has been
installed.

For the online cluster servers or Linux-build servers, a terminal or
workstation with X-Windows support is required to display the GUI
frame[^1]. Once the **telnet** or **Xstart** connection with the host
computer has been established, the GUI may be initiated by entering the
following shell commands:

> **setup d0python**

**MIL.py \<node-name\> \[\<port\>\]**

where **\<node-name\>** is the network name of the node which services
the MIL/STD1553B bus. The optional parameter **\<port\>** selects one of
four available diagnostic ports that are designated A through D. If the
port parameter is missing, port A is selected.

For example, to access port B on node d0olctl04, the second command line
would be:

**MIL.py d0olctl04 B**

[^1]: ^?^For Windows or Windows NT systems, remember to start the Exceed
    program that provides an X-Window server for the local display.