areaDetector Plugin NDPluginAttribute

March, 2014

Matt Pearson

Oak Ridge National Lab

Contents

Overview

This plugin provides the ability to extract an NDArray attribute and publish the value over channel access. It also publishes an array of the attribute value, and the integrated value.

NDPluginAttribute inherits from NDPluginDriver.

NDPluginAttribute defines the following parameters. It also implements all of the standard plugin parameters from NDPluginDriver . The EPICS database NDAttribute.template provides access to these parameters, listed in the following table.

Parameter Definitions in NDPluginAttribute.h and EPICS Record Definitions in NDAttribute.template
Parameter index variable asyn interface Access Description drvInfo string EPICS record name EPICS record type
NDPluginAttributeArray asynFloat64Array r/o Attribute data as a 1-D array, possibly converted in data type from that in the NDArray object to the specific asyn interface. ATTR_ARRAY $(P)$(R)ArrayData_RBV waveform
NDPluginAttributeAttrName asynOctet r/w The name of the NDAttribute parameter that we want to publish. This can be modified at runtime. ATTR_ATTRNAME $(P)$(R)AttrName
$(P)$(R)AttrName_RBV
waveform
NDPluginAttributeUpdatePeriod asynFloat64 r/w Update period for the array data (in seconds). ATTR_UPDATE_PERIOD $(P)$(R)UpdatePeriod
$(P)$(R)UpdatePeriod_RBV
ao
ai
NDPluginAttributeVal asynFloat64 r/o Attribute value ATTR_VAL $(P)$(R)Value_RBV ai
NDPluginAttributeValSum asynFloat64 r/o Sum of the attribute value, since the last reset. ATTR_VAL_SUM $(P)$(R)ValueSum_RBV ai
NDPluginAttributeReset asynInt32 r/w Reset the plugin data. This zeros the array, and resets the value sum and value to zero. This will also automatically reset the plugin ArrayCounter. ATTR_RESET $(P)$(R)Reset bo
NDPluginAttributeUpdate asynInt32 r/w Update the array with the latest attribute values collected by the plugin. This may be necessary at the end of an acqusition if the update period is none zero, in order to take into account the last few data points that may have arried since the last callback to the plugin. ATTR_UPDATE $(P)$(R)Update bo

If the array data contains more than 16,000 bytes then in order for EPICS clients to receive this data they must be built with EPICS R3.14 (not R3.13), and the environment variable EPICS_CA_MAX_ARRAY_BYTES on both the EPICS IOC computer and EPICS client computer must be set to a value at least as large as the array size in bytes.

Configuration

The NDPluginAttribute plugin is created with the NDAttrConfigure command, either from C/C++ or from the EPICS IOC shell.

NDAttrConfigure(const char *portName, int queueSize, int blockingCallbacks, 
                      const char *NDArrayPort, int NDArrayAddr, int maxBuffers,  
                      size_t maxMemory, int priority, int stackSize, int maxTimeSeries,
                      const char * attributeName)
  

All but the last two arguments are common to all plugins. The last two are:
int maxTimeSeries - The maximum size of the array that will be used for the waveform data (eg. 4096)
const char * attributeName - The name of the NDAttribute parameter. This must be contained in the NDAttributeList in the NDArray objects that are processed by the plugin.

Notes