Initialise as usual

> cd ~/decal_sw
> source

Compile if needed

> source


Running Backups

The data can be backup by running the following script periodically. The data can be backed up to the remote RAL webdav server or a local USB exteranl drive.

The script uses rsync to only copy what has changed.

> cd ~/decal-sw/Cherwell/Tests/src
> ./              # to see options
> ./ webdav real  # to backup to the webdav server
> ./ usb real     # to backup to a usb external drive

Changing configuration settings

The configurations are defined in 3 types of file in ~/decal_sw/Cherwell/bin/data/cfg/. This allows different settings for the different sensor types without having to change lots of files.

The code first reads config_defaults.txt ; then it reads sensor%%.txt to override any settings in the defaults file. The code then applies those settings to the sensor. The settings are recorded in ~/decal_sw/Cherwell/bin/data/log/


To arrange for the vncserver to start when computer boots up

> sudo chkconfig vncserver on
> sudo service vncserver start

To stop the vncserver running and to prevent it restarting on boot up:

> sudo service vncserver stop
> sudo chkconfig vncserver off

Setting up the NIM crate

Here is a diagram of the cabling of the NIM crate required to produce either scintillator or generator triggers. The o/p from the "Receive" channel provides a reference voltage (0V) for the triggers in the trigger distribution board.

Setting up the Trigger Distribution Board and Front Panel


  1. See Trigger_Distribution_fanout_cables.pdf for how to connect USBDAQ to the Trigger Distribution Board. You willo need to connect up the 7-way IDc cable to teh 6-way socket on the Trigger Board and the 4-way + 1-way sockets on the USBDAQ (don't ask, see the diagram below).
  2. Start an xterm/terminal session 

    Make sure trigger board is powered up and USB cable connected to computer
  3. Load FrontPanel in FrontPanel directory. The Front Panel loads as pop up.

    > cd FrontPanel
    > ./FrontPanel.bin &
  4.    Download  configuration firmware by clicking on left icon on Front Panel (Arrow over single file). This will be greyed out if you have not plugged in the USB cable.
    1.   Open file testbeam.bit      [caliceon directory]
    2.    [N.B Do not open old firmware misleadingly titled testbeam_new.bit]
    3. Check FPGA is complete at the bottom of Front Panel window ("FPGA configuration complete").

  5. Load Front Panel profile by clicking right icon on Front Panel. (Arrow over two files)
    1. Open file testbeam.xfp      [caliceon directory]
    2. The old panel will display some lines and a new panel will pop up
  6. Select positions the trigger should act on by making the corresponding mask Busy.
    1. The USBDAQS are connected to the trigger board by coloured IDC cables. They plug into the trigger board into sockets numbererd 1 to 8.
    2. [Busy 1, Not Busy 0]. There are two 'Busy' lines on the Front Panel; the top represents the masks (1=allowed,0=blocked), the bottom the sensors.
    3. Numbers 8-1 at the bottom of the window control the masks.
    4.  Select the masks for the connected USBDAQS. For the 3 sensor mode shown below they would be 1, 2, 3.
    5. Line 2 is reported to be dodgy and should be avoided.
    6. In the 4-port dip switch labelled "MODE", the two centre dip switches (nos. 1 and 2) should be in the down position and the others in the up position. The FrontPanel window will show the "Trig Mode" as green for numbers 1 and 2.
    7. The counter can be set by clicking on "Count". To clear count click "CLR CN" and click again to restart.

  7. Start the data acquisition software in Tests/src tab.

    >  cd ~/decal/Cherwell/Tests/src 
    > ./ <No. Sensors> <Run Number>

Checking USBDAQs are ready

The simplest way to check the USBDAQS are partially alive is to run ./IDTest

> cd ~/decal_sw/Cherwell/Tests/bin
> ./IDTest

If the usbdaq is alive it will return the sensor and board id. At the moment it only works for the first usbdaq it finds rather than all of them but it usually gives some indication that the system is ready.

Starting a Run

data taking can be stated by running the ./readMultipleSensors script. This will spawn one process and terminal for each USBDAQ. The read out code then waits for a trigger before reading out the frame. the code runs continuously until told to stop (see below)

> cd ~/decal_sw/Cherwell/Tests/src
> ./ <#usbdaqs> [<runnum>]
> ./ 6


 The readout code will write out information to

Stopping a Run (cleanly)

Once you have started a run you can stop it by issuing the following command

> ~/decal_sw/Cherwell/Tests/src/

This creates a file called STOP_DAQ_RUN in ~/decal_sw/Cherwell/Tests/src. The readout processes stop when they see this file (you will see the terminals disappear one by one). The file is automatically deleted by ./ before starting a new run but other scripts may not. 

Recovering from a crashed run

> cd ~/decal_sw/Cherwell/Tests/src
> ./


Programming the firmware

Power recyling USBDAQS

 To cycle the power:caliceon@heplnw045 decal_sw