+ All Categories
Home > Documents > Using EPICS for Beamline Control and Data Acquisition

Using EPICS for Beamline Control and Data Acquisition

Date post: 05-Feb-2016
Category:
Upload: veta
View: 39 times
Download: 0 times
Share this document with a friend
Description:
Using EPICS for Beamline Control and Data Acquisition. Mark Rivers GeoSoilEnviroCARS, Advanced Photon Source University of Chicago. Acknowledgements. Many slides borrowed from the “Getting Started with EPICS” lecture series held over past year at APS. All talks are online - PowerPoint PPT Presentation
52
Using EPICS for Beamline Control and Data Acquisition Mark Rivers GeoSoilEnviroCARS, Advanced Photon Source University of Chicago
Transcript
Page 1: Using EPICS for Beamline Control and Data Acquisition

Using EPICS for Beamline Control and Data Acquisition

Mark Rivers

GeoSoilEnviroCARS, Advanced Photon Source

University of Chicago

Page 2: Using EPICS for Beamline Control and Data Acquisition

GeoSoilEnviroCARS Australian Synchrotron Beamline Control WorkshopApril 18-19, 2005

• Many slides borrowed from the “Getting Started with EPICS” lecture series held over past year at APS. All talks are online– Ned Arnold, APS, Introduction to EPICS– Ken Evans, APS, MEDM– Tim Mooney, APS, Beamline controls

Acknowledgements

Page 3: Using EPICS for Beamline Control and Data Acquisition

• Goals for Beamline Control and Data Acquisition (BCDA) systems

• Brief Overview of EPICS• Advantages of using EPICS for BCDA• Where is EPICS being used for BCDA today• What’s available for EPICS BCDA

– The synApps module from APS– Cover some basics today– More details in talks on detectors, feedback tomorrow

• What needs to be done

Outline

Page 4: Using EPICS for Beamline Control and Data Acquisition

GeoSoilEnviroCARS Australian Synchrotron Beamline Control WorkshopApril 18-19, 2005

1. Easy to use• Intuitive Graphical User Interface (GUI)• Customized for the specific experiment

2. Fast, efficient• Expert users don’t want to navigate GUI

3. Powerful, able to accomplish any task, even if it has never been done before

4. Able to use existing applications that have substantial development and user familiarity (Blu-Ice, SPEC, Photon Factory EXAFS program, etc.)

5. Can use different applications to run the same equipment for different experiments (i.e. not tied into Labview or SPEC drivers)

6. Available off-the-shelf, no development required (you wish!)

Characteristics of an Ideal Beamline Control and Data Acquisition System

Page 5: Using EPICS for Beamline Control and Data Acquisition

GeoSoilEnviroCARS Australian Synchrotron Beamline Control WorkshopApril 18-19, 2005

Introduction: What is EPICS?

• A collaboration of the controls groups of many research organizations that use the EPICS tool-kit.

• A distributed architecture that supports a wide range of solutions from small test stands to large integrated facilities.

• A set of tools that reduces software application and maintenance costs by providing:

Configuration tools in place of programming

A large installed base of tested software

A modular design that supports incremental upgrades

Well defined interfaces for extensions at every level

Page 6: Using EPICS for Beamline Control and Data Acquisition

GeoSoilEnviroCARS Australian Synchrotron Beamline Control WorkshopApril 18-19, 2005

What is EPICS?

– For EPICS, client and server speak of their Channel Access role• i.e. Channel Access Client & Channel Access Server

ClientClient

Server Server

CACA

CA CA

• A Collaboration• A Control System Architecture

– Network-based “client/server” model (hence the EPICS logo)

Page 7: Using EPICS for Beamline Control and Data Acquisition

GeoSoilEnviroCARS Australian Synchrotron Beamline Control WorkshopApril 18-19, 2005

What is EPICS?• Channel Access clients are programs

that require access to Process Variables to carry out their purpose

• The “service” that a Channel Access server provides is access to a Process Variable*

StripTool MEDM

Process

Variables

Process

Variables

CAS CAS

CACCAC

