NOTE: This page is *always* under construction!

Jump to INDEX


FAQ about DAQ

This document contains answers to some frequently asked questions about E852 DAQ system. Hopefully, it will serve as DAQ troubleshouting guide. If you don't find an answer to your problem in this FAQ feel free to submit your question using a form below. Enter your name in the form if you want an answer to be mailed to you. Otherwise, your question will be anonymous.


Your name (optional)

Please enter your question below:

You can express your thoughts and feelings about DAQ here:

INDEX

General

Fastbus

DAQcontrol

Xlog

Alarm

daqlogd

Killerd

messaged

DAQio

DAQinit

EventBuilder

tapeControl

Dispatcher

Analyzer

ADC Pedestals

General


What is a starting point for DAQ exploration?

Login on mpsdaq. Type " ~mps/start.session " at shell prompt (don't forget to set your DISPLAY variable). Two windows should appear on your screen: E852 toolchest window and DAQ console window with a tail of logfile. You'll be able to access the most important DAQ programs in E852 toolchest. It's important to note here that programs launched in this way run with e852 user/group id. Some DAQ programs may not run properly in a different account! It's always safer to use an E852 toolchest.

In case of message "Permission denied" check that your account is in e852online .rhosts file.


I'm getting messages "E852_?????? undefined". What's wrong?

E852 environment variables are not set. Type

source /home/mpsdaq/e852/daq/setup

at the shell prompt or, alternatively, put this line in your .cshrc file. More detailed explanation is here


How do I get an information about current status of DAQ system?

Three major monitoring tools are DAQcontrol, Xlog and Alarm which you can launch from the toolchest. It's always useful to have them on your screen if you are on shift. The following minimal set of DAQ daemons should be running: First, check that all of them are running either with UNIX ps command or with Xlog. Second, look on status line of DAQcontrol. If you suspect that something is wrong check daemons' logfiles displayed in Xlog.


All or some daemons are not running. What to do?

In the toolchest goto DAQ -> System -> Restart DAQ. Keep an eye on DAQ console window while restarting DAQ - all problems during restart are reported in this window. Wait ~30 seconds and check with Xlog that all daemons are running and "healthy".

Only in some severe cases you may try to start DAQ "from scratch". To do that: type at the shell prompt /home/mpsdaq/e852/daq/bin/stop. Wait 2-3 minutes (it's necessary beacause for a few minutes after termination of daqlogd its UNIX sockets are present in the state of TT_CLOSE_WAIT. This can prevent succesfull restart). After this pause restart DAQ as above.


How does DAQ handle run numbers?

Last run # is stored in the file $E852_INIT/last.run. DAQio reads and updates this file at the beginning of every run.


Fastbus


Overview


What is BBFC?

BBFC is a computer interface to Fastbus. DAQ works with 2 BBFC's. BBFC #1 is in the main (drift chambers) crate in the Fast Trailer. BBFC #2 is in the main crate in the LGD Hut. Default BBFC for DAQ is #1, and all modules' addresses have a "root" in the main crate in the Fast Trailer.


What is the meaning of 0x.... as module's address?

All Fastbus modules have an address in the form of hexademical number 0x.... This address tells the program how to find a route from computer to this module. Fastbus address has 1, 2, 3 or 4 bytes.

1-byte address (0xN or 0xNN) is module's slot number if it's in the crate with BBFC.

2-bytes address (0xmMM) is SSP's address 0xMM on SSP cable segment. Computer reaches this cable segment over SSP in slot m in the main crate.

3-bytes address (0xmMMNN) is module's slot number 0xNN in the crate with SSP 0xmMM.

4-bytes address (0xGGmmMMNN) is a special case for modules reachable over SI cable segment (in our case these are LGD ADC's and SI's themself).

You can find more detailed explanation of Fastbus addresses here.


Fastbus address <-> "geographical" location

First, some geography.

"Main" crate:

BBFC #1. SSP 0x1("master"), SSP 0x102("MPS DC"). MPS DC. Latches. Scalers. Modules' addresses: 0x*, 0x** and 0x102**

"TDX4" crate:

SSP 0x104("TDX"). TDC 1876 for TDX4 and Beam Hodoscopes. FBD. Modules' adresses: 0x104**

"TCYL" crate:

SSP 0x106("TCYL"). TDC 1876 and ADC 1881 for TCYL, DEA, CPV. Modules' addresses: 0x106**

"CsI" crate:

SSP 0x107("CsI"). ADC 1881 for CsI. SBB for TPX and Beam PWC. Modules' addresses: 0x107**

"LGD_Main" crate:

BBFC #2. SSP 0x101("LGD"). SI. FBD. Latches. Scalers. Modules' addresses: 0x101**

"LGD 0" crate:

SI. LGD ADCs. Modules' addresses: 0x100101**

"LGD 1" crate:

SI. LGD ADCs. Modules' addresses: 0x110101**

"LGD 2" crate:

SI. LGD ADCs. Modules' addresses: 0x120101**

"LGD 3" crate:

SI. LGD ADCs. Modules' addresses: 0x130101**

Special cases:

Address 0x1** - on SSP cable segment. Address 0x800101** - on SI cable segment.

Information about CAMAC whereabouts is here


What is "hardware allocation"?

Hardware allocation is a scheme which prevents two or more competing processes from simultaneous access to Fastbus/CAMAC. Most of the Fastbus operations involve SSP (or SSP's) somehow: All operations above are "multistep" actions (the same is true for any CAMAC operation through FBD). Altering of SSP memory or FBD registers by competing process during such operation will inevitably creates havoc. Hardware allocation (realized in the form of two functions allocate_hardware_(&time_to_wait) and deallocate_hardware_()) helps to avoid a danger of such interference between processes.

In what situations the allocation is not required?

The second role of hardware allocation is a synhronization of access with DAQio. DAQio "grabs" hardware for the duration of spill. Other processes which use this scheme are guaranteed to access Fastbus/CAMAC only during an interspill pause.

NOTE: allocation scheme can be easly abused. Please, enclose only a code actually dealing with hardware inside the allocate/deallocate pair unless there is a necessity to grab access for a longer period of time.


This annoying "FB_ALLOCATE: Waiting for the following process:" message...

What to do if a program came to this deadlock? First, read the paragraph above. If you do not understand it then don't go beyond this point and ask any expert for help. If you do and you are sure that none of other programs is sharing the same SSP/FBD with a process holding access to Fastbus then execute /home/mpsdaq/e852/daq/bin/overrideFBAlloc. Existing allocation semaphores will be removed and a race for access will start anew.

CAUTION: a process which had access might be unaware of this trick. It continues to assume that it holds access solely until the next call to allocate/deallocate.


Some hints about Fastbus error messages

A typical Fastbus error message has a form:

RC. PA:0x7 SA:0x0 Error:0xD
BSI: Operation:RC PA:0x7 SA:0x0
 BSI: Primary address timeout
  BB: BBFC Address time out | EC:1008 VBBC:0x6084FFFF BBFC:0x00010010
  BB: OP:RC   PA:0x7 SA:0x0 Bytes: required 4 actually -4
or
RC. PA:0x10407 SA:0x0 Error:0xD
BSI: Operation:RC PA:0x10407 SA:0x0
 BSI: Primary address timeout
or
RC. PA:0x10507 SA:0x0 Error:0x103
BSI: Operation:RC PA:0x10507 SA:0x0
 BSI: Internal error of SSP along the route
 SSP: Primary address timeout
The first line is a header describing operation. Next few lines provide all available information about an error. Errors with BB: prefix were detected inside BranchBus library. This prefix tells that a source of error is somewhere along the chain mpsdaq <-> VME crate <-> VBBC/BVI in this VME crate <-> Branch Bus <-> BBFC <-> Fastbus crate with BBFC <-> module in this crate. For example, in the first fragment above one is trying to access empty slot 0x7 in the main crate (with BBFC).

Prefix BSI: designates errors detected inside Buffered Segment Interconnect library build atop of BB library. This library is used to reach modules which are NOT in the crate with BBFC with the aid of software resident in SSP's. If there is no BB: line in the message then origin of error is somewhere "below" SSP in the main crate. If an error is caused by one of the SSP along the route to a module being addressed then message contains line

BSI: Internal error of SSP along the route

as in the third fragment above (one is trying to access some module in slot 7 in a crate with non-existing SSP 0x105). If there is no reference to internal SSP error then an error was generated by the module being addressed (as in the second fragment: attempt to read empty slot 0x7 in the crate with SSP 0x104).


What programs are available for Fastbus debugging?

Look into directory /home/mpsdaq/e852/fbtools. These programs perform a particular Fastbus operation:

rc   [pa]  [sa]           - Single word read from CSR space             
rd   [pa]  [sa]           - Single word read from Data space             
rcb  [pa]  [sa] [nwords]  - Block read from CSR space                   
rdb  [pa]  [sa] [nwords]  - Block read from Data space                   
rc2b [pa]  [sa] [nwords]  - Block read from CSR space terminated on SS=2
rd2b [pa]  [sa] [nwords]  - Block read from Data space terminated on SS=2
rcm  [brf] [sa]           - Broadcast single word read from CSR space   
rdm  [brf] [sa]		  - Broadcast single word read from Data space   
rcbm [brf] [sa] [nwords]  - Broadcast block read from CSR space         
rdbm [brf] [sa] [nwords]  - Broadcast block read from Data space         

wc   [pa]  [sa] [datum]   - Single word write to CSR space             
wd   [pa]  [sa] [datum]   - Single word write to Data space             
wcb  [pa]  [sa] [nwords]  - Block write to CSR space                   
wdb  [pa]  [sa] [nwords]  - Block write to Data space                   
wcm  [brf] [sa] [datum]   - Broadcast write to CSR space               
wdm  [brf] [sa] [datum]	  - Broadcast write to Data space               
wcbm [brf] [sa] [nwords]  - Broadcast block write to CSR space         
wdbm [brf] [sa] [nwords]  - Broadcast block write to Data space         
wrb  [pa]                 - Reset bus on segment with PA
wrbg [pa]                 - Reset bus on and below segment with PA

fbd  [pa] [f] [c] [n] [a] - CAMAC operation FCNA over FBD at PA

load [pa]  [filename]     - load SSP executable file into SSP
si   [ssp_pa]             - initialize SI tree starting in a crate with SSP ssp_pa
Before using these programs do

setenv BBFC 1 or setenv BBFC 2

to select BBFC either in the Fast Trailer or in the LGD Hut.


DAQcontrol


...


Xlog


...


Alarm


...


daqlogd


...


Killerd


...


messaged


...


DAQio


...


DAQinit


...


EventBuilder


...


tapeControl


...


Dispatcher


Overview

Go here and you will know everything.


Analyzer


...


AO