Table Of Contents

Previous topic

Installation Instructions for Pilatus Detectors

Next topic

Host computer support documentation

This Page

EPICS IOC support documentation

The EPICS IOC support package consists of an EPICS database, an autosave request file to support the database, an example EPICS softIOC to run the database, a MEDM screen, and some test code to demonstrate the routine operations.

goals

  • uses EPICS alarms
  • sends email whenever alarm PV changes
  • alarm PV changes based on its calculation
  • default calculation watches .SEVR of free and avail
  • trip points set by user
  • default trip points are 500 (minor) and 50 (major) MB remaining on either free or avail
  • disk PV will be reset to previous value if new value is empty or path does not exist
  • period PV will be reset if it is not a number or if it is below 1.0
  • update is forced early when certain PVs change (successfully): disk and period

database

Supports client-side software that watches disk space on a single partition and generates alarms as the free space grows small. EPICS Alarms are used to signal for attention. Client-side software will be used to send email when $(P)$(D)df:alarm changes its value. Trip points for the alarms are in .HIGH and .HIHI fields of the “ao” records.

macro parameters

macro typical value meaning
P prj: IOC prefix
D p300: specific device supported
This database can be run in an EPICS softIoc (usually for development).

See the source project for file epics/start_ioc.sh.:

softIoc -m P=prj:,D=p300: -d epicsdf.db
note:softIoc is one of the tools built in EPICS base and can be found on the path ${EPICS_BASE}/bin/${EPICS_HOST_ARCH}/softIoc

process variables

The support database creates process variables to hold various values. The waveform PVs hold string values up to 1024 characters in length.

name type meaning
$(P)$(D)df:disk waveform disk partition being watched
$(P)$(D)df:message waveform message to be sent by email
$(P)$(D)df:email_list waveform list of email addresses
$(P)$(D)df:total ao total space on the partition (MB)
$(P)$(D)df:free ao free space (MB)
$(P)$(D)df:avail ao available space
$(P)$(D)df:used ao disk space in use (computed)
$(P)$(D)df:free:pct ao percentage free space
$(P)$(D)df:used:pct ao percentage used space
$(P)$(D)df:avail:pct ao percentage available space
$(P)$(D)df:period ao time between updates (s)
$(P)$(D)df:alarm calcout calculated alarm condition

Note: To use either command line caget or caput with the waveform strings, it is necessary to use the -S option to indicate the use of a waveform string. Here are examples:

$ caget -S 15iddLAX:p100:df:disk
/mnt/data
$ caput -S 15iddLAX:p100:df:disk /
Old : 15iddLAX:p100:df:disk          /mnt/data
New : 15iddLAX:p100:df:disk          /

alarm calculation

The alarm calculation uses a calcout record. The calcout records allows the user to reprogram the behavior as desired. In the default configuration, if the value of the $(P)$(D)df:alarm PV is non-zero, then disk space is running low.

The alarm calculation watches the .SEVR field on the “free: and “avail” PVs. These PVs have alarm trip points for .LOW (minor) and .LOLO (major) alarms. By default, the trip points are set at 500 MB (minor) and 50 MB (major) space remaining with a hysteresis (.HYST) field of 5 MB. All these fields can be changed by users at run-time. Any change in either the “free: or “avail” PV will trigger a recalculation of the “alarm” PV through the forward link (.FLNK) fields of the “ao” record.

note:The present MEDM interface does not have entry boxes for changing the trip points now, nor for editing the calcout record. Changes to all these may be made from the command line through the caput command.

database fragment:

record(ao, "$(P)$(D)df:free")
{
        field(DESC, "free space")
        field(EGU,  "MB")
        field(PREC, "3")
        field(HYST, "5")
        field(LOW,  "500")
        field(LOLO, "50")
        field(LSV,  "MINOR")
        field(LLSV, "MAJOR")
        field(FLNK, "$(P)$(D)df:alarm")
}
record(ao, "$(P)$(D)df:avail")
{
        field(DESC, "available space")
        field(EGU,  "MB")
        field(PREC, "3")
        field(HYST, "5")
        field(LOW,  "500")
        field(LOLO, "50")
        field(LSV,  "MINOR")
        field(LLSV, "MAJOR")
        field(FLNK, "$(P)$(D)df:alarm")
}
record(calcout, "$(P)$(D)df:alarm")
{
        field(DESC, "any alarms will trigger this")
        field(CALC, "A>B?A:B")
        field(INPA, "$(P)$(D)df:free.SEVR  NPP NMS")
        field(INPB, "$(P)$(D)df:avail.SEVR  NPP NMS")
        field(EGU,  "boolean")
        field(HOPR, "2")
        field(HIHI, "2")
        field(HIGH, "1")
        field(HHSV, "MAJOR")
        field(HSV,  "MINOR")
}

MEDM client

The MEDM screen has been created to support the users and the code developer. It could be improved with user feedback.

The macro parameters are defined the same as for the database. The support screen is typically started with a command such as:

medm -x -macro P=15iddLAX:,D=p100: epicsdf.adl &

macro parameters

macro example value meaning
P 15iddLAX: IOC prefix
D p100: specific device supported
example MEDM screen for <tt>epicsdf</tt>