* A Process Variable (PV) is a named piece of data.

Page 8: Using EPICS for Beamline Control and Data Acquisition

GeoSoilEnviroCARS Australian Synchrotron Beamline Control WorkshopApril 18-19, 2005

What is EPICS?

• Process Variable– A Process Variable (PV) is a named piece of data

associated with the beamline (e.g. status, readback, setpoint, parameter)

– Examples of PV names and values:

• 13IDA:cc4 3.2e-08 torr (Cold cathode gauge 4)

• 2IDA:m1.RBV 0.323 mm (Motor 1 actual position)

• 13IDA:MonoEnergy 12.454 keV (Mono energy set point)

• S:SrCurrentAi 101.2 mA (APS ring current)

• APS:Mode ‘Stored Beam’ (APS storage ring mode)

• 13IDC:mca1 {0, 0, 1, 1, 1, 102, 210, 262, 0, 0, …} (MCA spectrum)

Page 9: Using EPICS for Beamline Control and Data Acquisition

GeoSoilEnviroCARS Australian Synchrotron Beamline Control WorkshopApril 18-19, 2005

What is EPICS?

• Process Variable

– A Process Variable is a named piece of data with a set of attributes

– Examples of Attributes:

• Alarm Severity (e.g. NO_ALARM, MINOR, MAJOR, INVALID)

• Alarm Status (e.g. LOW, HI, LOLO, HIHI, READ_error)

• Timestamp

• Number of elements (array)

• Normal Operating Range

• Control Limits

• Engineering Unit Designation (e.g. degrees, mm, MW)

Page 10: Using EPICS for Beamline Control and Data Acquisition

GeoSoilEnviroCARS Australian Synchrotron Beamline Control WorkshopApril 18-19, 2005

What is EPICS?• A Control System Architecture

– Network-based “client/server” model where the basic data element is a Process Variable

– The Channel Access Protocol defines how Process Variable data is transferred between a server and client

– The entire set of Process Variables establish a Distributed Real-time Database of machine status, information and control parameters

Process

Variables

CAS

Process

Variables

CAS

Process

Variables

CAS

Process

Variables

CAS

Process

Variables

CAS

Process

Variables

CAS

Process

Variables

CAS

Process

Variables

CAS

Process

Variables

CAS

Process

Variables

CAS

Page 11: Using EPICS for Beamline Control and Data Acquisition

GeoSoilEnviroCARS Australian Synchrotron Beamline Control WorkshopApril 18-19, 2005

What is EPICS?• Any tool/program/application that

abides by the Channel Access protocol could be described as “EPICS Compliant”.

My Accelerator Simulator

Code(PVs)

CAS

My Special Data

Collection Program

CAC

• EPICS can be viewed as a “toolkit” of EPICS compliant programs. One can select the appropriate tool for their need or develop their own.

StripTool MEDM

CACCAC

iocCore(PVs)

LabView(PVs)

CAS CAC CAS CAC

Page 12: Using EPICS for Beamline Control and Data Acquisition

GeoSoilEnviroCARS Australian Synchrotron Beamline Control WorkshopApril 18-19, 2005

Typical Realizations of an EPICS System

IOCIOC

IOC

IOCCAS

CAS

Commercial Instruments

Custom Chassis/Panels

Technical Equipment

Driving a motor with EPICS

circa 2002

circa 1995

Page 13: Using EPICS for Beamline Control and Data Acquisition

GeoSoilEnviroCARS Australian Synchrotron Beamline Control WorkshopApril 18-19, 2005

Channel Access in One Slide

CA Server

CA Client

Process Variables:

Channel Access Server

S1A:H1:CurrentAO

S1:P1:x

S1:P1:y

S1:G1:vacuum

Channel Access Client

Who has a PV named “S1A:H1:CurrentAO”?

I do.

What is its value?

25.5 AMPS

Change its value to 30.5

“connection request” or “search request”

OK, it is now

30.5

30.5 is too high. It is now set to the maximum value of 27.5.

You are not authorized to

change this value

Notify me when the

value changes

It is now 20.5 AMPS

