# Presentation: 285881

## “Recent” developments in EPICS-based beamline software

- 7/24/02
- Tim Mooney
- Beamline Controls & Data Acquisition Group
- Advanced Photon Source
- Argonne National Laboratory

## Autosave/restore(www.aps.anl.gov/xfd/SoftDist/swBCDA/autoSaveRestore_3.13.5.tar.gz)

- PPC compatible
- Include files
- Macro substitution
- Specify restore files
- Select directories for save files, request files
- Dated boot backup
- Reload request files
- Manual save/restore works

*Almost* backward compatible
- Request-file excerpt:
-    # comment
-    xxx:m1.DESC # comment
-    file myfile.req P=xxx:,M=m2
-    ...
- Include-file excerpt:
-    $(P)$(M).VAL
-    $(P)$(M).EGU
-    file nested.req P=$(P),Q=abc
-       ...

## saveData v1.13

- PPC compatible (EPICS >3.13.5)
- Misc. bug fixes (stack size, trigger-PV field name, save-every-point fixed, string term.)
- PC/Mac friendly file names, e.g.
-        xxx_scan2_nnnn.mda

## transformRecord v5.5

- Test for old value failed (calc would never run) if value was NaN.
- New field IVLA: can disable calc & output while record is in alarm
- Backward compatible with everything in synApps
- Scheduled for synApps 4.5

## scalerRecord v3.12

- Hold time before autocount overwrites scaler values is adjustable in st.cmd and in vxWorks console (default is 10 sec.)
-    scaler_wait_time=10
- Guaranteed to post VAL after count has finished and all scaler counts have been posted.  (So clients know when they’ve received all the monitors they’re going to get.)

## String calculations see www.aps.anl.gov/xfd/bcda/medm_help/yysCalcoutRecord.adl.html

- Substring:
- Replace:
- Build:
- Parse:
- Select field:
- Concatenate:

- ‘abcdef’[1,3] => ‘bcd’
- ‘abcdef’[‘a’,’f’] => ‘bcde’
- ‘abcdef’{‘ab’,’XY’} => ‘XYcdef’
- printf(‘abc%.2f’,1.2) => ‘abc1.20’
- dbl(‘abc1.20’) => 1.2
- @@(0) => 0th string arg (AA)
- ‘abc’+’def’ => ‘abcdef’

## Slide 7

## Serial O/I Block

- Combination of string calc to construct output message, serial record to send and/or receive, and string calc to parse reply
- Write serial-device support at run time
- Similar GPIB support

## Optical table

- Newport (diffractometer base) geometry
- PNC geometry

## Monochromators

- Dispersive double crystal (nested, in-line)
- Spherical grating

## Miscellaneous

- Sample Wheel (scannable, sample averaging)
- 4-step measurement (scannable, for dichroism)
- Run-time table interpolation (``, feedback ctrl)
- XIA filter/shutter

## Scans

- 4 positioners, 4 detector triggers, 70 signals
- saveData client writes data to NFS-mounted disk
- Can acquire 1D arrays (e.g., save MCA spectra)
- Start/end, table, on-the-fly
- Dedicated scan and parameter sets for 1-D automated alignment

## Clients, data analysis

- scanSee (realtime display for 1D, 2D, 3D scans)
- scanBrowser (offline display of MDA files)
- NX Scan Browser (offline display of NeXus files)
- IDL classes, routines for image data (plot, fit, ROI, overlay, etc.)  **www.aps.anl.gov/~cha/Doc.html**
- PVMail (send email when PV violates limits)
- Channel Archiver

## Python

**plot.py** - 1D real-time scan-plot demonstration
**readMDA.py - **read MDA files into a structure
-    from readMDA import *
-    scan = readMDA(“xxx_scan2_0001”)
**detView.py** - display images from MDA file
-    from detView import *
-    detView(scan[2].d[1:7])

## Linux

- Working...

## Hardware

- Paddle board for use with BC-005
- OMS VME58 to StepPak transition board
- Mycom microswitch interface (DIN-rail)
- Optical isolation board for use with BC-005
- Optical limit switch display/inverter
- Step-Dir / Step-Step converter
- Acromag 9440 interface
- NEAT stage interface
- TTL to RS232 converter
- Xycom 240 -> QI 2000 adapter
- Turbo gate valve controller
- PSS remote shutter interface
- Servo amplifier for use with BC-005
- Nitrogen-distribution controller

- Picomotor connections
- Multi purpose IP to Lemo interface (DIN-rail)
- IP330 ADC interface (DIN-rail)
- IP-Unidig interface for BC-020
- IP-Systran DAC interface for BC-020
- B.O.N.E. box, for electronics prototyping
- IP330 ADC interface for BC-020 IP-Lemo system
- Xycom 240 - Mad City Labs Nano-Drive
*Soon:*
*   **Relay Module Board*
*   **VME58 front header adapter for BC-005 *
*   **VME Digital Waveform Generator*
*   **VME 26-bit histogrammer*

## Slide 17