**STEREO/HET & STEREO/SIT**

> **Ground Support Equipment:**
>
> **User Guide for Build 1**
>
> **WinMac Version 1b**
>
> October 31, 2002
>
> *Prepared by:\
> * Kristin Wortman
>
> Computer Sciences Corporation

[Table of Contents]{.underline}

[**Background 3**](#background)

[Overview 3](#overview)

[References 3](#references)

[Modification to WinMac for HET Ground Support Equipment (Bld 1)
4](#modification-to-winmac-for-ground-support-equipment-build-1)

[Operating Environment 6](#operating-environment)

[TCP/IP Communications 7](#tcpip-communications)

[STEREO/HET TCP/IP Packet Format (In-House Testing)
9](#__RefHeading___Toc23839507)

[STEREO/HET Pulse Height Data Format
9](#stereohet-pulse-height-data-format)

[Retrieving Real Time HET Telemetry Packets
10](#retrieving-real-time-het-telemetry-packets)

[Establishing the TCP/IP Connection
12](#establishing-the-tcpip-connection)

[Telemetry Data Collection via TCP/IP
13](#telemetry-data-collection-via-tcpip)

[Displaying the Data Packets 14](#displaying-the-data-packets)

[Controlling the Display Rate 15](#controlling-the-display-rate)

[Plotting the Telemetry Data 16](#plotting-the-telemetry-data)

[Histogram Plotting Example 17](#histogram-plotting-example)

[Limitations of the Ground Support Equipment Feature
22](#limitations-of-the-ground-support-equipment-feature)

#  

# Background

An existing software program, referred to as WinMac, was originally
developed for the low energy cosmic ray group (LECR) for scientific
graphical analysis of instrument telemetry data. The original design
philosophy was based on the original Macro program (DOS command line
version), which was written by Dr. Donald Reames, NASA/GSFC.

# Overview

The WinMac software is written in the C++ programming language using
object-oriented methodologies and the Microsoft Foundation Class (MFC)
library. Using the MFC library enables point and click technology and a
Windows graphical user interface through a series of menus and dialogs.

WinMac reads instrument telemetry data files, which have been produced
following the guidelines used for the LECR data file format. The WinMac
software produces 2 and 3 dimensional plots, which are used for
interactive analysis efforts by the NASA scientists in the preparation
of research papers.

Additional features are being added to the WinMac software in support of
the HET and SIT instruments. This software will be delivered in several
builds. Build 1 for the Ground Support Equipment software will provide
support for the HET instrument to perform in-house testing activities.
Build 2 for the Ground Support Equipment software will provide support
for the HET and SIT instruments to perform in-house testing activities.
Build 3 for the Ground Support Equipment software will provide support
for both the HET and SIT instruments for real time flight support.

# References

Serial Command Interface Programmer and User's Guide for Build 1 --
WinMac Ver. 1a

Serial Port Interface to TCP/IP (SPiT), Tom Nolan

PHA Test Software, Tom Nolan

LECR Data File Format, Don Reames (NASA/GSFC), Kristin Wortman (CSC)

<http://epact2.gsfc.nasa.gov/STEREO/docs.html>

# Modification to WinMac for Ground Support Equipment (Build 1)

In order to support the HET ground support equipment the following
additional features were added to the WinMac Software:

-   TCP/IP communications with the server-side software, referred to as
    Serial Port Interface to TCP/IP (SPiT).

-   Receive telemetry packets via TCP/IP.

-   Create binary telemetry data files in the LECR format.

-   Display telemetry packets in readable format according to bit
    addressing scheme.

The following diagram outlines the design of the ground support
equipment for capturing HET telemetry data packets over TCP/IP and
formatted the LECR file:

![](media/image1.png){width="5.995833333333334in"
height="7.550694444444445in"}

> **Ground Support Equipment: Telemetry Data Capture**
>
> **Data Flow Diagram**

The following communications protocol was established and is used in the
SPIT and WinMac software.

+----------------------+-----------------------+-----------------------+
| **Opcode**           | **Parameters**        | **Description**       |
+----------------------+-----------------------+-----------------------+
| OP_SES (1)           | SES_SNDCMD (0x10)     | Send commands         |
|                      |                       |                       |
|                      | SES_RCVCMD (0x20)     | Receive command       |
|                      |                       | response              |
|                      | SES_RCVTLM (0x40)     |                       |
|                      |                       | Receives telemetry    |
+----------------------+-----------------------+-----------------------+
| OP_CMD               | 0                     | Command for delivery  |
|                      |                       | to instrument         |
+----------------------+-----------------------+-----------------------+
| OP_RSP               | 0                     | Command response from |
|                      |                       | instrument            |
+----------------------+-----------------------+-----------------------+
| OP_TLM               | 0                     | Receive telemetry     |
|                      |                       | packet from           |
|                      |                       | instrument            |
+----------------------+-----------------------+-----------------------+

**Communications Protocol for SPIT and WinMac Software**

# Operating Environment

The ground support equipment option operates in real-time and non-real
time modes. The following shows the real-time software/hardware
environment, where GSE-1, GSE-2 and GSE-3 show how the WinMac software
can be used to communicate with the SpiT software, which in turn
communicates with the software executing on the 24-bit microprocessor
(MISC), which communicates directly with the PHA ASICS chip via a direct
serial link connection. This is the environment which is currently being
used for in-house testing activities.

![](media/image2.png){width="6.707638888888889in"
height="4.218055555555556in"}

# TCP/IP Communications

The WinMac ground support equipment, real time mode, uses the TCP/IP
protocol for communications with the SPiT software to send and receive
commands and data. The following software routines are used in the
WinMac and the SpiT software to accomplish this bi-directional
communication.

![](media/image3.png){width="6.197222222222222in"
height="2.957638888888889in"}

![](media/image4.png){width="6.238888888888889in"
height="4.027777777777778in"}

![](media/image5.png){width="6.249305555555556in"
height="1.2395833333333333in"}

[]{#__RefHeading___Toc23839507 .anchor}**STEREO/HET TCP/IP Packet Format
(In-House Testing)**

In order to perform in-house testing of the PHA ASICS chip, the
following STEREO/HET packet format was designed and is used as input,
over the TCP/IP protocol, to the WinMac software.

  ----------- ------------ -----------------------------------------------
  **Offset    **Size       **Contents**
  (bytes)**   (bytes)**    

  0           11           CCSDS Header

  11          1            Packet type (0xe9 event, 0xad rate)

  12          1            Sequence number (increments by 1)

  13          1            Number of 24-bit words (0-86)

  14          258          24-bit ph or rate words (lsb -- msb)
  ----------- ------------ -----------------------------------------------

# 

# STEREO/HET Pulse Height Data Format

The STEREO/HET pulse height data for in-house testing is received in a
compressed 24-bit format and is described in the structure below.

> struct COMP_PH
>
> {
>
> unsigned ph : 11; // bits 0-10
>
> unsigned overflow : 1; // bit 11
>
> unsigned reserved1 : 1; // bit 12
>
> unsigned reserved2 : 1; // bit 13
>
> unsigned lohigain : 1; // bit 14
>
> unsigned pha_addr : 4; // bits 15-18
>
> unsigned chip_addr : 4; // bits 19-2
>
> unsigned token : 1; // bit 23
>
> };

COMP_PH \*c;

WinMac receives the compressed STEREO/HET pulse height data in the
packets and in order to display the values, it is necessary to
uncompress the data according to the following structure.

struct UNCOMP_PH

{

unsigned short verse;

short byte_cnt;

unsigned short ph;

unsigned short overflow;

unsigned short reserved1;

unsigned short reserved2;

unsigned short lohigain;

unsigned short pha_addr;

unsigned short chip_addr;

unsigned short token;

};

UNCOMP_PH \*u;

# Retrieving Real Time HET Telemetry Packets

To retrieve HET real time telemetry packets, using the WinMac
application, simply click the WinMac icon located on the desktop and
select the **Communications \| HET GSE** option located on the main
menu. Refer to the following illustration:

![](media/image6.png){width="5.28125in" height="1.46875in"}

As a result, this dialog will be displayed. This dialog contains the
interface for the HET commanding, which is described in detail in the
Serial Command Interface User's Guide for Build 1. This document's focus
is on the telemetry data retrieval display and plotting features for the
ground instrument support.

![](media/image7.png){width="5.488194444444445in"
height="5.006944444444445in"}

# Establishing the TCP/IP Connection

WinMac automatically detects the first time the TCP/IP connection is
needed; this is done by the first selection of the **SEND** or **DATA**
button. At this time, the following dialog will be displayed to request
the IP address of the computer to connect to and its port number. In
addition, a LECR formatted header file also needs to be provided. This
header file describes the LECR data and is used for the display and
plotting routines.

![](media/image8.png){width="3.75in" height="2.9680555555555554in"}

The default IP address and port identification number are read in from
the ***WinSock.ini*** file, which is created and read each time you
invoke this dialog. If the file does not exist, a hard coded loop back
IP address and port number are used.

# 

# 

# 

# Telemetry Data Collection via TCP/IP 

The HET GSE commanding option contains the controls to start and stop
data collection of telemetry packets over the TCP/IP protocol. Telemetry
packets will be received from the SPiT software and written to a binary
data file that can be read for display and plotting by the WinMac
program at a later time.

To invoke data collection, the **DATA** button which is located on the
HET GSE commanding dialog is used.

![](media/image9.png){width="0.9895833333333334in" height="0.90625in"}

As a result of pressing the **DATA** button , the Windows standard
***SAVE AS*** dialog will be displayed and request you to enter a file
name to store the telemetry packets. The following is an example of what
you will see:

![](media/image10.png){width="4.427083333333333in"
height="2.8229166666666665in"}

Selecting the **DATA** button when telemetry data is already being
collected will stop data collection to the currently selected file. The
***SAVE AS*** dialog will be displayed to prompt you for a new file name
and then data collection will start again.

Termination of data collection can also be accomplished by selecting the
**DISCONNECT** button located on the GSE Commanding dialog.

# Displaying the Data Packets

The WinMac software is capable of displaying the telemetry data packets,
which have been previously collected using TCP/IP and written to a LECR
formatted file. Several selectable modes exist for displaying different
telemetry packets, to change a display mode, follow these steps:

-   Click the **MODE** button (optional). The following dialog will be
    displayed. Note: the **Display** option is the default mode.

![](media/image11.png){width="2.9791666666666665in"
height="1.9270833333333333in"}

-   Select the format for displaying the data (optional). The PHA format
    is the default mode, this format will display the PHA and hardware
    Rates. The available modes are:

    -   PHA -- the contents of each pulse height is displayed, plus the
        hardware rate verse, when available.

    -   HW Rates -- hardware rates

    -   SW Rates -- software rates

    -   Beacon -- beacon counts

    -   HK -- housekeeping

    -   ALL -- PHA, SW rates, Beacon

```{=html}
<!-- -->
```
-   Click on the client area of the WinMac program, this is the white
    space located to the left of the HET GSE commanding dialog.

-   Press **G** on the keyboard.

-   To stop displaying the data packets, hit the **ESC** button.

Here is an example of what you will see when this option has been
properly invoked:

> ![](media/image12.png){width="5.856944444444444in" height="3.45in"}

To the right top of the display, you will notice the number of events
and packets are displayed, along with the current status of the data
collection. There are three possible states in real time mode:
***Waiting, Running*** and ***Disconnected.***

# Controlling the Display Rate

Since the data packets are being read from a data file, the speed of the
computer can affect the rate at which the packets are displayed. In
order to simulate the real time, a higher speed CPU is needed. However,
it may be necessary to view the contents of the display at a much slower
rate. To change the display rate, you can enter a value in microseconds.
This is done using the following control located on the HET GSE
commanding dialog:

![](media/image13.png){width="1.0326388888888889in"
height="0.7034722222222223in"}

Simply click on the number in the box and change or edit the value.

# 

# Plotting the Telemetry Data

The WinMac software is capable of plotting the real time telemetry data
in a separate panel. The following steps show how to add another panel
to plot data from the telemetry packets, in addition to the display
panel:

![](media/image14.png){width="5.229166666666667in"
height="0.8229166666666666in"}

-   Click on the **Axis \| Setup** option available on the main menu
    located on the client window.

-   The following dialog will be displayed:

> ![](media/image15.png){width="6.495833333333334in"
> height="4.758333333333334in"}

-   To add a new panel, click on the next sequential panel number as
    follows:

> ![](media/image16.png){width="1.8645833333333333in"
> height="1.3541666666666667in"}

-   Next you need to setup the options for the plot.

# Histogram Plotting Example

The second panel is now ready to be setup for plotting, this example
will demonstrate how to setup a one dimensional histogram which plots a
pulse height verse and will also calculate and display the mean and
standard deviation.

![](media/image17.png){width="6.751388888888889in"
height="4.782638888888889in"}

-   Select the pulse height verse by clicking on the **PHA** check box.

-   Select the quantity to be used on the X axis. Refer to the following
    diagram for further instructions.

![](media/image18.png){width="6.626388888888889in"
height="5.945138888888889in"}

-   Now, select the histogram option, by first selecting the histogram
    verse and then dragging and dropping it on the Y axis.

> ![](media/image19.png){width="6.497222222222222in"
> height="5.407638888888889in"}

-   Next, select any other plotting parameters. Additional options are
    available by clicking the **OPTIONS** button located in the bottom
    right area, next to the current panel number.

-   By selecting **OPTIONS** the following dialog window will be
    displayed. On this dialog, select any additional plotting options
    for this panel.

> ![](media/image20.png){width="5.34375in" height="4.177083333333333in"}

-   At this point, you should click **OK** on the Panel and the Axis
    Selection dialogs and then you will see something similar to the
    following:

![](media/image21.png){width="5.520833333333333in"
height="6.489583333333333in"}

# 

# 

# Limitations of the Ground Support Equipment Feature

WinMac Version 1b, which contains the ground support equipment feature
for STEREO/HET, is capable of supporting only one GSE commanding
session, which is connected to one IP address and port for in-house
testing of the PHA ASICS chip. Since WinMac Version 1b is capable of
multiple panel displays, the first panel display is reserved for the HET
GSE commanding session, however additional displays can be created,
setup and used for plotting the telemetry data.

In order to keep the TCP/IP session active, the HET GSE commanding
dialog needs to remain active throughout the WinMac session. Termination
of this dialog will also terminate any active TCP/IP connection.

The CPU speed of the computer will affect the display rate of the data
packets. It is recommended that a minimum of a 1.0 GHz processor be used
running Windows 2000/XP operating system.