It is now 10.5 AMPS

It is now -0.0023 AMPS

“put” or

“caPut”

“get” or

“caGet”

“set a monitor”

“post an event”

or

“post a monitor”

“put complete”

or

or

Page 14: Using EPICS for Beamline Control and Data Acquisition

GeoSoilEnviroCARS Australian Synchrotron Beamline Control WorkshopApril 18-19, 2005

IOC Software in One SlideNetwork (Channel Access)

“Supported” Instruments “New” Equipment

[IOC Software]

Device/Driver Support [EPICS-supplied/user-extensible]

EPICS “iocCore” services and routines [EPICS-supplied]

Application Specific Database [of Records]

Application Specific

Programs[e.g. State Notation

Language]

New Device Support

“Supported” Instruments “Supported” Instruments “Supported” Instruments

Shared/Provided Required Optional

Record

Record

Record

Record

Record

Record

Record

Record

Record

Record

Record

Record

Record

Record

Record

Record

Record

Record

Record

Record

Page 15: Using EPICS for Beamline Control and Data Acquisition

GeoSoilEnviroCARS Australian Synchrotron Beamline Control WorkshopApril 18-19, 2005

Standalone CA Clients (from EPICS Website)• ADT: Array Display Tool • ALH: Alarm Handler • AR: Data Archiver (the original, deprecated) • BURT: Backup and Restore Tool • CAEX: Channel Access Examples • CASR: Host-based Save/Restore • CAU: Channel Access Utility • Channel Archiver (SNS) • Channel Watcher (SLAC) • DM2K: Display Manager 2000 (BESSY) • EDD/DM: Editor and Display Manager (LANL) • EDM: Extensible Display Manager (ORNL) • HistTool: Data Histogramming Tool • JoiMint: Java Operator Interface and Management INtegration Toolkit (DESY) • Jprobe: Java Version of Probe, a Channel Monitoring Program • MEDM: Motif Editor and Display Manager • Probe: Motif Channel Monitoring Program • StripTool: Strip-chart Plotting Tool • Yviewer: Data Visualization Tool

Page 16: Using EPICS for Beamline Control and Data Acquisition

GeoSoilEnviroCARS Australian Synchrotron Beamline Control WorkshopApril 18-19, 2005

EPICS Programming/Scripting/Display Languages

• C, C++

• tcl/TK

• Visual Basic

• Labview

• IDL

• Python

• JAVA

• Matlab

• Unix shells

• Any other language with the ability to call C functions in a shared library or DLL

Page 17: Using EPICS for Beamline Control and Data Acquisition

GeoSoilEnviroCARS Australian Synchrotron Beamline Control WorkshopApril 18-19, 2005

Key Features of IOC software …• Two primary application specific components:

– The real-time database of records (required)– State Notation Language programs used to implement state oriented programs

(finite-state machine)

• Machine status, information and control parameters are defined as “records” in the application specific database.

• The data within a record is accessible via Process Variables.• Records have some functionality associated with them (scaling,

filtering, alarm detection, calculations, etc). Different record types have different functions and uses.

• Records are frequently associated with I/O equipment that requires unique “device support” for that instrument.

Page 18: Using EPICS for Beamline Control and Data Acquisition

GeoSoilEnviroCARS Australian Synchrotron Beamline Control WorkshopApril 18-19, 2005

Ten really neat things about EPICS

• It’s free• It’s Open Source• There are lots of users• All a client needs to know to access data is a PV name• You can pick the best tools out there …• … or build your own• The boring stuff is already done• A good contribution becomes internationally known• By following a few simple rules, you get a lot for free

Page 19: Using EPICS for Beamline Control and Data Acquisition

GeoSoilEnviroCARS Australian Synchrotron Beamline Control WorkshopApril 18-19, 2005

Ten really neat things about EPICS for BCDA

• There are lots of beamlines using it (next slide)

• Most record types for beamline components and common operations already exist– Motors, monochromators, multi-channel analysers, A/D, D/A, digital I/O, scanning,

save/restore, save_data, etc.

