\documentstyle[11pt,a4]{article} \begin{document} \begin{titlepage} { \hoffset=1truein \hsize=5.25truein \vsize=10.25truein \font\small=cmssbx10 at 14.4truept \font\medium=cmssbx10 at 17.28truept \font\large=cmssbx10 at 20.74truept \hrule height 0pt \parindent=0pt %\parskip=0pt \hskip 3.9truein \large EDOC200\par \vskip .5truein \large EUROGAM PROJECT\par \vskip 1.5truein \hrule height 2pt \vskip 20pt \large NSF DATA ACQUISITION SYSTEM\par \vskip .5truein High Voltage server manual\par \vskip 20pt \hrule height 2pt \vskip 1truein \medium Edition 2.4\par \vskip 5pt January 1995\par \vfill \medium Nuclear Structure Software Support Group\par \vskip 5pt Liverpool University\par \vskip .5truein } \end{titlepage} \setlength{\parskip}{1ex} \setlength{\parindent}{0em} \section{Introduction} This document describes the software in the Eurogam High Voltage Server. It is assumed that the reader has some knowledge of the LeCroy 1440 High Voltage system and the 1445A controller. The High Voltage server is installed in the VME crate {\bf eghv} which it shares with the {\em Rate Monitor}. This document reflects {\bf version 2.4} of the VME server software. The first two chapters is a general users guide to the server, whilst the rest is technical documentation, meant to aid software development and maintenance. The {\bf Eurogam High Voltage system (phase 2)} contains the following main components: \begin{itemize} \item Four LeCroy 1440 mainframes with 1445A controllers. These provide high voltage to the GE and BGO detectors in the EUROGAM array. \item A VME crate (eghv) with MV147 CPU and a LeCroy 1131 VME-SIB card. The SIB card interfaces between the VME crate and the 1440 mainframes through the LeCroy SIB bus (parallel). \item A SUN workstation for display and control of voltages. This workstation is connected to the VME crate via ethernet and communicates with it by means of the Eurogam Register Server (ERS). \item A SUN file server. This is where the VME crate is booted from. The file server is also used for storage of demand voltages and configuration data. \end{itemize} The 1440 mainframes take their commands over the SIB parallel bus which connects them to the LeCroy VME1131 card in the VME crate via a 60 pin ribbon cable. The HV server in the VME crate is linked to the SUN workstation via ethernet and interpretes commands from these and translates them into the command format recognised by the 1445A controller. The HV server also monitors the LeCroy mainframes and report status changes to the Eurogam message logger. It also continuously displays status information on its console terminal. \section{MAINTENANCE} {\bf I M P O R T A N T :} {\bf NEVER power the VME crate off or on with the SIB bus connected !!!! } {\em Booting by command or by pushbutton is safe in Eurogam phase 2}. \subsection{LeCroy 1131 VME-SIB} Make sure that Rate Monitor card addresses do not clash with the address of the VME1131. In phase 2 the base address for the VME1131 is {\bf 0xf0e00000}. \subsection{SETTING UP FOR COMPUTER CONTROL via SIB BUS} \begin{itemize} \begin{enumerate} \item Connect the CONSOLE terminal to {\bf serial port 1} of the VME crate. \item Plug the ribbon cable into the SIB ports on mainframes 1, 2, 3 and 4 and into the front of the 1131 VME-SIB card. \item Make sure that ONE AND ONLY ONLY {\bf terminated} 1445A is connected to the SIB bus. The termination should be at the end of the chain. \item Boot the VME crate by pushing the MANUAL SYSTEM RESET button. \end{enumerate} \end{itemize} \subsection{REVERTING TO SERIAL OPERATION} \begin{itemize} \begin{enumerate} \item Halt the High Voltage server by typing HALT at the console \item Unplug the ribbon cable at the VME end, leave it connected at the mainframes. \item Connect the console terminal to the serial port of the mainframe you want to investigate. \end{enumerate} \end{itemize} \subsection{TAKING A MAINFRAME DOWN (from HV console)} \begin{itemize} \begin{enumerate} \item Type MAINFRAME 1 (2,3 or 4) at the HV console \item Give command BACKUP; stores demands in battery backed up RAM \item Give command WRITE (0-15,0-15) 0 ; this ramps the voltages down. \item Wait until all voltages have ramped down \item Give the command OFF; this disables High Voltage generation \item Type Q to return to HV console menue. \item Halt the server by typing HALT at the console \item Switch mains power off \item ....... \item Switch mains power ON again \item Start the High Voltage server by typing RESTART at the console \item Type MAINFRAME 1 (2,3 or 4) \item Give command: COPY; restores demands from battery backup up RAM \item Give command: ON; enables the High Voltage generation \item Check that the voltages ramp up \item Type Q to return to HV console menue. \end{enumerate} \end{itemize} If the communication between the HV server and the LeCroy mainframes breaks down, the server will halt immediately and the console will display the cause of the error. For instance, if you unplug the SIB ribbon cable without typing halt first this will happen. \subsection{CONSOLE COMMANDS} The console interface has a display part which at any time shows the state of the HV server and each of the mainframes. It also displays any errors which may occur. You can investigate further using the following commands: \subsubsection{BLANK} Initialises the display. \subsubsection{DEBUG} This commands enables debug output to the console. The type of output is determined by the parameters given. \begin{itemize} \item 0 - turn off debug output \item 1 - list responses from mainframes \item 2 - list commands sent to mainframes \end{itemize} Executing other commands automatically sets DEBUG to zero. \subsubsection{MAINFRAME} This commands take mainframe address as argument. It allows the user to access each individual mainframe in the manner which it is done from the 1445A serial interface. However three of the 1445A commands are not available: WHO, MAINFRAME and MONITOR. The HV server automatically halts when the MAINFRAME command is given. You can change mainframe by typing CTRL F. This will connect you to the next mainframe in the chain. See the 1445A users manual for a full guide to the commands here. WARNING: due to an error in the 1445As, long output sequences get messed up. Be ware of this when giving commands like READ (0-15,0-15). Another 1445A error causes every 256 character sent to it to be corrupted, so from time to time you will get "UNRECOGNISED COMMMAND" even when you have typed it in correctly. These faults will hopefully be corrected by LeCroy in the next 1445A firmware version. You return to the main menu by typing {\bf Q}. This also restarts the High Voltage server. \subsection{MONITOR} Monitor all the voltages in a mainframe. The command takes a mainframe number as argument. The voltages are updated every second. They are displayed slot by slot from left to right. You stop by typing any character. Note that this is NOT the same as the MONITOR command used on the serial line. The command is not available when the server is halted. \subsubsection{HALT} Halt the HV server. All communication with the LeCroy mainframes will cease. This command is intended to be used when you for some reason have to power off the mainframes. It should also be used if you intend to connect the mainframes to a terminal via the serial ports. Note that the server halts automatically whenever a communication problem on the SIB bus occurs. \subsubsection{RESTART} Resumes communication on the SIB bus after the server has been halted. If mainframes have been added or removed since the last boot, the system will reboot automatically. \subsection{REBOOT} Reboots the VME crate. When doing this you also reboot the Rate Monitor so you should take care to chack that nobody is using the Rate Monitor. {\bf This does NOT affect the High Voltage supply itself}. \subsubsection{ERROR} Lists a summary of errors in the HV server. These are most likely to be DMA errors in the case of lost communication with the mainframes. You will observe this if you switch a mainframe off without halting the server first. Under normal circumstances the reply should be {\bf none}. \subsubsection{HELP} Prints a brief summary of the commands. \subsubsection{SHELL} Escapes to the VxWorks shell. You return to the console menu by typing {\bf Res}. \subsubsection{SHOW} SHOW takes MAINFRAME address and parameters type as arguments. Currently only two parameter are available. Examples: \begin{verbatim} SHOW 1 VOLTAGES - list all voltages in mainframe 1 SHOW 4 USE - shows which detectors are connected to which channel in mainframe 4. \end{verbatim} \subsubsection{STATS} Print the following information on a mainframe: \begin{itemize} \item no. of channels USED (0 if wire list has not been generated) \item no. of channels ON (voltage within tolerance and demand non-zero) \item no. of channels OFF (less than 100 volts, and no demand) \item no. of channels RAMPING \item no. of channels with voltage out of range (default tolerance +-20 volts) \item no. of channels with demands differing from zero \end{itemize} NB! The USED field will show zero if no wire list has been generated. \section{Server startup} The High Voltage server is initialised by the VxWorks startup script {\em startup.cmd}. Here the necessary object files are loaded and server is started by calling {\bf hvStart}. The following files must be loaded before the High Voltage Server can be started: \begin{verbatim} "message.o" "register-server.o" "vxShare.o" "hvShare.o" "hvSib.o" "hvComm.o" "hvMain.o" "hvRegs.o" "hvConsole.o" \end{verbatim} The server is invoked as follows: \begin{verbatim} hvStart(configfile,VME1131 address) \end{verbatim} \begin{itemize} \item Configname is the file where the wire list for the High Voltage system resides. \item The VME address is set to 0xf0e00000 by default. \end{itemize} When the server starts, it first checks that the register server is running. Then it will initialise the HV server, check for presence of a VME1131 card and 1445A mainframes, read the current state of these to ensure that the VME and 1445A states are consistent, and then enter the main loop. Simultaneously the "CONSOLE" task is started. This controls input and output to the console (serial port 1), and incorporates some commands for monitoring and debugging. The console will ALWAYS display status for the server and each of the connected mainframes. The server main loop carries out the following: \begin{itemize} \item Checks the status of all the mainframes. \item Reads HV measurements into local memory (DMA) \item Checks if any values have been changed by register server, and writes the changes through to the 1440 mainframes. \item Checks if voltages are within limits. \item Sends messages to the Eurogam message logger when appropriate \end{itemize} Each mainframe is assigned a task to take care of the SIB communication. Another task, {\bf hvSuper} checks the others tasks for unexpected deletions and suspensions (bus errors etc). \newpage \section{SOFTWARE MAINTENANCE} The code resides in the directory {\em /eg/highVoltage/src} on the machine {\bf nsa} at Liverpool. Copies of the code can be found at Daresbury ({\em nnsa} and Strasbourg ({\em orchidee}. The system is generated by typing {\em make} in /eg/highVoltage/src. First the environment must be set by sourcing the file {\em make\_env}. The code is found in subdirectories as follows: \begin{itemize} \item vxshare - General purpose code (shared) \item vxlib - General purpose code (not shared) \item share - Shared HV server code \item regs - Registers for the EG register server \item console - Console user task \item main - Interface between the register server and the 1445A commands Supervision and control. \item comm - 1445A command level code \item sib - SIB bus level code \end{itemize} If need to make individual directories, you type makeit as on the top level. The object files are: \begin{verbatim} hvComm.o hvMain.o hvRegs.o hvSib.o hvConsole.o hvShare.o vxShare.o \end{verbatim} \section{EUROGAM REGISTERS} The register names and attributes are automatically set up during initialisation of the HV server. The SIB bus is scanned for presence of LeCroy High Voltage modules and the appropriate registers are defined for each individual mainframe, card and HV channel in the system. The wirelist is a number of aliases which binds an array position to a specific channel in the HV system. The REGISTERS are grouped according to four functional levels in the HV server. They are as follows: \begin{itemize} \item Server level (classes: sysSwrev, sysState, sysPrmap, control, wire) \item Mainframe level (classes: mfControl, mfCurlim, mfModmap, mfState, mfStats) \item 1444 Card level (class: gecardValue) \item 1443/1444 Channel level (classes: gechanValue, bgchanValue) \end{itemize} Here are some {\em attributes} which are commonly used for the High Voltage Server registers: \begin{itemize} \item mainframe address 0 .. 15 \item slot number 0 .. 15 \item channel number 0 .. 15 (1443P) \item channel number 0 .. 7 (1444N) \item register subclass eg. "ramp", "voltage" \end{itemize} \subsection{HV server references} These register have no attributes. \subsubsection{System state} \begin{itemize} \begin{description} \item[Class] sysState \item[Access] Read only \item[Data] "uninitialised","running", "initialising", "halted", "down", "configuring", "no\_vme1131" \item [Description] The value is one of the above, describing the state of the High Voltage Server software. Note that these values are mutually exclusive. If the state differs from {\bf running}, the contents of the registers below server level will reflect the situation at the moment the system state changed from {\em running}. level are unavailable. \end{description} \end{itemize} Example: \begin{verbatim} ersread hv.state hv.state : running \end{verbatim} \subsubsection{Mainframe presence map} \begin{itemize} \begin{description} \item[Class] sysPrmap \item [Data] a list of the mainframe addresses present. \end{description} \end{itemize} Example: \begin{verbatim} ersread hv.prmap hv.prmap : 1 2 3 4 \end{verbatim} \subsubsection{Software revision status} \begin{itemize} \begin{description} \item[Class] sysSwrev \item[Access] Read only \item [Data] Revision number of the High Voltage server \end{description} \end{itemize} Example: \begin{verbatim} ersread hv.swrev hv.swrev : Revision 2.4 - Dec 15 1994 \end{verbatim} \subsubsection{Error information} \begin{itemize} \begin{description} \item[Class] sysError \item[Access] Read write \item [Data] String indicating the latest error in the server. \end{description} \end{itemize} Example: \begin{verbatim} ersread hv.error hv.error : illegal demand voltage : (2,03,00): 4480 erswrite hv.error -a 0 Writing anything will clear the error. \end{verbatim} \subsubsection{1131 VME-SIB address} \begin{itemize} \begin{description} \item[Class] sysVmeadr \item[Access] Read only \item [Data] VME address of 1131 card \end{description} \end{itemize} Example: \begin{verbatim} ersread hv.vmead hv.vmead : 0xf0e00000 \end{verbatim} \subsubsection{Wire list status} \begin{itemize} \begin{description} \item[Class] wire \item[Access] Read only \item [Data] OK or ERROR \end{description} \end{itemize} Example: \begin{verbatim} ersread hv.wirel hv.wirel : OK \end{verbatim} \subsubsection{Crate control} \begin{itemize} \begin{description} \item[Class] control \item[Data] name of VxWorks function \item[Access] Read Write \item [Description] Executes a VxWorks function (no arguments). \end{description} \end{itemize} Example: \begin{verbatim} erswrite vx.control -a reboot written to vx.control \end{verbatim} \subsubsection{Application list} \begin{itemize} \begin{description} \item[Class] aplist \item[Data] string of application ids \item[Access] Read \item [Description] Read codes for aplications present in the crate \end{description} \end{itemize} Example: \begin{verbatim} ersread vx.aplist vx.aplist : rt hv \end{verbatim} \subsubsection{Available memory} \begin{itemize} \begin{description} \item[Class] aplist \item[Data] size of largest memory block (decimal) \item[Access] Read \end{description} \end{itemize} Example: \begin{verbatim} ersread vx.memsize vx.memsize : 1091008 \end{verbatim} \subsubsection{Reboot info} \begin{itemize} \begin{description} \item[Class] rbinfo \item[Data] Date and time of last reboot \item[Access] Read \end{description} \end{itemize} Example: \begin{verbatim} ersread vx.rbinfo vx.rbinfo : 03/01/95 16:46:23 \end{verbatim} \subsubsection{VxWorks version} \begin{itemize} \begin{description} \item[Class] version \item[Data] VxWorks version string \item[Access] Read \end{description} \end{itemize} Example: \begin{verbatim} ersread vx.version vx.version : 5.1 \end{verbatim} \subsection{MAINFRAME REFERENCES} All these registers have mainframe address as their attribute: Example: \begin{verbatim} ersrda "*(1)" control(1) : 1 curlim(1) : 1 fwrev(1) : 1 modmap(1) : 1 state(1) : 1 stats(1) : 1 \end{verbatim} \subsubsection{Mainframe control commands} \begin{itemize} \begin{description} \item[Class] mfControl \item[Access] Write only \item[Data] \begin{itemize} \item "backup" \item "copy" \item "on" \item "off" \item "set reboot cold" \item "set reboot warm" \item "set reboot hot" \item "clear" \end{itemize} \item [Description] These commands correspond directly to commands accepted by the 1445A controller. \end{description} \end{itemize} Example: \begin{verbatim} erswrite "control(1)" -a on written to "control(1)" erswrite "control(1)" -a set reboot warm written to "control(1)" \end{verbatim} \subsubsection{Mainframe state} \begin{itemize} \begin{description} \item[Class] mfState \item[Access] Read only \item[Data] \begin{itemize} \item "ramping" \item "on" (high voltage on) \item "off" (high voltage off) \item "reboot\_cold" (reboot parameter cold) \item "reboot\_warm" (reboot parameter warm) \item "reboot\_hot" (reboot parameter hot) \item "uncalibrated" \item "tripped" \item "disabled" (inhibit by HV enable button on mainframe) \item "sib\_fault" (communication fault) \item "error" (voltage out of range) \end{itemize} \item [Description] This is the status for a single mainframe. The values are not mutually exclusive. However, when a "sib\_fault" occurs real state of the mainframe is not known, so the other fields carry meaningless information. \end{description} \end{itemize} Example: \begin{verbatim} ersread "state(1)" state(1) : on reboot_warm \end{verbatim} \subsubsection{Current limit BGO} \begin{itemize} \begin{description} \item[Class] mfCurlim \item[Access] Read Write \item[Data] current limit in uAmpere (range 0 .. 2550). Unit uA (micro ampere) \item [Description] The current limit for all the 1443P-cards in the mainframe. \end{description} \end{itemize} Example: \begin{verbatim} ersread "curlim(1)" curlim(1) : 2550 \end{verbatim} \subsubsection{Firmware version number} \begin{itemize} \begin{description} \item[Class] mfFwrev \item[Access] Read only \item [Description] Returns the revision number of the firmware running in the 1445A controller. \end{description} \end{itemize} Example: \begin{verbatim} ersread "fwrev(1)" fwrev(1) : LeCroy 1445A Version 3.07 \end{verbatim} \subsubsection{Mainframe statistics} \begin{itemize} \begin{description} \item[Class] mfStats \item[Access] Read only \item [Description] Returns the number of channels that are \begin{itemize} \item BGOs Used (wired) \item BGOs On \item BGOs Off \item BGOs Ramping \item BGOs Out of range \item BGO Demands other than zero \item GEs Used (wired) \item GEs On \item GEs Off \item GEs Ramping \item GEs Out of range \end{itemize} the 1445A controller. \end{description} \end{itemize} Example: \begin{verbatim} ersread "stats(?)" stats(1) : {256 256 0 0 0 256 } {0 0 0 0 0 0 } stats(2) : {178 178 14 0 0 178 } {0 0 0 0 0 0 } stats(3) : {250 250 6 0 0 250 } {0 0 0 0 0 0 } stats(4) : {0 0 0 0 0 0 } {54 46 18 0 0 46 } \end{verbatim} \subsubsection{Module map} \begin{itemize} \begin{description} \item[Class] mfModmap \item[Access] Read only \item[Description] The card-types in each slot are listed from slot 0 to 16 with empty slots marked "-". \begin{itemize} \item "-" (empty) \item 1443P \item 1444N \end{itemize} \end{description} \end{itemize} Example: \begin{verbatim} ersread "modmap(4)" modmap(4) : - - 1444P 1444P 1444P - - - - 1444N 1444N 1444N 1444N 1444N - - \end{verbatim} \subsection{HV card references} These registers all have attributes {\em mainframe address}, {\em slot number} and {\em subclass}. Example: \begin{verbatim} ersrda "*(4,02)" curtrip(4,02) : 4 2 curtrip hwramp(4,02) : 4 2 hwramp \end{verbatim} Only one register class is defined at this level: \subsubsection{1444N card specific value} \begin{itemize} \begin{description} \item[Class] gecardValue \item[Access] see individual subclasses \item[Subclasses] \begin{itemize} \item "hwramp" hardware ramp (rw). Unit: raw decimal. \item "curtrip" current trip (rw). Unit: raw decimal. \end{itemize} \item [Description] Returns the value of a card-specific parameter. \end{description} \end{itemize} Example: \begin{verbatim} ersread "*(4,02)" curtrip(4,02) : 1023 hwramp(4,02) : 16383 \end{verbatim} \subsection{HV channel references} These registers have attributes {\em mainframe address}, {\em slot number}, {\em channel number} and {\em subclass}. Example (1443): \begin{verbatim} ersrda "*(1,02,00)" demand(1,02,00) : 1 2 0 demand name(1,02,00) : 1 2 0 name ramp(1,02,00) : 1 2 0 ramp state(1,02,00) : 1 2 0 state tol(1,02,00) : 1 2 0 tol vlimit(1,02,00) : 1 2 0 vlimit voltage(1,02,00) : 1 2 0 voltage \end{verbatim} Example (1444): \begin{verbatim} ersrda "*(4,11,00)" actrip(4,11,00) : 4 11 0 actrip demand(4,11,00) : 4 11 0 demand name(4,11,00) : 4 11 0 name ramp(4,11,00) : 4 11 0 ramp state(4,11,00) : 4 11 0 state tol(4,11,00) : 4 11 0 tol vlimit(4,11,00) : 4 11 0 vlimit voltage(4,11,00) : 4 11 0 voltage \end{verbatim} \subsubsection{HV channel value} \begin{itemize} \begin{description} \item[Class] gechanValue or bgchanValue \item[Access] see subclasses \item[Subclasses] \begin{itemize} \item "demand", (rw), volts \item "ramp", (rw), volts/second \item "vlimit", (rw), volts \item "ac\_trip", (rw), raw decimal, 1444 only \item "tol", (rw), volts \item "voltage", (r), volts \item "state", (r), text message: on,off,ramping, error \item "name", (r), text message: occupation info \end{itemize} \item [Description] Reads and writes values of channel specific parameters. Note that two adjacent channels share the ACTRIP value (eg. ch 0 and 1). \end{description} \end{itemize} Examples: \begin{verbatim} ersread "*(4,11,00)" actrip(4,11,00) : 16383 demand(4,11,00) : 0 name(4,11,00) : ge17 ramp(4,11,00) : 10 state(4,11,00) : off tol(4,11,00) : 30 vlimit(4,11,00) : 4500 voltage(4,11,00) : -9 \end{verbatim} \newpage \section{APPENDIX} \begin{verbatim} # ====================================================== # Startup for Eurogam High Voltage & Rate Monitor # ====================================================== < /eg/boot/startup.cmd # _hvDebug= 2; _rmDebug= 0; objpath= "/eg/obj"; workpath= "/eg/highVoltage/work"; cd (objpath); ld (0,0,"message.o"); ld (0,0,"register-server.o"); ld (0,0,"vxShare.o"); # setServer(server); setRloginHost(server); setRshellHost(server); setObjPath(objpath); rdate(); # ld (0,0,"hvShare.o"); ld (0,0,"hvSib.o"); ld (0,0,"hvComm.o"); ld (0,0,"hvMain.o"); ld (0,0,"hvRegs.o"); ld (0,0,"hvConsole.o"); ld (0,0,"rateMonitor.o"); # cd (workpath); ersStart(); rtStart ("/eg/config/eghv/rtconfig.d"); hvStart ("/eg/config/eghv/hvconfig.d",0xf0e00000); \end{verbatim} \newpage \font\medium=cmssbx10 at 17.28truept \font\large=cmssbx10 at 20.74truept \large \vskip 1.5truein Jomar H{\o}nsi \vskip 0.5truein Liverpool, 10th of January 1995 \vskip 2.5truein E-mail: jh@ns.ph.liv.ac.uk \vskip 0.5truein Telephone: int + 51 794 3398 \end{document}