You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 25 Next »

This page describes how to set and get control system values via rudimentary AIDA command line tools.

Fetching Values: aidaget

The utility program named "aidaget" takes one mandatory argument (the name of the target), and several optional parameters control how it works.  You can specify "-help" as a parameter to see simple options.  Some of the more interesting options are specific to each data-provider, which may support optional or require mandatory paramters.

The following example retrieves history data.  It illustrates how you can specify data provider parameters (in this case STARTTIME and ENDTIME) and control output format (-format=columns -labels):

clarrieu@tersk08>aidaget HR81:CAV2:VACM//HIST.pepii -format=columns -labels \
-DSTARTTIME="02/01/2003 12:20:00" -DENDTIME="02/01/2003 12:40:00"
           d                      s           repCnt_l   unixtime
             1.93979E-9  01-Feb-2003 12:20:00         1  1044130800
              1.9181E-9  01-Feb-2003 12:20:55         0  1044130855
              1.9181E-9  01-Feb-2003 12:21:00         1  1044130860
            1.928914E-9  01-Feb-2003 12:21:18         0  1044130878
            1.928914E-9  01-Feb-2003 12:24:00         3  1044131040

As you can see, data provider parameters are specified as -Dname1=value1 -Dname2=value2.  Note the need to enclose embedded whitespace within " marks to prevent the shell from treating it as a boundary between strings.  The output format may be specified as "columns" or "rows".  The only difference is that one is a transpose of the other.  The option "-labels" indicates that the columns (or rows) should be named.  Not all data providers supply these names, in which case you'll need to consult their documentation to interpret the column numbers.

Here's a simple example that retrieves an EPICS process variable, displaying in rows format.

clarrieu@tersk08>aidaget HR81:STN:VOLT//VAL -labels -format=rows
time        06-Nov-2006 10:30:05
status                         0
severity                       0
value        0.22782705806669729

Getting BPM data:

aidaget P2BPMHER//BPMS -DBPMD=38 -DREF=0
  BPMS:PR10:6012       0.0       0.0  3128.0562           0.0        17       520
  BPMS:PR10:6022       0.0       0.0  3135.6562           0.0        17       520
  BPMS:PR10:6032       0.0       0.0   3143.256           0.0        17       520
  BPMS:PR10:6042       0.0       0.0  3150.8562           0.0        17       520
  BPMS:PR10:6052       0.0       0.0  3158.4563           0.0        17       520
  ...

Getting

Setting Value: aidaset

The utility program named "aidaset" takes at least two mandatory arguments (the name of the target and the desired value), and several optional parameters control how it operates.

By convention, an AIDA data provider that supports setting values will accept either a single scalar or vector value, or a list of named scalar or vector values.  The EPICS channel access data provider is of the former sort, and the SLC Magnet server is of the latter.

NB: Presently, only the EPICS Channel Access data provider supports this tool.  This is because it's the only data provider that knows how to convert the string you provide on the command-line into a value of the type appropriate for the underlying system.

An example of setting a scalar EPICS process variable:

aidaset HR81:STN:VOLT//VAL 0.227

And an example of setting a corrector via the Magnet server (*NOTE: need to mod magnet server to use DaValue conversions):

aidaset MAGNETSET//BDES -DMAGFUNC=TRIM /XCOR:LI31:41 4.0

In the EPICS channel access example, we set a single unnamed value.  In the magnet example, we set a single named value.  As you can see, value names are indicated as /NAME. 

Vector elements my be listed sequentially with whitespace separators as in the following contrived example:

aidaset MY:VECTOR//VAL 1 2 3 4 5 6 7 8 9 10

And finally a contrived example illustrating how a data provider that accepts multiple named vector values per set might look:

aidaset MY:NAMED:VECTORS//VAL /SILLYNAME 0 1 2 3 4 5 /ANOTHERNAME 6 7 8 9 10
  • No labels