• Lots of device support and drivers for commercial devices in these classes already exists

• There are high-level applications available for free (e.g. EXAFS) or commercially (e.g. SPEC)

• There is a lot of expertise available close by because Australian Synchrotron accelerator will use EPICS

• You can have a basic beamline up and running very quickly with supported hardware, add features as time permits

– I converted 4 NSLS beamlines from CAMAC/VMS to EPICS in less than 1 week

Page 20: Using EPICS for Beamline Control and Data Acquisition

GeoSoilEnviroCARS Australian Synchrotron Beamline Control WorkshopApril 18-19, 2005

Synchrotron Beamlines Using EPICS

• Almost all beamlines (> 30) at the Advanced Photon Source

• Growing number of beamlines at NSLS (>10)

• All beamlines at the Swiss Light Source (?)

• Probable for beamlines at Diamond

• Canadian Light Source (just beginning, not using APS beamline code)

• A few beamlines at the ALS at Berkeley (?)

Page 21: Using EPICS for Beamline Control and Data Acquisition

GeoSoilEnviroCARS Australian Synchrotron Beamline Control WorkshopApril 18-19, 2005

EPICS Software Architecture for I/O Control

CA Server

DB Common

Record Support

IO bus

Hardware device

Device Support

Driver Support Optional

CA Client

Client Tool

Page 22: Using EPICS for Beamline Control and Data Acquisition

GeoSoilEnviroCARS Australian Synchrotron Beamline Control WorkshopApril 18-19, 2005

Record Support

Example records• ai (analog input, .VAL field is single number)• ao (analog output, .VAL field is a single number)• motor (lots of fields, e.g.)

– .VAL = target position– .RBV = readback position– .VELO = desired velocity– .DMOV = done moving flag

• MCA (multichannel analyser, lots of fields, e.g.)– .VAL = histogram array– .PRTM = preset real time– .STRT = start acquisition when set to 1– .ACQG = acquire busy flag

• Provides implementation for a record type• Lots of records come with standard EPICS• Some have been added in the synApps beamline control package

Page 23: Using EPICS for Beamline Control and Data Acquisition

GeoSoilEnviroCARS Australian Synchrotron Beamline Control WorkshopApril 18-19, 2005

Overview of synApps• A collection of EPICS applications for synchrotron-beamline

users. Collaboration between APS BCDA group and other beamlines at APS and elsewhere

http://www.aps.anl.gov/aod/bcda/synApps

• EPICS modules and build/configuration tools:– Modules: autosave, calc, camac, ccd, dac128V, dxp, ip, ip330, ipUnidig,

love, mca, motor, optics, quadEM, sscan, std, vme, xxx

– Build/config: config and utils directories

– 160,000 lines of code (C, SNL, databases), hundreds of medm screens

• Related clients, libraries, and visualization tools:• IDL: scanSee, mca display, ezcaIDL, ezcaScan, ez_fit, HDF

translator/browser, Ascii-format plotter, image processors, etc.

• CA-Server based CCD control

Page 24: Using EPICS for Beamline Control and Data Acquisition

GeoSoilEnviroCARS Australian Synchrotron Beamline Control WorkshopApril 18-19, 2005

synApps modules• Modules contain the following kinds of support:

– Compiled code; libraries• E.g., record and device support

• State-Notation-Language programs

– EPICS databases and autosave-request files• A database is a program written in a high-level language.

• One or more copies of a database can be run, each with its own private variables (PV’s).

• The database designer recommends PV’s to be autosaved by naming them in a .req file; you can override with a private copy of the file.

– MEDM-display files• The default user interface

– Documentation

Page 25: Using EPICS for Beamline Control and Data Acquisition

GeoSoilEnviroCARS Australian Synchrotron Beamline Control WorkshopApril 18-19, 2005

Other EPICS modules used by synApps• asyn (driver/device support)

• ipac (Industry Pack support)

• seq (State Notation Compiler)

• genSub (General subroutine record)

• vxStats (IOC statistics)

• allenBradley (PLC support)

Page 26: Using EPICS for Beamline Control and Data Acquisition

