Table of Contents

Overview

The FACET facility is controlled by a combination of the VMS-based SCP control system, and EPICS. EPICS controls are centered in the new experimental region in LI20, and include these subsystems: profile monitor, collimator/motion, bunch length monitor, wire scanner and event. Magnet, bpm and toroid subsystems in the new LI20 region are controlled by the SCP. A single EPICS controlled profile monitor will eventually reside in LI10.
All other FACET controls are SCP-based. 

This document is a basic overview FACET control system physics development guide.

For complete information, detailed instructions and examples please refer to the "MATLAB Programmer's Guide for FACET physicists" programming_guide_matlab_facet.pdf:

#top


I. Logging into the FACET control system

The FACET EPICS control system resides on a private network, parallel to and separate from the LCLS network.  The FACET server that will be used for physics work is:

To log into the FACET server from a linux terminal session:

#top


II. FACET edm displays: facethome

facethome is the toplevel edm display for the FACET accelerator. It is similar to lclshome, a grid showing areas and subsystems, with clickability into the various displays.

To launch facethome from a terminal session on the facet network:

To launch facethome from a an MCC opi:

#top


III. SCP

SLC system principles and development documents:
The different kinds of Mode in the SCP http://www.slac.stanford.edu/%7Egreg/modes.html
Facet model preparation http://www.slac.stanford.edu/~mdw/FACET/doc/OnlineModel.txt
SLAC Online Modelling Programmers Guide http://www-mcc.slac.stanford.edu/%7Egreg/model_overall_pg.html

Principals of Operation (POOP): http://www.slac.stanford.edu/grp/cd/soft/wwwman/poop.html
Basic User Guide (BUG): http://www.slac.stanford.edu/grp/cd/soft/wwwman/bug.www/

To run a SCP from a terminal session window:

To run a SCP from facethome:

An example: displaying a Design TWISS plot from the SCP:

#top


IV. Matlab

For detailed instructions on developing matlab scripts, and examples, please see the "MATLAB Programmer's Guide for FACET physicists", attached to this Confluence page.

Environment setup

Starting matlab

basic flow for working with matlab scripts and CVS

Development environment note
Once you have done cvs checkout matlab/toolbox, the next time you login to facet-srv01 (as fphysics - see above #login section) your matlab working directory /home/fphysics/yourusername/matlab/toolbox will be prepended to the MATLABPATH environment variable. This means that when you (logged in as your username) run a script you're developing, your version will run instead of over the one in production.

getSystem() function
Within a matlab script you can use the getSystem function to determine the accelerator system defined in the current working environment. This is useful for writing scripts that can be used for multiple accelerator systems, with conditional actions depending on accelerator.

[system,accelerator] = getSystem();

Return values are:

FACET

system = SYS1, accelerator = FACET

LCLS

system = SYS0, accelerator = LCLS

NLCTA

system = SYS4, accelerator = NLCTA

Matlab support PVs
A set of Matlab support PVs for FACET are available from the matlab support soft IOCs, with the naming convention
SIOC:SYS1:ML0x:<type><n>

To view the PVs:

To use the PVs:

Example display of Matlab support AO PVs:

CODE Examples

EPICS PV visibility


V. BSA: Beam Synchronous Acquisition - CURRENTLY UNDER CONSTRUCTION FOR FACET

For a complete overview, detailed instructions and examples please see the "MATLAB Programmer's Guide for FACET physicists", attached to this Confluence page.

A LCLS event system has been setup to read devices synchronous with beam crossing, such as BPMS and toroids. FACET beam synchronous acquisition will interface with both EPICS and the VMS-based SCP. Implementation of this interface is currently in process. The BSA system will be usable from within Matlab. Note that this is not implemented for image data collection, which is described in a separate section of the Programmer's Guide.

more coming...

#top


VI. AIDA: Accelerator Integrated Data Access - CURRENTLY UNDER CONSTRUCTION FOR FACET

http://www.slac.stanford.edu/grp/cd/soft/aida/

For instructions and examples please see the "MATLAB Programmer's Guide for FACET physicists", attached to this Confluence page.

To obtain control system names and values, AIDA is accessible from the linux command line, via aidaWeb https://seal.slac.stanford.edu/aidaweb, through matlab and other language interfaces.

list of data sources

command line tools

matlab

SLC Buffered Data Service

web interface

#top


VII. FAQs

Q: How do I log onto the channel access network?
A: While shared accounts are used, the command is:
ssh fphysics@facet-srv01
If that hangs, then ssh into mcclogin first:
ssh mcclogin

Q: Where do I put changes to the standard environment setup?
A: Put them in /home/fphysics/<username>/ENVS.
See /home/fphysics/zelazny/ENVS for an example.

Q: How do I check things out of cvs?
A: To checkout software (you only need to do this once):
cd /home/fphysics/zelazny
cvs co matlab/toolbox

Q: How to I put things back in cvs?
A: To put software into cvs:
cd /home/fphysics/zelazny/matlab/toolbox
cvs commit

Q: What if I created some new files?
A: To put new files into cvs:
cvs add <filename>
cvs commit

Q: Why is CVS asking for someone else's password?
A: Your environment isn't setup correctly. Setup with:
set_profile

Q: I'm not listed when I "set_profile", what do I do?
A: Press "0" for none, then create your profile with:
cd /home/fphysics
mkdir <your unix username>
log out of fphysics, and log back in. You should be listed.

Q: How do I release to production?
A: To make software available for general use, you will use the cvs2prod utility. See above #matlab "basic flow" section abovve
cvs2prod

Q: How do I get files from /afs to the channel access network?
A: To get a file from /afs that's not in cvs:
scp loos@mcclogin:~loos/controls/profmon/profmon_setup.m

Q: Where are the Matlab data files?
A: (on facet-srv01) ls -als $MATLABDATAFILES
(on mcclogin) ls -als ls /mccfs2/u1/facet/matlab
(from SLAC web browsers) http://mccas0.slac.stanford.edu/u1/facet
Q: I'm totally lost, what do I do?
A: Call Jingchen Zhou x4661

#top


VIII. Useful links

labCA commands

http://www.slac.stanford.edu/~strauman/labca/manual/node2.html

labCA tutorial

https://confluence.slac.stanford.edu/download/attachments/37130/labca_presentation.pdf

AIDA main page

http://www.slac.stanford.edu/grp/cd/soft/aida

AIDA web

https://seal.slac.stanford.edu/aidaweb

EPICS Home Page

http://epics.aps.anl.gov/epics/

CVS commands

http://www.cvsnt.org/wiki/CvsCommand

FACET model preparation

http://www.slac.stanford.edu/~mdw/FACET/doc/OnlineModel.txt

The different kinds of Mode in the SCP

http://www.slac.stanford.edu/%7Egreg/modes.html

SLAC Online Modelling Programmers Guide

http://www-mcc.slac.stanford.edu/%7Egreg/model_overall_pg.html

CVS repository

http://www.slac.stanford.edu/cgi-wrap/cvsweb/matlab/toolbox/?cvsroot=LCLS

Device database (control system names)

https://oraweb.slac.stanford.edu/apex/slacprod/f?p=116

SCP POOP

http://www.slac.stanford.edu/grp/cd/soft/wwwman/poop.html

SCP BUG

http://www.slac.stanford.edu/grp/cd/soft/wwwman/bug.www

#top


IX. Edit the Developers Guide

Please feel free to modify/correct/add to this document

#top