EnglishJapanese Reload Front page List of pages Search Recent changes RSS of recent changes

Abstract

Here the installation and setup sequence are introduced to use NBBQ and babirlDAQ on your PC. To handle CAMAC/VME controllers, the NBBQ software package is required. Please install NBBQ first, after that install babirlDAQ. You can get files from here.

Install NBBQ

Uncompress tar file or get files via svn (from RIKEN inside)

(by tar file)
cd ~/
tar zxvf nbbq-****.tar.gz
cd nbbq-****
./config
  (please ask questions)
make
su
make install

Install NBBQ modules

For the first time, (Fedra or CentOS or Scientific Linux case)

/etc/rc.d/init.d/nbbq restart

Usually, at the boot up time, above service is automatically run. Recent udev system, you have to register device files by your hands (when reboot a PC, device files are removed, and recreated by the udev system). The easiest way is insert these lines in /etc/rc.d/init.d/nbbq file:

su
emacs -nw /etc/rc.d/init.d/nbbq

start() {
       daemon /usr/nbbq/analyzer/analyzer -D
       $INSM $DIR/bb-cc77/bb-cc77.ko
       $INSM $DIR/bb-sbs620/bb-sbs620.ko
       $INSM $DIR/nbbqccio/nbbqccio.ko
       $INSM $DIR/nbbqvio/nbbqvio.ko
######## insert these 4 lines ########
       mknod -m 0666 /dev/nbbqccio c 127 0
       mknod -m 0666 /dev/nbbqvio c 126 0
       mknod -m 0666 /dev/nbbqdrv c 122 0 
       mknod -m 0666 /dev/babildrv c 124 0 
######################################
}

stop() {
       $RMM nbbqdrv
       $RMM nbbqccio
       $RMM nbbqvio
       $RMM bb-cc77
       $RMM bb-sbs620
       killproc analyzer
}

Install babirlDAQ (user mode)

About the full installation, please refer DAQ/Manual/Installation

Uncompress tar file or get files via svn (from RIKEN inside)

(by tar file)
cd ~/
tar zxvf babirl-****.tar.gz
ln -s babirl-**** babirl

Configure include/userdefine.h

Edit userdefine.h like this, (here assuming user = daq)

cd babirl
emacs -nw include/userdefine.h
/* include/userdefine.h */ 
#define BABIRLDIR "/home/daq/babirl"
#define PIDDIR    "/home/daq/babirl/run"

Compilation

cd babirl
make

Processes and Drivers

To run babirlDAQ on 1PC with user mode:

Launch babinfo, babild and babies(with normal Linux mode)

cd babirl
bin/babinfo
bin/babild -l 1
bin/babies -l 10

Check the connectivity

cd babirl
bin/babicon

You could connect babild(=Event Builder).

Prepare the event flagment (babies)

Setup Web Utilities helps you.

From command line:

bin/babicon

localhost> seteflist 10 add localhost localhost
localhost> getesconfig 10
  (You can see the configuration of babies)
localhost> setesconfig 10 rtdrv /home/USERNAME/drv
localhost> exit

Prepare CAMAC/VME data readout driver

Copy files

cd ~
mkdir drv
cd drv
cp -dpR ~/babirl/babidrv/* ./
(for kernel 2.4 case)
ln -sf Makefile.24 Makefile

Definitions bbmodules.h

Edit bbmodules.h, this sample is using SBS618/620 PCI-VME and CANE V772/V785/V792 ADCs, interrupt levelt = 1:

#define EFN     10
#define MAXBUFF 3000
#define VME
#define VMEINT
#define SBS620
#define DBUFF

#define INTLEVEL 1
#define ADCADDR 0x11110000

startup.c for startup sequence

void startup(void){
 /* Startup Function */
 vme_define_intlevel(INTLEVEL);
 v7XX_clear(ADCADDR);
}

evt.c for event-by-event sequence

void evt(void){
 /* Event */

 vme_read_intvector();

 init_event();
 init_segment(MKSEGID(0,0,0,V785));
 v7XX_segdata(ADCADDR);
 end_segment();

 v7XX_clear(ADCADDR);
} 

MKSEGID is the definition of SEGMENTID. It is used to find "what is this segment", and useful for analysis software. About this segment-id, please see DataFormat.

clear.c for clear

void clear(void){
  // you should write output register command
  // to clear VETO signal
}

stop.c for stop sequense

void stop(void){
 v7XX_clear(ADCADDR);
}

Start and Stop

babirl/bin/babicon
(non data store mode) 
localhost> nssta
localhost> stop

(data store mode)
localhost> sethdlist 0 path /home/USERNAME
localhost> wth write header
localhost> start
localhost> stop

Check the stored data

babirl/bin/chkridf /home/USERNAME/data0001.ridf

Setup Web Utilities

Launch web service

Babirl web based configurator requires httpd with php (ver.5 or later with XML library). To install php, Scientific Linux case:

yum install php
yum install php-xml

HTTP server has to be launched,

service httpd start
chkconfig --level 35 httpd on         // Automatically launch at the OS startup

If you use web-utilities on a user directory, /etc/httpd/conf/httpd.conf should be modified as:

<IfModule mod_userdir.c>
  # UserDir disabled        <-- Comment out
  UserDir public_html      <-- write this line
</IfModule>

And the "FollowSymLinks" option is useful. In Scientific Linux 6.0, it is available by default.

Copy or link web-utilities

cd ~/
ln -s /home/USERNAME/daq/babirl/webutil ./public_html
 or
cp -dpR ../daq/babirl/webutil ./public_html

Set the permission,

chmod 777 public_html/xml
chmod 777 public_html/dat

From here, you can access via Web-browser (http://YOURHOST/~USERNAME/). About the configuration of Web-utilities, please refer WebUtility.

It is better to set php.ini about time zone like this:

[Date]
; Defines the default timezone used by the date functions
; http://www.php.net/manual/en/datetime.configuration.php#ini.date.timezone
date.timezone = "Asia/Tokyo"  

To use 'Web process manager', the process of 'babimo' is required. This 'babimo' is not safe process, it makes security hole. You should not run it under commonly-used servers.

To run 'babimo', it require the root privilege,

INSTALLDIR/bin/babimo

Online analysis

First step

babian is a front-end for online software (such as ANAPAW, SpecTcl/Tk). First you have to launch babian:

babirl/babian/babian

And you have to configure client host to send online data:

babirl/bin/babicon

localhost> setclinfo 0 add localhost

During run (nssta or start), you can check online data by using chkridf or monan

(non interactive)
babirl/bin/chkridf -s 0

(interactive but not graphical)
babirl/devtool/monan
Last-modified: Thu, 10 Jul 2014 15:02:26 HAST (3816d)