Skip to main content Link Search Menu Expand Document (external link)

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:

  • send a positioner to some position, and wait for it to arrive
  • trigger a detector, and wait for it to finish acquiring
  • read and store data from the positioner and detector
  • repeat

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.


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: 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.

Note: In the Access column above:

  • R | Read only |
  • R/W | Read and write are allowed |
  • N | No access allowed |

a channel-access write triggers record processing if the record’s SCAN field is set to “Passive.”


Fields involved in sending information out

Value Field Type Output Link Typical Target Field Purpose
PRE DBF_SHORT OPRE .CMND clear old positioner configuration
SM DBF_MENU(sscanP1SM) OSM .P1SM positioner scan mode (e.g., linear, table, fly)
AR DBF_MENU(sscanP1AR) OAR .P1AR positioner absolute/relative
AFT DBF_MENU(sscanPASM) OAFT .PASM positioner after-scan mode (e.g., stay, go to start pos,…)
PPV DBF_STRING OPPV .P1PV positioner drive PV name
RPV DBF_STRING ORPV .R1PV positioner readback PV name
TPV DBF_STRING OTPV .T1PV detector-trigger PV name
DPV DBF_STRING ODPV .D01PV detector PV name
SP DBF_DOUBLE OSP .P1SP positioner start point
EP DBF_DOUBLE OEP .P1EP positioner end point
NP DBF_LONG ONP .NPTS number of data points to acquire
SC DBF_SHORT OSC .EXSC start the scan
AQT DBF_DOUBLE OAQT .TP acquire time

Fields involved in collecting information

Input Link Value Field Typical Target Field Purpose
IMP MP .MPTS get the maximum permitted number of data points
IACT ACT .BUSY determine whether the target sscan record is active

Fields involved in managing execution.

Value field Output Link Typical Target Field Purpose
LOAD OLOAD .LOAD cause 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.
GO OGO .GO Cause 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.db database used for one-dimensional, one-positioner scans, when the sscan record and the scanparm record have the same prefix.
scanParmsRemote.db database used for one-dimensional, one-positioner scans, when the sscan record and the scanparm record have different prefixes.
scanParms2Pos.db database used for one-dimensional, two-positioner scans.
scanParms2D.db database 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. 
# 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