Scanparm Record and related software

Tim Mooney

Contents

Overview

This documentation describes the EPICS scanparm record, and related EPICS software required to build and use it. This version of the record is compatible with EPICS 3.14.8.2, and is incompatible with any 3.13.x version of EPICS.

The scanparm record stores parameters intended to be written to the EPICS sscan record, and provides the EPICS end user with a convenient way to load those parameters into the sscan record and cause the sscan record to perform a scan. The idea is to allow the user to configure and execute a predefined scan with a single mouse click.

By the way, the word scan, in EPICS, normally refers to the execution of a record, and particularly to the method by which a record is selected for execution. In this documentation, scan will never have that meaning. Here, a scan is what the sscan record does:

For more about scans, see the sscan record documentation.

In the simplest and most common use, a scanparm record is associated at boot time with a particular positioner (e.g., a motor) and targeted to configure and run a particular sscan record. At run time, the user typically will write start and end positions, and the number of data points to be acquired, to a scanparm record, and from then on can run that scan with a single write to the scanparm record. It is possible to have more than one scanparm record associated with a positioner, and it is possible to gang scanparm records together into a database that stores parameters for scans involving more than one positioner, and more than one sscan record.

The scanparm record contains sets of paired fields for parameters it writes, for parameters it reads, and for commands it receives from the user and may forward to another record.

Field Descriptions

In addition to fields common to all record types (see the EPICS Record Reference Manual for these) the scanparm record has the fields described below.


Alphabetical list of record-specific fields

NOTE: Hot links in this table take you only to the section in which the linked item is described in detail. You'll probably have to scroll down to find the actual item.
Name Type DCT prompt Access DCT
ACT DBF_SHORT ScanActive R No
AFT DBF_MENU(sscanPASM) After R/W Yes
AR DBF_MENU(sscanP1AR) absRel R/W Yes
AQT DBF_DOUBLE Acquire time R/W* Yes
DPV DBF_STRING DetPVName R/W Yes
EP DBF_DOUBLE EndPos R/W* Yes
GO DBF_SHORT Go R/W* Yes
IACT DBF_INLINK InLink R Yes
IMP DBF_INLINK MP InLink R Yes
LOAD DBF_SHORT Load R/W* Yes
LSTP DBF_DOUBLE Last stepSize R No
MP DBF_LONG MaxPts R No
NP DBF_LONG nPts R/W* Yes
OAFT DBF_OUTLINK AFT OutLink R Yes
OAQT DBF_OUTLINK AQT OutLink R Yes
OAR DBF_OUTLINK AR OutLink R Yes
ODPV DBF_OUTLINK D1PV OutLink R Yes
OEP DBF_OUTLINK EP OutLink R Yes
OGO DBF_OUTLINK GO OutLink R Yes
OLOAD DBF_OUTLINK LOAD OutLink R Yes
ONP DBF_OUTLINK NP OutLink R Yes
OPPV DBF_OUTLINK P1PV OutLink R Yes
OPRE DBF_OUTLINK PRE-write OutLink R Yes
ORPV DBF_OUTLINK R1PV OutLink R Yes
OSC DBF_OUTLINK SC OutLink R Yes
OSM DBF_OUTLINK SM OutLink R Yes
OSP DBF_OUTLINK SP OutLink R Yes
OTPV DBF_OUTLINK T1PV OutLink R Yes
PPV DBF_STRING PositionerPVName R/W Yes
PRE DBF_SHORT PRE-write command R/W* Yes
PREC DBF_SHORT Display Precision R/W Yes
RPV DBF_STRING ReadbackPVName R/W Yes
SC DBF_SHORT StartCmd R/W Yes
SM DBF_MENU(sscanP1SM) StepMode R/W Yes
SP DBF_DOUBLE StartPos R/W* Yes
STEP DBF_DOUBLE StepSize R No
TPV DBF_STRING TrigPVName R/W Yes
VAL DBF_DOUBLE Result R No
VERS DBF_FLOAT Code Version R No
Note: In the Access column above:
R Read only
R/W Read and write are allowed
R/W* Read and write are allowed; a channel-access write triggers record processing if the record's SCAN field is set to "Passive."
N No access allowed