GeoSoilEnviroCARS Australian Synchrotron Beamline Control WorkshopApril 18-19, 2005

autosave module• Records latest values of selected EPICS PVs; restores those

values when the ioc restarts.– not an archiver; only the latest value is saved

– not the same as saveData, which writes scan data

– When a list list of PV’s is saved, the entire list is written, even if only one PV has changed.

• Can save/restore any scalar or array-valued PV

Page 27: Using EPICS for Beamline Control and Data Acquisition

GeoSoilEnviroCARS Australian Synchrotron Beamline Control WorkshopApril 18-19, 2005

...autosave module• PV lists can use include files (e.g., <database_name>.req), include path.

– Database developer can supply default include file with database.

– User can override with custom include file.

• Save triggers:– on change of any PV in the list

– periodically

– on change of a trigger PV

– manual

• User can reload save sets.

• User can choose to save redundant filesAutosave reports status via EPICS PV’s

Page 28: Using EPICS for Beamline Control and Data Acquisition

GeoSoilEnviroCARS Australian Synchrotron Beamline Control WorkshopApril 18-19, 2005

calc module• Support for evaluation of string or numeric expressions entered

at run time (or at database-configure time)

• Records– sCalcout – like calcout, but also supports string expressions; user can

specify wait-for-completion.

– swait – like calcout, but uses recDynLink (no “PP MS” link attributes)

– transform – like 16 calcout records that share a PV data pool

• Other code– string-calc engine

– sCalcout soft device support (with wait-for-completion option)

– interpolation routines for genSub record

– (yet another) averaging routine for sub record

Page 29: Using EPICS for Beamline Control and Data Acquisition

GeoSoilEnviroCARS Australian Synchrotron Beamline Control WorkshopApril 18-19, 2005

ccd module• Support for area detectors (CCD’s and image plates)• Supported devices

– MAR 165 CCD

– MAR 345 image-plate reader

– Roper (all WinView-supported CCD’s, including former Princeton and most former Photometrics devices)

– Bruker SMART CCD

• Can control, at minimum– exposure time

– file name

– data-acquisition start

– wait for acquisition to complete

– much more for most devices

• Details in talk tomorrow

Page 30: Using EPICS for Beamline Control and Data Acquisition

GeoSoilEnviroCARS Australian Synchrotron Beamline Control WorkshopApril 18-19, 2005

dac128V module• device support, database, and MEDM displays for dac128V

IndustryPack module– 8-channel, 12-bit DAC– Support exists to run a DAC channel manually, or according to an

algorithm written at run time, or as a scan positioner, or as part of a PID feedback loop.

• Good model for D/A converter support, even if you use different hardware

Page 31: Using EPICS for Beamline Control and Data Acquisition

GeoSoilEnviroCARS Australian Synchrotron Beamline Control WorkshopApril 18-19, 2005

dxp module

• record, device support, databases, and MEDM displays for XIA DXP and Saturn spectroscopy systems

• dxp record for setting DXP parameters

• device support for the mca record

• More details in talk tomorrow

Page 32: Using EPICS for Beamline Control and Data Acquisition

GeoSoilEnviroCARS Australian Synchrotron Beamline Control WorkshopApril 18-19, 2005

ip module• device support, SNL code, databases, and MEDM displays for many message-

based devices• Supports lots of benchtop RS-232/GPIB instruments, e.g.

– Keithley multimeters– Stanford Research Systems current amplifiers– MKS ion gauge controllers– Physical Instruments ion pump controllers, TSPs– Lakeshore temperature controllers– …

• deviceCmdReply– Used to write support at run time for one command/reply message– sCalcout to format output string– asyn record to write/read device– sCalcout record to parse reply

• devXxStrParm device support– Generic support for many record types (ai, ao, bi, bo, etc.) with message based

devices

Page 33: Using EPICS for Beamline Control and Data Acquisition

GeoSoilEnviroCARS Australian Synchrotron Beamline Control WorkshopApril 18-19, 2005

ip330 module• device support, databases, and MEDM displays for the IP330 ADC

IndustryPack module

