transporting values together with additional attributes, similar to EPICS records, via the transport mechanisms of
should be able to be accessed from EPICS via an extension to the above mentioned original interface.
.
Please describe here the task of those structures, and the mapping of their values (types) and attributes to the EPICS records
rate meter
Here is definition of structure for ratemeter (from $DABCSYS/base/dabc/records.h
);
typedef struct{
float value;
int displaymode; // one of the DISPLAY_x
float lower; // limit. If limits are equal, use autoscale
float upper; // limit
float alarmlower; // alarm
float alarmupper; // alarm
char color[16]; // (color name: Red, Green, Blue, Cyan, Yellow, Magenta)
char alarmcolor[16]; // (color name: Red, Green, Blue, Cyan, Yellow, Magenta)
char units[16];
} RateRec;
enum RateDisplayMode {
DISPLAY_ARC = 0,
DISPLAY_BAR = 1,
DISPLAY_TREND = 2,
DISPLAY_STAT = 3 };
extern const char* RateRecDesc;
with the RateRecDesc
defining the DIM structure like this:
const char* dabc::RateRecDesc = "F:1;L:1;F:1;F:1;F:1;F:1;C:16;C:16;C:16";
The RateDisplayMode
is a hint how the ratemter should be displayed on GUI (tachometer, bar, trending or statistic histogram). Can be neglected though.
Suggestion for mapping the structure elements to attributes of EPICS ai:
structure.element |
EPICS - Attribute |
RateRec.value |
VAL |
RateRec.lower |
LOPR |
RateRec.upper |
HOPR |
RateRec.alarmlower |
LOW |
RateRec.alarmupper |
HIGH |
RateRec.units |
EGU |
"DIMinfo name" |
NAME |
name is the record name to be defined in the database |
-- JoernAdamczewski - 05 May 2010
state
Here is definition of structure for state (from $DABCSYS/base/dabc/records.h
);
typedef struct{
int severity; // (0=success, 1=warning, 2=error, 3=fatal)
char color[16]; // (color name: Red, Green, Blue, Cyan, Yellow, Magenta)
char status[16]; // status name
} StatusRec;
extern const char* StatusRecDesc;
with the StatusRecDesc
defining the DIM structure like this:
const char* dabc::StatusRecDesc = "L:1;C:16;C:16";
The color names are currently defined by
const char* dabc::col_Red = "Red";
const char* dabc::col_Green = "Green";
const char* dabc::col_Blue = "Blue";
const char* dabc::col_Cyan = "Cyan";
const char* dabc::col_Yellow = "Yellow";
const char* dabc::col_Magenta = "Magenta";
The possible state names appear in field status[]
and are declared as string constants in dabc/Manager.h
and have currently following values:
const char* dabc::Manager::stNull = "Null";
const char* dabc::Manager::stHalted = "Halted";
const char* dabc::Manager::stConfigured = "Configured";
const char* dabc::Manager::stReady = "Ready";
const char* dabc::Manager::stRunning = "Running";
const char* dabc::Manager::stFailure = "Failure";
const char* dabc::Manager::stError = "Error";
Mapping to a EPICS mbbi could be achieved by assigning these state names to fields ZRST-FFST which should map input string from StatusRec.status
to one of 16 possible states?
The EPICS VAL field would then take a corresponding enumeration value.
Fields severity
and color
could be neglected at first.
Note that for each DABC node, the name of the DIM service indicating the FSM state is defined by string "RunState" (with the node name prefix in front).
-- JoernAdamczewski - 05 May 2010
info message
This can be used to display for each node the last current status, or to write the infos into a log file or text list field.
Here is definition of structure for info message (from $DABCSYS/base/dabc/records.h
);
typedef struct{
int verbose; //(0=Plain text, 1=Node:text)
char color[16]; //(Red, Green, Blue, Cyan, Magenta, Yellow)
char info[128]; // info message
} InfoRec;
extern const char* InfoRecDesc;
with DIM structure descriptor
const char* dabc::InfoRecDesc = "L:1;C:16;C:128";;
Could be probably mapped to a EPICS stringin like this:
structure.element |
EPICS - Attribute |
InfoRec.info |
VAL |
InfoRec.color |
"Green"=info, "Yellow"=warning, "Red"=error |
InfoRec.verbose |
neglectable |
"DIMinfo name" |
NAME |
name is the record name to be defined in the database |
Apart from the DABC structure fields, the DIM "quality" word is used in DABC for additional information. The bytes of this word have following meanings:
mode-visibility-type-status
(from msb to lsb). Functions for evaluating these properties can be found in $DABCSYS/controls/dimcontrol/src/nameParser.cxx
.
Especially the type field can be used to identify record (apart from the DIM service structure string); following DABC types exist (from nameParser.h
):
enum recordtype {
ATOMIC = 0,
GENERIC = 1,
STATUS = 2,
RATE = 3,
HISTOGRAM = 4,
MODULE = 5,
PORT = 6,
DEVICE = 7,
QUEUE = 8,
COMMANDDESC = 9,
INFO = 10
};
For EPICS use case, the types ATOMIC
(simple string, integer, double); RATE
(rate meter); STATUS
(FSM state); and INFO
(string message for logfile) are interesting.
The visibility byte uses bit flags to indicate certain GUI operation modes:
#define DABC_VIS_VISIBLE (1<<0) //VISIBLE
#define DABC_VIS_MONITOR (1<<1) //MONITOR
#define DABC_VIS_CHANGABLE (1<<2)//CHANGEABLE
#define DABC_VIS_IMPORTANT (1<<3) //IMPORTANT
#define DABC_VIS_LOGGABLE (1<<4) //write to log window
Currently used are DABC_VIS_LOGGABLE
(write info record string to a logfile, or not) and DABC_VIS_CHANGABLE
(indicate that this atomic parameter may be changed by command).
The status byte may contain information for log messages like:
enum recordstat{
NOTSPEC = 0,
SUCCESS = 1,
MESSAGE = 2,
WARNING = 3,
ERR = 4,
FATAL = 5
};
Value message, warning, error could be expressed as alarm colors? This is additional possibility for InfoRec
apart from mapping the color names.
-- JoernAdamczewski - 05 May 2010
-- PeterZumbruch - 27 May 2010
DABC uses separate DIM commands without parameters for this which are identified by these Names (note that each DIM command has name prefix which identifies the target node for command!)
Exact list of example services/commands to be delivered soon.