The synApps std Module

Table of contents

The std module is part of the synApps suite and provides a collection of records, databases, SNL programs, device support, and utility code for EPICS IOC applications.

Dependencies

Build-time Dependencies

Module Minimum Version
EPICS Base 3.15+ (7.0+ recommended)
asyn 4.41+
sequencer 2.2.5+

Runtime Dependencies

The following modules are not required to build std, but many of the databases in std use record types from these modules:

Module Used By
calc Most databases (provides transform, sseq, scalcout, swait)
sscan trend.db, 4step.db
busy ramp_tweak.db, selector.db, timer.db, IDctrl.db
motor softMotor.db, softMotorTf.db, zero.db, zero2.db

Records

The std module provides three custom record types. See the Record Support page for an overview, or jump directly to:

Databases

PID / Feedback Control

Three databases for PID feedback at different speeds and with different hardware requirements. See the PID Feedback page for detailed documentation, comparison, and configuration examples.

Database Description
pid_control.db Standard soft-channel PID for same-IOC feedback (up to ~10 Hz)
async_pid_control.db PID with async trigger-read for cross-IOC or averaging readbacks
fast_pid_control.db Hardware-speed PID via asyn drivers (up to ~10 kHz)

Autosave: pid_control_settings.req, async_pid_control_settings.req, fast_pid_control_settings.req, epid.req

Timers & Scheduling

Three databases for time-based triggering. See the Timers & Scheduling page for detailed documentation and comparison.

Database Description
timer.db General-purpose timer with busy record and scan integration
countDownTimer.vdb Count-based up/down timer with H:M:S display
alarmClock.vdb Date/time alarm clock with range validation

Related: timeString.db provides a stringin record with Soft Timestamp device support for formatted date/time strings.

Autosave: timer.req, timer_settings.req

Motor Utilities

Two soft motor databases plus motor zeroing utilities. See the Soft Motor page for detailed documentation and comparison.

Database Description
softMotor.db Soft motor with automated link assembly from PV names
softMotorTf.db Soft motor with transform records for coordinate transforms and multi-actuator fan-out
zero.db Zeros a motor (Set mode, write 0, Use mode)
zero2.db Zeros two motors
all_com_*.db Deprecated. Use motorUtil.db from the motor module instead

Autosave: softMotor_settings.req, softMotorTf_settings.req

Shutter Control

Database Description
autoShutter.vdb Automatic shutter control based on storage ring current. See Auto Shutter
remoteShutter.db Remote shutter open/close via digital output. See Remote Shutter

Autosave: autoShutter.req, autoShutter_settings.req

Value Manipulation

Database Description
ramp_tweak.db Ramp and tweak any numeric PV with configurable step size and period. Can ramp continuously or tweak in single steps. The setup display (ramp_tweakSetup.adl) configures the target PV, step size, and dwell time. Supports ca_put_callback and autosave.
genTweak.db Simple tweak (increment/decrement) for any floating-point PV
throttle.db Instantiates a throttle record
selector.db General-purpose menu selector that writes named positions to target PVs. Supports ca_put_callback

ramp_tweak.adl ramp_tweakSetup.adl

ramp_tweak.adl, ramp_tweakSetup.adl

selector.adl selector_choice.adl selector_more.adl

selector.adl, selector_choice.adl, selector_more.adl

Autosave: ramp_tweak_settings.req, throttle.req, selector_settings.req

Data Collection

Database Description
pvHistory.db Collects values of up to 3 PVs in waveform arrays for time-based plotting. Samples every 60 seconds using an aSub record with circular buffer
recordPV.db Circular-buffer data recorder for a single PV using a compress record
trend.db Periodic data trending using sscan and swait records with configurable interval
4step.db Multi-step measurement: up to 4 steps, each of which can set positioner conditions, trigger detectors, acquire data, and calculate results. The entire 4step sequence can participate in an sscan as a detector. Originally designed for dichroism measurements.

Autosave: pvHistory.req, pvHistory_settings.req, 4step_settings.req, auto_4step_settings.req

State Management

Database Description
genericState.db Save/restore a numeric value to/from any PV via dynamically-constructed CA links
genericStrState.db Same as genericState.db but for string values
genericStateAux.db Groups up to 5-6 genericState.db instances for batch save/apply

Autosave: genericState_settings.req

Amplifier Support

Femto brand low-noise current amplifier control with two independent driver approaches (SNL-based and transform-based). See the Femto Amplifier page for models, gain tables, and substitution file examples.

Autosave: femto.req, femto_settings.req, plus model-specific .req files

Delayed Actions

The delayDo.db database and delayDo.st SNL program provide intelligent delayed-action triggering with standby, active, and waiting states. See the delayDo page for documentation and use cases.

Autosave: delayDo_settings.req

Miscellaneous

Database Description
misc.db Utility PVs: $(P)burtResult (BURT status), $(P)iso8601 and $(P)datetime (current time strings)
IDctrl.db APS insertion-device control front end with energy/gap setpoints, tweaking, and busy record
Nano2k.db Queensgate Nano2k dual-axis piezo controller via XYCOM-240 digital I/O
sampleWheel.db 4-row, 84-position sample wheel with angle/row motor control
userMbbos10.db Ten user-configurable MBBO records

Autosave: mbbo_settings.req

IOC Configuration

IOC Shell Commands

doAfterIocInit(cmd) – Stores the string cmd and executes it with iocshCmd() after iocInit completes (at initHookAfterIocRunning). This keeps database loads and their associated SNL program launches together in the startup script:

dbLoadRecords("$(CALC)/calcApp/Db/editSseq.db", "P=xxxL:,Q=ES:")
doAfterIocInit("seq &editSseq, 'P=xxxL:,Q=ES:'")

vxCall(funcName [, arg1, arg2, ...])vxWorks only. Searches the vxWorks symbol table for a function and calls it with up to 10 arguments, auto-detecting integers vs strings. Emulates the vxWorks shell from iocsh.

IOC Shell Scripts

The stdApp/iocsh/ directory contains scripts for use with iocshLoad (EPICS base 3.15+):

  • femto.iocsh – Loads femto.db and starts the femto SNL sequencer. See the Femto Amplifier page for macros.

Utility Scripts

  • showBurtDiff – csh script that diffs two BURT snapshot files, showing sorted differences.
  • wrapCmd / wrapper – Shell scripts that launch an xterm to run a command, keeping the window open for inspection.

C/C++ Source Code

Device Support

  • devTimeOfDay.c – Provides "Time of Day" (stringin) and "Sec Past Epoch" (ai) device support for current time access.
  • devVXStats.cvxWorks only. Provides ai/ao/longin device support for vxWorks system statistics (memory, CPU, file descriptors).

Header Files

  • seqPVmacros.h – Convenience macros for SNL programs: PV(), PVA(), PVAA() (declare + assign + monitor), PVPUT(), PVPUTSTR() (put with sync), DEBUG_PRINT(). Widely used across synApps SNL code.

SNL Programs

  • femto.st – Controls Femto current amplifiers via digital output bits. See Femto Amplifier.
  • delayDo.st – Intelligent delayed-action state machine. See delayDo.