• 16/32 channel, 16-bit ADC

– ip330Scan for periodic, averaged reads of ADC channels– ip330Sweep, with the MCA record, for using ip330 as a waveform-digitizer– ip330PID for using the ip330 in a fast-feedback loop

• Good model for A/D converter support, even if you use different hardware

Page 34: Using EPICS for Beamline Control and Data Acquisition

GeoSoilEnviroCARS Australian Synchrotron Beamline Control WorkshopApril 18-19, 2005

ipUnidig module

• device support, databases, and MEDM displays for the IPUnidig digital I/O IndustryPack module

• Interrupt can call any driver, which is useful for devices that do not have interrupts themselves

• Good model for digital I/O modules, even if you use different hardware

Page 35: Using EPICS for Beamline Control and Data Acquisition

GeoSoilEnviroCARS Australian Synchrotron Beamline Control WorkshopApril 18-19, 2005

mca module• Support for multichannel analyzers, multichannel scalers, and

other array-valued detectors

• mca record

• device support– Canberra 556 AIM module (MCA and ICB controller)

– DSA-2000 Ethernet MCA

– various Canberra-ICB modules for spectroscopy

– SIS 3801 (Struck STR7201) MCS

– (DXP support in dxp module)

– (IP330 support in ip330 module)

– (quadEM support in quadEM module)

• More details in talk tomorrow

Page 36: Using EPICS for Beamline Control and Data Acquisition

GeoSoilEnviroCARS Australian Synchrotron Beamline Control WorkshopApril 18-19, 2005

motor module• Motor record and device support

• Motors are the single most important component of beamline control

• Provides:– stepper and servo motors

• VME, CAMAC, RS-232, GPIB, Ethernet controllers• More than 20 types at present

– soft-motor support• Put motor “face” on, e.g., a DAC channel• Drive a hard motor through a nonlinear transform of 1 or more real motors

– user/dial/raw coordinates

– backlash-takeout algorithm

– pre/post move commands

– many more features

Page 37: Using EPICS for Beamline Control and Data Acquisition

GeoSoilEnviroCARS Australian Synchrotron Beamline Control WorkshopApril 18-19, 2005

optics module• Slits and mirrors

– Four virtual positioners; two real motors

– Automatic sync to motor positions

– Completion reporting

• Monochromators– Nondispersive double-crystal

• Geometries: (Y1, Z2), (Y2, Z2)

• Crystal species: Si, Ge, Diamond, Si (77K)

• Miller indices, allowed reflections

• Operational modes:– Use/Set

– Manual/Auto

• Managing the vertical beam offset

• Automatic sync to motor positions

Page 38: Using EPICS for Beamline Control and Data Acquisition

GeoSoilEnviroCARS Australian Synchrotron Beamline Control WorkshopApril 18-19, 2005

…optics module• …Monochromators

– Spherical grating• Geometrical variables:

– 1) Grating line density; radius

– 2) Tangent-arm length

– 3) Diffraction order

– 4) Input/output slit distances

• Operational modes:– Use/Set

– Manual/Auto

• Grating-stripe list

• Manual sync to motor positions

Page 39: Using EPICS for Beamline Control and Data Acquisition

GeoSoilEnviroCARS Australian Synchrotron Beamline Control WorkshopApril 18-19, 2005

…optics module• Optical table

– Table record supports a six-degree-of-freedom optical table.

– User/client can write either to (x, y, z, X, Y, Z), or to underlying motor records.

– Table rotates about user-specified point.

– Table database includes a list of rotation points, selected by menu.

– Can recover table position from motor positions

– Partial support for fewer than six degrees of freedom

Page 40: Using EPICS for Beamline Control and Data Acquisition

GeoSoilEnviroCARS Australian Synchrotron Beamline Control WorkshopApril 18-19, 2005

…optics module• Optical table

– Geometries• SRI

• GeoCARS

• Newport

• PNCSRI GEOCARS PNC NEWPORT

