The data logged by the viewed either by the X-Window application Xarr or over the web with the CGI program CGIExport. Either of these programs can also be used to extract text formated data useful spreadsheets and other applications.
Below we detail the steps followed to compile and configure the ChannelArchiver and viewer applications for the G0 target. These details are given both as a form of collaboratino documentation and in the hopes that these details can help setup EPICS logging for other applications.
The applications were installed on the account g0targ on the machine gzerol2.acc.jlab.org. This machine is a PC running RedHat Linux version 6.2.
export HOST_ARCH=Linux export XARR_DB_INDEX=/home/g0targ/Archives/ArchiveData/freq_directory(Or do equivalent if using tcsh instead of bash)
EPICS_BASE=/home/g0targ/epics/R3.13.0.beta12CEBAF3/base TEMPLATE_TOP=/home/g0targ/epics/R3.13.0.beta12CEBAF3/base/templates/makeBaseApp/top(Replace /home/g0targ if different)
cd ~/epics/R33.13.0.beta12CEBAF3/base make
cd ~/car-xarr make
cp -p ~/car-xarr/CAR/bin/Linux/ArchiveEngine ~/bin cp -p ~/car-xarr/XARR/bin/Linux/xarr ~/bin
mkdir ~/Archives mkdir ~/Archives/ArchiveData mkdir ~/Archives/cfgNote, the ArchiveData directory is going to hold all the output of the logger. It will get large, so it might be a good idea that ArchiveData be a softlink to a directory on a really huge disk.
#!/bin/bash export EPICS_TS_MIN_WEST=300 export EPICS_CA_AUTO_ADDR_LIST=YES export EPICS_CA_ADDR_LIST="129.57.211.255 129.57.215.255 129.57.239.255 129.57.243.255" ARCHIVE_ENGINE_NAME=ArchiveEngine ARCHIVE_ENGINE=/home/g0targ/bin/$ARCHIVE_ENGINE_NAME ARCHIVE_DIR=/home/g0targ/Archives cd $ARCHIVE_DIR alreadyrunning="`ps auxww | grep $ARCHIVE_ENGINE_NAME | grep -v grep`" if [ "$alreadyrunning" = "" ] ; then $ARCHIVE_ENGINE -log $ARCHIVE_DIR/archive.log ./config $ARCHIVE_DIR/ArchiveData/freq_directory > archive.out 2>&1 & else echo "The Archiver is already running" fiHere is an example ~/Archives/stop_archiver script:
#!/bin/bash ARCHIVE_ENGINE_NAME=ArchiveEngine ARCHIVE_ENGINE=/home/g0targ/bin/$ARCHIVE_ENGINE_NAME ARCHIVE_DIR=/home/g0targ/Archives ARCHIVE_LOCK_FILE=$ARCHIVE_DIR/archive_active.lck killall $ARCHIVE_ENGINE_NAME sleep 1 stillrunning="`ps auxww | grep $ARCHIVE_ENGINE_NAME | grep -v grep`" if [ "$stillrunning" != "" ] ; then killall -9 $ARCHIVE_ENGINE_NAME fi if [ -f $ARCHIVE_LOCK_FILE ]; then rm -f $ARCHIVE_LOCK_FILE fi
# Group: config # This file was auto-created by the ChannelArchiver Engine # Instance: EPICS Channel Archiver Engine !write_period 30 !default_period 1 !get_threshold 300 !file_size 24 !buffer_reserve 3 !group demoand ~/Archives/demo
# Group: demo hallc:bcm1 1 monitor hallc:bcm2 1 monitor
Type xarr.
mkdir ~/public_html mkdir ~/public_html/cgi mkdir ~/public_html/cgi/tmp chmod 777 ~/public_html/cgi/tmp chmod 755 ~ cp ~/car-xarr/CAR/bin/Linux/CGIExport ~/public_html/cgi/CGIExport.cgi cp -p ~/car-xarr/CAR/CGIExport/src/Tests * ~/public_html
After "UserDir public_html" in httpd.conf, add:
AllowOverride AuthConfig Limit Options Indexes ExecCGI
<html> <body> <a href="cgi/CGIExport.cgi?DIRECTORY=..%2FArchives%2FArchiveData%2Ffreq_directory&COMMAND=START">Archiver</a> </body> <html>
%lt;br%gt;Installed for G0 by <a href="mailto:saw@jlab.org">Stephen A. Wood%lt;/a%gt;
<Limit GET> order deny,allow deny from all allow from gzerol2.acc.jlab.org wood.jlab.org allow from gzero.jlab.org AuthType Basic AuthUserFile /home/g0targ/public_html/.htpasswd AuthGroupFile /dev/null AuthName ByPassword require valid-user satisfy any </Limit>