Finding areaDetector Components

August 9, 2011

John Hammonds

Argonne National Laboratory

Overview

Since areaDetector is composed mostly of plugin components that can be rearranged in a number of different ways it can be difficult for a generic client application to know everything there is to know about the system ahead of time. It is even difficult to know ahead of time what components are installed on a particular IOC. A simple method has been developed that will allow the user to find the prefix of the EPICS records for all areaDetector compinents.

Typically each component (detectors and plugins) loads a series of database templates that are provided with areaDetector. Among these templates one will normally load ADBase.template for the detectors and NDPluginBase.template for plugins. Each of these databases loads an asyn record that allows the user to interact with the asyn nature of the plugin. This is generally used for changing the IP address of network based cameras or changing debug levels used to print information messages to the console. An info field has been added to these records to allow distinguishing it from other asyn records. ADBase.template, for instance, defines

# Set ASYN_TRACEIO_HEX bit by default
record(asyn,"$(P)$(R)AsynIO")
{
	field(PORT, $(PORT))
	field(TIB2,"1")
	info("ADType", "ADDriver")
}

The info field ADType can be used to parse the EPICS database and find the asyn records that are associated with area detector.

Use

An iocsh function parseAreaPrefixes has been added to areaDetector (located in ADApp/ADSrc) that parses through the EPICS database on a running IOC. This function identifies all of the asyn records that contain the ADType info field, parses the record name down to the channel prefix (removes AsynIO from the record above) and concatenates these prefixes into a space separated list which is then written to a waveform record. The name of the waveform record is supplied as an argument to the function.

To add this feature to a running IOC all that is necessary is to load a waveform record before iocInit and then run parseAreaPrefixes after iocInit. A database template with a waveform record is included with areaDetector.

An example of this is shown below. Before iocInit run:

# Load AreaPrefix record
dbLoadRecords("$(AREA_DETECTOR)/ADApp/Db/ADPrefixes.template", "P=$(PREFIX),R=AD:,NELEMENTS=1024")

After iocInit run

parseAreaPrefixes("simTest:AD:ChannelPrefixes.VAL")

After this the command caget on a client will yield

hammonds@jphlaptop ~/epics/base-3.14.10/bin/cygwin-x86
$ ./caget simTest:AD:ChannelPrefixes
simTest:AD:ChannelPrefixes 1024 115 's' 105 'i' 109 'm' 84 'T' 101 'e' 115 's' 116 't' 58 ':' 67 'C' 67 'C' 49 '1' 58 ':' 32 ' ' 115
 's' 105 'i' 109 'm' 84 'T' 101 'e' 115 's' 116 't' 58 ':' 67 'C' 67 'C' 50 '2' 58 ':' 32 ' ' 115 's' 105 'i' 109 'm' 84 'T' 101 'e'
 115 's' 116 't' 58 ':' 74 'J' 80 'P' 69 'E' 71 'G' 49 '1' 58 ':' 32 ' ' 115 's' 105 'i' 109 'm' 84 'T' 101 'e' 115 's' 116 't' 58 '
:' 78 'N' 101 'e' 120 'x' 117 'u' 115 's' 49 '1' 58 ':' 32 ' ' 115 's' 105 'i' 109 'm' 84 'T' 101 'e' 115 's' 116 't' 58 ':' 80 'P'
114 'r' 111 'o' 99 'c' 49 '1' 58 ':' 32 ' ' 115 's' 105 'i' 109 'm' 84 'T' 101 'e' 115 's' 116 't' 58 ':' 82 'R' 79 'O' 73 'I' 49 '1
' 58 ':' 32 ' ' 115 's' 105 'i' 109 'm' 84 'T' 101 'e' 115 's' 116 't' 58 ':' 82 'R' 79 'O' 73 'I' 50 '2' 58 ':' 32 ' ' 115 's' 105
'i' 109 'm' 84 'T' 101 'e' 115 's' 116 't' 58 ':' 82 'R' 79 'O' 73 'I' 51 '3' 58 ':' 32 ' ' 115 's' 105 'i' 109 'm' 84 'T' 101 'e' 1
15 's' 116 't' 58 ':' 82 'R' 79 'O' 73 'I' 52 '4' 58 ':' 32 ' ' 115 's' 105 'i' 109 'm' 84 'T' 101 'e' 115 's' 116 't' 58 ':' 83 'S'
 116 't' 97 'a' 116 't' 115 's' 49 '1' 58 ':' 32 ' ' 115 's' 105 'i' 109 'm' 84 'T' 101 'e' 115 's' 116 't' 58 ':' 83 'S' 116 't' 97
 'a' 116 't' 115 's' 50 '2' 58 ':' 32 ' ' 115 's' 105 'i' 109 'm' 84 'T' 101 'e' 115 's' 116 't' 58 ':' 83 'S' 116 't' 97 'a' 116 't
' 115 's' 51 '3' 58 ':' 32 ' ' 115 's' 105 'i' 109 'm' 84 'T' 101 'e' 115 's' 116 't' 58 ':' 83 'S' 116 't' 97 'a' 116 't' 115 's' 5
2 '4' 58 ':' 32 ' ' 115 's' 105 'i' 109 'm' 84 'T' 101 'e' 115 's' 116 't' 58 ':' 83 'S' 116 't' 97 'a' 116 't' 115 's' 53 '5' 58 ':
' 32 ' ' 115 's' 105 'i' 109 'm' 84 'T' 101 'e' 115 's' 116 't' 58 ':' 84 'T' 73 'I' 70 'F' 70 'F' 49 '1' 58 ':' 32 ' ' 115 's' 105
'i' 109 'm' 84 'T' 101 'e' 115 's' 116 't' 58 ':' 84 'T' 114 'r' 97 'a' 110 'n' 115 's' 49 '1' 58 ':' 32 ' ' 115 's' 105 'i' 109 'm'
 84 'T' 101 'e' 115 's' 116 't' 58 ':' 99 'c' 97 'a' 109 'm' 49 '1' 58 ':' 32 ' ' 115 's' 105 'i' 109 'm' 84 'T' 101 'e' 115 's' 116
 't' 58 ':' 105 'i' 109 'm' 97 'a' 103 'g' 101 'e' 49 '1' 58 ':' 32 ' ' 115 's' 105 'i' 109 'm' 84 'T' 101 'e' 115 's' 116 't' 58 ':
' 110 'n' 101 'e' 116 't' 67 'C' 68 'D' 70 'F' 49 '1' 58 ':' 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 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alent to the string

simTest:CC1: simTest:CC2: simTest:JPEG1: simTest:Nexus1: simTest:Proc1: simTest:ROI1: simTest:ROI2: simTest:ROI3: simTest:ROI4: simTest:Stats1: simTest:Stats2: simTest:Stats3: simTest:Stats4: simTest:Stats5: simTest:TIFF1: simTest:Trans1: simTest:cam1: simTest:image1: simTest:netCDF1: 

Knowing a little about the conventions used in the system, we now know that there are:

Armed with this information, a client application can now construct an interface to deal with these components.