- Calibration/sync- Use/Set – changes to [X, Y, ..]. move table / change calibration- Zero – redefine current [X, Y, …] as zero- Sync – update [X, Y, …] from motors, honoring calibration- Init – clear calibration and sync to motors

- Table record sets motor speeds so that motors start/stop together.

Page 41: Using EPICS for Beamline Control and Data Acquisition

GeoSoilEnviroCARS Australian Synchrotron Beamline Control WorkshopApril 18-19, 2005

sscan module• Support for user-programmable data-acquisition

– sscan and busy records

– saveData

– recDynLink

• A one-dimensional scan:– Do NPTS times:

• Set conditions e.g., move motors; wait for completion

• Trigger detectors e.g., start scaler; wait for completion

• Acquire data read detector signals; store in arrays

– Write data to NFS file

• Multidimensional scan:– Same as a 1-D, but detector trigger executes inner-loop scan.

– saveData monitors a set of sscan records, determines scan dimension when scan starts, and writes data as it is acquired.

Page 42: Using EPICS for Beamline Control and Data Acquisition

GeoSoilEnviroCARS Australian Synchrotron Beamline Control WorkshopApril 18-19, 2005

sscan module

Page 43: Using EPICS for Beamline Control and Data Acquisition

GeoSoilEnviroCARS Australian Synchrotron Beamline Control WorkshopApril 18-19, 2005

...sscan module• scan features:

– Three 1-D scan types: constant-step-size, table-driven, fly

– Unlimited number of data points, scan dimensions

– 0-4 positioners, 0-4 detector triggers, 0-70 detector signals

– Acquisition from scalar and 1-D-array-valued PV's

– Detector/client wait, data-storage wait

– Pause/resume, abort

– Double buffered: can write 1-D acquired data during next 1-D scan

– saveData writes self-describing XDR-format (“.mda") files to NFS-mounted disk (vxWorks only, at present).

– A positioner can have private scan parameters (scanparm record).

– After-scan actions include move to peak, valley, and edge.

– scanparm record + after-scan action = automated 1-D alignment, so you can easily implement an “Align” button.

Page 44: Using EPICS for Beamline Control and Data Acquisition

GeoSoilEnviroCARS Australian Synchrotron Beamline Control WorkshopApril 18-19, 2005

…sscan module• The sscan record

– performs 1-D scan

– before-scan link – optional completion callback

– positioner: any writable, numeric, scalar PV (menus, enums are ok)

– detector trigger: any writable, numeric, scalar PV

– detector signal: any readable, numeric, scalar or 1D array PV

– array detectors: exactly <scanRecord>.NPTS elements are acquired

– array trigger: callback indicates array data are ready to read

– after-scan link – optional completion callback

– pause/resume

– abort (<scanRecord>.EXSC -> 0) wait for callbacks, cleanup

– kill (two aborts in a row) abandon callbacks

– handshake with multiple display / data-acquisition clients

– handshake with data-storage client

Page 45: Using EPICS for Beamline Control and Data Acquisition

GeoSoilEnviroCARS Australian Synchrotron Beamline Control WorkshopApril 18-19, 2005

Other data-acquisition-related software• Data-visualization tools for use with synApps

– Run-time look at scan data

– Offline tools for data-file manipulation

– Supports 1-3 dimensional data

– Distributed independently of ioc software

– See lecture “Data Visualization.”

• CCD data-acquisition tools1) CCD module (see lecture “Detectors and Feedback”)

2) Portable CA Server based CCD support, and related software• http://www.aps.anl.gov/aod/bcda/dataAcq/index.php

– Both of these solutions allow an EPICS CA client to drive data acquisition.

– Both support ca_put_callback(), as required by the sscan record.

Page 46: Using EPICS for Beamline Control and Data Acquisition

GeoSoilEnviroCARS Australian Synchrotron Beamline Control WorkshopApril 18-19, 2005

std module• Epid record

– Extended PID record – more details tomorrow

• Scaler record– Controls a set of counters with a common clock, gate, and trigger

• String-sequence record– Like the seq record in base, but works for strings and numbers

– Can choose to wait for completion after each step in sequence

• Soft-motor database– Run-time programmable soft-motor/transform/hard-motor database

