# SICS programs, Scripts and Prerequisites

#

## Hardware

The following hardware is usually present for any SICs instrument:

- An instrument computer
- A Lantronix terminal server with 8-16 serial ports for connecting:
- Motor controllers
- Counter boxes
- Temperature controllers.
- Optionally 1-n histogram memory computers are present.

The terminal server software is provided by Lantronix, see the appropriate manuals for the device for a description. The histogram memories are 6800 VME onboard computers running the VXworks realtime operating system and some home grown histogramming software documented elsewhere.

## Server programs

On the instrument computer the following software must run:

SerPortServer
  This is a TCP/IP server which implements a special protocoll for communicating with serial ports. The actual communication with the serial ports is done through the Lantronix terminal server. Both the serial port protocoll and the SerPortServer are only documented in the source code.
TecsServer
  This is a TCP/IP server which watches over temperature controllers. The only knwon source of documentation about this software is Markus Zolliker.
FileSync
  This is a little UDP server which waits for UDP messages from the instrument control program. Then the server starts a script which synchronizes the local data directory with the central data storage on the labarotory server. FileSync is configured through an initilaization file usually called fs.ini. See the comments therein for more information.
SICServer
  This is the actual instrument control server. The configuration of this program is documented in this manual.

Additionally a client program is needed which connects to the instrument control server and provides a user interface to it.

## Scripts

To get all this software up and running a couple of shell scripts have been provided:

startsics
  This script starts all the necessary server programs for driving the instrument.
killsics
  This script shuts down all instrument control servers properly.
keepalice, keepaliveserp
  The server programs are automatically restarted when they die. This is done through these scripts. keepaliveserp is a special script for the serial port server.
instsync
  replace inst by the name of the instrument in lower case. This script is invoked by the FileSync server and is responsible for synchronizing the local data store with the one on the labaratory server. This is usally done by calling the unix program rsync with appropriate parameters.

# General SICS Setup

SICS is a client server system. This implies that there is a server program which implements all the functionlity and client programs which implement the user interface. The client program is the only thing the user is intended to see. This also means that the location of the client programs is quite independent from the computer where the server runs. In the following the layout of a server installation is described as established at SINQ.

For each instrument there is a data aquisition computer. On this computer there exists a user name and consequently a home directory for the instrument. In the following text this instrument root directory will be called sicsroot. This root directory has the following subdirectories:

bin
  The bin directory is the place where the actual executable for the SICS server is kept along with local copies of all necessary clients, the server initialisation files and special macro files defined for the instrument.
data
  The data directory is the central place where all data files collected at the instrument are stored. This directory contains subdirectories for each year. These directories hold the data collected at the instrument in this year plus a file named DataNumber which keeps the current serial number of the data files. This file should never be edited. At the start of each year the instruement manager must create a new directory with an empty DataNumber file. Additionally the path variables both for the data file directory and the DataNumber file have to be set to the new directory in the instrument initialization file.
log
  The log directory contains the server log files and the automatically generated client log files. Any now and then, and especially when disk space problems loom, the client*.log files should be deleted by the instrument manager.
doc
  This directory holds a copy of the SICS user documentation for the instrument. These are html files which can be viewed with WWW-browsers such as lynx or netscape.
sim
  The sim directory is meant to hold all files necessary for a SICServer initialised for the instrument but configured with simulated hardware. This facility is meant for testing of command files.
motor
  This directory holds a script for reading and restoring the motor parameter from the EL734 motor controllers. And the motor parameters stored in parameter files. It is the instrument scientists responsability to save the motor parameters after changes to the configuration of the instrument.

Besides these directories there should be nothing on the instrument account. All evaluated data, personal command files etc. should be held on the normal user account of the instrument user.

For this purpose the /data/lnslib/bin directory holds copies of the apropriate command line and status display clients for each instrument. A user can make this directory (and much more) available by including the line source /data/lnslib/bin/lns.login into her .login file.

## SICS Installation

All executables and files necessary to run SICS for each instrument is avaialable under the /data/lnslib/distribution/sics hierarchy. The bin directory holds general executable files and a directory for each instrument which holds instrument specific files. SICS installation on a unix system is greatly simplified by using the sicsinstall korn shell script. This script is available to each user. sicsinstall can be invoked simply by typing sicsinstall at the command prompt. sicsinstall needs a subcommand in order to know what it is expected to do:

dev
  copies knew executables from the development area to the distribution directory. This command is meant to be used by computing staff only.
devfull
  as dev, but copies all files. This command is meant to be used by computing staff only.
dmc
  copies all files necessary for the instrument DMC.
topsi
  copies all files necessary for the instrument TOPSI.
sans
  copies all files necessary for the instrument SANS.
hrpt
  copies all files necessary for the instrument HRPT.
amor
  copies all files necessary for the instrument AMOR
focus
  copies all files necessary for the instrument FOCUS
tasp
  copies all files necessary for the instrument TASP
druechal
  copies all files necessary for the instrument DRUECHAL
trics
  copies all files necessary for the instrument TRICS
save inst
  copies all the instrument configuration files from the instrument account back to to the distribution area. Replace inst with the name of the instrument in lower case. This call is necessary to save modified instrument configurations.
doc
  updates only the documentation on your disk.
exe
  copies only new executable files from the distribution area. This is the recommended option when you want to be sure, that you have the latest version of SICS before reporting a bug.

Most of these options require you to be in the home directory of the instrument account. sicsinstall checks for this and warns you if this is not the case. Directory structures are checked for and created as needed.