Title: High Voltage Control and Monitor file: $ESALIB/doc/hv/hv.txt author: zms date: created 1/21/2001, updated 6/13/2003 0. Overview -------- This note describes a X-windows based program for controlling and monitoring the detector high voltage system. The program gets initialized from a set of setup files. After initialization is complete, the program connects to io server (ioserv) and network server (netserv) programs. The ioserv program controls camac hardware and is needed by the HV program to perform operations on the HV system power supplies. The netserv program allows the HV program to communicate with the rest of the ESA DAQ. On line help is available and is obtained by clicking on push buttons labeled "Help" located in various windows of the HV program. The HV program can be started in the esaexp account from the esa/hv/linux subdirectory. All setup files needed by the program are located in both the esaexp/esa/hv and $ESALIB/hvp/dat directories. 1. Setup Files ----------- The following files are used: - setup.dat contains parameters which configure the program, such as host name of the ioserv program, tcpip port number, and a handful of other such parameters. - hv.dat this file is used to define the hv system. Interface, chassis, and channel setup parameters are defined in this file. - help.dat contains the text for the on line help. - wind.dat contains definitions of all display windows. - disp.dat contains definitions of all displays. Out of these setup files, the user is likely to modify only the setup.dat and hv.dat. 1.1 setup.dat The following keywords can be used to tailor the initial configuration of the hv program; logfile=name is used to specify a log file name (hv.log is what I use), myname=name is used to specify the network name that the hv program will use to name itself to netserv program. This name is used by other netserv clients to seek a connection with the hv program with the idQuery protocol. The default value is HVC&M. host0=host is used to specify the ioserv host name, default is esau5.slac.stanford.edu. host1=host is used to specify the netserv host name, default is esacon1.slac.stanford.edu. port0=port is used to specify the ioserv port, default is 5005. port1=port is used to specify the netserv port, default is 5001. readHV when specified, enables periodic reads of defined channels status, when not specified, the periodic reads are disabled. This can also be controlled by toggling a button on the HVControls dialog. checkHV when specified, enables checking of defined channels status, after each read; when not specified, the periodic checks are disabled. This can also be controlled by toggling a button on the HVControls dialog. The periodic checks consist of checking the status bits as well as whether the read voltage is within tolerance. errorOn when specified, enables error reporting and logging to both the logger window and the log file, when not specified, the error reporting is disabled. This can also be controlled by toggling a button on the HVControls dialog. sendErr when specified, enables error sending to the DAQControl program, when not specified, the error sending is disabled. This can also be controlled by toggling a button on the HVControls dialog. Note that is the logfile=name keyword is required, all other are optional and if not specified a default value for the associated parameter is used. 1.2 hv.dat The hv.dat setup file is used to configure the HV control program. The setup data is organized as a list of modules, within which specifications for chassis are nested. Channel specifications are nested within the module specification. The module is a software object which corresponds to a controller module (or interface), which may reside in a CAMAC crate. Chassis is a software object which corresponds to a particular HV chassis, which is controlled by the module, and which owns a number of HV channels. The structure of the data file is: module="name id interface addr device addr"; name is the resource name (no embedded white space), id is an integer identifier, interface is a resource name for the computer interface to the io system (presently gpib is the only choice), addr is the bus address of the interface, device is the resource name of the device connected to the interface (most likely it is ks3988), and addr is the device address in the interface. chassis="name id type alarm useit"; name is the chassis resource name ( no embedded white space), id is a numeric identifier, type is a numeric value defined as hvtype_e in hvdefs.h, alarm is a hex number used to set Alarm Status for the chassis, and useit is boolean when true chassis operations will permitted. It is important to note that the id value specified must match the identifier for the chassis which was setup via its front panel. chan="ch ch_name V0 I0 V1 I1 vmax rpup rpdn trip tolw tolf flags on"; defines a channel, ch is channel number, ch_name is channel name (no embedded white space), V0 is volts set point in units of tenth of a volt, I0 is current limit in units of microAmps, V1 and I1 are alternate set points as V0 and I0, vmax is a programmable maximum high voltage per channel in volts, rpup is up ramping speed in volts/sec, rpdn is down ramping speed in volts/sec, trip is time in tenth of a second for which over-current is allowed (1000 for constant current), tolw is warning tolerance in 0.1 volt, tolf is fatal tolerance in 0.1 volt, flags is hex value which is used to set Flags for the channel, and on is either 0 or 1 to either not allow or allow the channel hv to be turned on. chan=" .... "; .... endchassis; chassis="..."; another chassis .... endchassis; .... endmodule; 1.3 hardware Presently we are setup to control and monitor the hv system via camac interfaces. The hv system consists of a small number of CAEN-SY403 64 channel chassis interfaced to the camac system with CAEN C117B module. The camac system is interfaced through a Kinetic Systems CAMAC crate controller, KS3988, to a National Instruments gpib card in a PCI bus slot in a Linux PC computer, node name esagpib. 2. Running the Program ------------------- The binary file path is $ESALIB/hvp/$VER/bin/$ARCH/hv, where $ESALIB=/afs/slac.stanford.edu/g/esa/esalib, $VER is either new or dev, and $ARCH is either linux or sunos. A soft link exists in the esaexp account: ~esaexp/esa/hv/hv, hence the following steps are needed to launch the hv program: 1. log in to esaexp account on any ESA linux computers (esaanal1 - esaanal7), 2. type the command runhv Note that the runhv command is an alias which does two things: 1. cd ~esaexp/esa/hv/linux 2. nohup ./hv& It is important to make sure that the hv program was not launched from this directory and is still running. Although the hv program can be launched multiple times from the same directory, this is not a good practice since some confusion is likely to prevail as to which invocation of the program owns which log file. Also, the communication with the rest of the ESA DAQ will probably be confused. Hence, if the hv program is already running, it needs to be stopped first before launching it again. When the program is launched, the following initialization steps are performed: - data is read from the hv.dat file and a data base is constructed, which is a number of lists of objects like HVModule, HVChassis, and HVChannel. These lists represent the state of the hv system. - a connection with the ioserv program is attempted. When the connection is established, a list of defined io operations is obtained from ioserv. Items from this list are used in subsequent requests to the ioserv program to perform some specific task. - request reading setup parameters from all defined channels. - request reading general status from all defined chassis. - request reading hv board characteristics from all defined chassis. - from now on, continue processing scheduled tasks. When reading of channel status is enabled, it periodically schedules reading status of all defined channels. Other tasks can be scheduled by user interaction with the hv program. Note, that the hv program does not automatically reprogram set points for all defined channels when started up. The only way to have that take place is by user interaction. 3. Main Display Window ------------------- When the hv program is launched a main display window is painted on the screen. It consists of four, vertically stacked areas. Top to bottom these are: 3.1 menu bar The following menu buttons are used to pull down menus: - File has "Save As..." and Quit entries. "Save As..." allows saving the hv system setup data base in a file. This is useful if some parameter[s] are changed interactively. - Setup has "read IOs", "get IOs", "read HVdb", and "Change Font" entries. "read IOs" requests that ioserv program reinitializes its io data base from its setup files, "get IOs" requests that ioserv program send a list of io operations, and "read HVdb" reads hv system setup data from a data file. - View allows viewing the object class hierarchy. - Control has "HV", "IOs", "Reset", "Debug", "IODebug", and "LogData" entries. "HV", "IOs", "Debug", "IODebug", and "LogData" commands pop-up dialog windows from which one can control various aspects of the hv program. Detailed help is available in most of them. "Reset" probably does nothing at this point, and "LogData" allows controlling the logging to tape of the non-event HV data. The HV commands allows detailed controlling of the hv system. - Help presents help listed by topic. 3.2 status display The status display here summarizes the state of all network connections. The status of links with the ioserv and netserv programs is shown. This display also shows whether connections were successfully established with the DAQCntrl and the Local Data Server (lDatServ) program via the idQuery protocol. Note that the connection with lDatServ is needed for logging hv data to tape. 3.3 message logger Here messages are displayed in a scrolled window. The same messages are also written to a log file, which was specified in the setup.dat file. 3.4 control buttons Two control buttons are defined: "Displays" and "Timeout". - Displays button pulls down a menu of all defined displays. Each display has a window in which it is painted, and most of the defined displays have at this time detailed help available from the display window. - Timeout button pops up a dialog which is used to control the timeout period and its state. This timeout determines the rate with which the io requests are processed.