– Quick solution for driving a motor through a nonlinear transform

• Timestamp record [SLAC]– needed by SNS’ vxStats; currently not available in a module

• 4-step database– Up to four steps of (set condition; read data) with an end calculation

– Originally developed for dichroism experiments

Page 47: Using EPICS for Beamline Control and Data Acquisition

GeoSoilEnviroCARS Australian Synchrotron Beamline Control WorkshopApril 18-19, 2005

vme module• VME record

– Provides run-time access to VME bus

– Great for testing hardware

– Run-time programmed control of an unsupported VME board

• Device support for VME hardware, includes:– Joerger scaler

– APS bunch-clock generator

– APS machine-status interface

– Heidenhain encoder interpolator

– Generic A32 VME interface

– HP Laser interferometer

– VMI4116 16-bit DAC

– Acromag 9440 16-bit digital input

Page 48: Using EPICS for Beamline Control and Data Acquisition

GeoSoilEnviroCARS Australian Synchrotron Beamline Control WorkshopApril 18-19, 2005

xxx module• Prototype user directory

– Builds everything in synApps into a load module

– Contains command files to load/configure everything in synApps

– Contains sample top-level MEDM-display file

– Contains sample script to set environment variables and start up the sample user interface

– Contains table of recommended address/interrupt configuration for selected VME and IndustryPack hardware

• Two ways to use this module1) Make copies; run changePrefix; build; customize; run a beamline

- this is the recommended use

- detailed instructions in support/documentation

2) Reference/grab bag

Page 49: Using EPICS for Beamline Control and Data Acquisition

GeoSoilEnviroCARS Australian Synchrotron Beamline Control WorkshopApril 18-19, 2005

A Couple of Anecdotes

Single-crystal energy dispersive diffraction at high pressure

• Good programmer, EPICS novice, IDL novice

• Wanted to write code to collect single-crystal Laue diffraction with area detector, then rotate sample to put Laue spots into energy-dispersive detector

• Got job done in weeks, amazed how easy to move motors, trigger CCD detector, read energy-dispersive detector MCA spectrum. He could concentrate on scientific problem

• It runs at APS and at NSLS, since they both use EPICS, motor record, mca record

Page 50: Using EPICS for Beamline Control and Data Acquisition

GeoSoilEnviroCARS Australian Synchrotron Beamline Control WorkshopApril 18-19, 2005

A Couple of Anecdotes

Stress/strain measurements at high-pressure

• Novice programmer, EPICS novice

• Wanted to script a common operation that was keeping users at beamline overnight

• Remove slits, install imaging CCD detector, take strain CCD image

• Install slits, remove imaging CCD detector, take diffraction CCD pattern with diffractio CCD detector

• Repeat above hundreds of times

• Got job done in an hour, amazed how easy to move motors, trigger CCD detectors, saving data to user-specified file names, etc.

Page 51: Using EPICS for Beamline Control and Data Acquisition

GeoSoilEnviroCARS Australian Synchrotron Beamline Control WorkshopApril 18-19, 2005

Some Advice

• Put the functionality in the server, resist the temptation to put it in the client if possible– Then any client can use it, not just your favorite client du

jour

• Purchase devices that already have support if they will meet the need. Resist temptation to save a few $$ on hardware if it means debugging a new device.– Check on [email protected] to see if the work has

already been done

Page 52: Using EPICS for Beamline Control and Data Acquisition

GeoSoilEnviroCARS Australian Synchrotron Beamline Control WorkshopApril 18-19, 2005

Quick Summary of EPICS for BCDAAdvantages

DistributedMany workstations can talk to the same IOC and devices

Scales wellAs one CPU gets overloaded or IOC gets full, add another.

Share development with other beamline groups

Good tools for creating operator interfaces (MEDM) with no programming

Time-critical code (e.g. feedback) can run in IOC

Can run many applications (IDL, SPEC, SMART, Visual Basic) to talk to IOCs.Choose the best application for the task

Can get quick-start using synApps

DisadvantagesRelatively complex


Recommended