Fields involved in sending information out
value fieldtypeoutput linktypical target fieldpurpose
PREDBF_SHORTOPRE<sscan>.CMNDclear old positioner configuration
SMDBF_MENU(sscanP1SM)OSM<sscan>.P1SMpositioner scan mode (e.g., linear, table, fly)
ARDBF_MENU(sscanP1AR)OAR<sscan>.P1ARpositioner absolute/relative
AFTDBF_MENU(sscanPASM)OAFT<sscan>.PASMpositioner after-scan mode (e.g., stay, go to start pos,...)
PPVDBF_STRINGOPPV<sscan>.P1PVpositioner drive PV name
RPVDBF_STRINGORPV<sscan>.R1PVpositioner readback PV name
TPVDBF_STRINGOTPV<sscan>.T1PVdetector-trigger PV name
DPVDBF_STRINGODPV<sscan>.D01PVdetector PV name
SPDBF_DOUBLEOSP<sscan>.P1SPpositioner start point
EPDBF_DOUBLEOEP<sscan>.P1EPpositioner end point
NPDBF_LONGONP<sscan>.NPTSnumber of data points to acquire
SCDBF_SHORTOSC<sscan>.EXSCstart the scan
AQTDBF_DOUBLEOAQT<scaler>.TPacquire time


Fields involved in collecting information
input linkvalue fieldtypical target fieldpurpose
IMPMP<sscan>.MPTSget the maximum permitted number of data points
IACTACT<sscan>.BUSYdetermine whether the target sscan record is active


Fields involved in managing execution.
value fieldoutput linktypical target fieldpurpose
LOADOLOAD<scanparm>.LOADcause the scanparm record to write parameters to the sscan record. If more than one scanparm record is needed to define a scan (e.g., for a multi-positioner scan, or a multi-dimensional scan), the OLOAD field should link to the next scanparm record.
GOOGO<scanparm>.GOCause the scanparm record to write parameters to the sscan record and also cause the sscan record to begin the scan. If more than one scanparm record is needed to define a scan (e.g., for a multi-positioner scan, or a multi-dimensional scan), the OGO field should link to the next scanparm record, and the last scanparm record to execute should use its OGO link to cause its sscan record to start scanning.


Files

The following table briefly describes the files required to implement and use the scanparm record.

SOURCE CODE
scanparmRecord.c Record support for the scanparm record
scanparmRecord.dbd This file defines all of the fields menus, etc. for the scanparm record.

DATABASE and AUTOSAVE-REQUEST FILES
scanParms.dbdatabase used for one-dimensional, one-positioner scans, when the sscan record and the scanparm record have the same prefix.
scanParmsRemote.dbdatabase used for one-dimensional, one-positioner scans, when the sscan record and the scanparm record have different prefixes.
scanParms2Pos.dbdatabase used for one-dimensional, two-positioner scans.
scanParms2D.dbdatabase used for two-dimensional scans.

MEDM DISPLAY FILES
scanParms.adl
scanParmsRemote.adl
scanParmsCustom.adl
scanParms2Pos.adl
scanParms2D.adl
These files build medm screens to access the scanparm record and related process variables. To use one of them from the command line, type, for example
medm -x -macro "P=xxx:,Q=m1,PV=m1" scanParms.adl
medm -x -macro "P=xxx:,Q=yyy:m1,PV=yyy:m1" scanParmsRemote.adl
medm -x -macro "P=xxx:,Q=m1,EGU=,NAME=,DESC=" scanParmsCustom.adl
medm -x -macro "P=xxx:,Q=device,PV1=xxx:m1,PV2=xxx:m2,SCAN=yyy:scan1" scanParms2Pos.adl
medm -x -macro "P=xxx:,Q=device,DESC=,EGU1=,NAME1=,EGU2=,NAME2=" scanParms2D.adl

EPICS STARTUP FILE
st.cmd Startup script
This file is not included in the distribution. Here are annotated excerpts from a startup file that supports scanparms:
#######################################################################
# vxWorks startup script to load and execute system (iocCore) software.
scanparm-related databases
# Tell EPICS all about the record types, device-support modules, drivers,
# etc. in the software we just loaded (xxxApp)
dbLoadDatabase("dbd/xxxApp.dbd")

dbLoadTemplate("scanParms.substitutions")



AUTOSAVE REQUEST FILE
scanParms_Settings.req sample request file to be included in auto_settings.req to save the user modifiable settings of one scanParms.db database. To use this, add a line of the following form in auto_settings.req for each scanParms database:

file scanParms_settings.req P=xxx: M=m1


Restrictions

Suggestions and comments to:
Tim Mooney : (mooney@aps.anl.gov)
Last modified: December 11, 2007