EPICURE Software Release Note 69.0
Generic Status Bit Definitions
The EPICURE Data Aquisition and Control System was developed primarily on the Fermilab Research Division WARNER Local Area VAXCluster (LAVC). Therefore, when file or directory specifications, VMS command sequences, etc., are shown in this document, it is assumed that they refer to the WARNER VAXCluster environment unless context clearly indicates otherwise.
This document assumes that the reader has a working knowledge of the VAX/VMS operating system and the DCL interpreter. An understanding of the EPICURE data-aquisition system is essential to viewing generic status bits in the context of an extensible and evolving beamline control system.
There are three additional sources of information, for times when more help is necessary. Some information about the structure and syntax of module templates and device entries (MDT and DDT files, respectively) can be found in the following files:
The .CLD files above define the command-language for EPICURE device and module files. The file OAMOD_TABLES.CLD describes the syntax of MDT files, and OADEV_TABLES.CLD describes the DDT file format.EPICURE_ROOT:[WORK.ECDB.PRODUCTION.DIBS.COMMON_FILES]OAMOD_TABLES.CLD EPICURE_ROOT:[WORK.ECDB.PRODUCTION.DIBS.COMMON_FILES]OADEV_TABLES.CLD
Application programs can conveniently access generic status bits for an EPICURE device by calling the EPICURELIB scaling routines scl_is_on(), scl_is_positive(), scl_is_ramped(), scl_is_ready(), and scl_is_remote(). These routines are part of the EPICURELIB\ UTI routines for the EPICURE control system. On-line help libraries for EPICURELIB routines are kept reasonably up-to-date, and can be accessed by typing at the DCL prompt:
The same documentation is maintained in a file generated by the EPICURE document extractor application . To obtain a QUIC-format version of this document, type at the DCL prompt:$ HELP @FERMIHELP EPICURELIB
(For output, use the command XTEX with the same parameter.) Then, just copy the or file to an appropriate laser printer, bearing in mind that the document is on the order of 70 pages long!$ @TEX$:TEXV2 ! Command to set-up LaTeX $ LATEX RDCS$DOC:EPICURELIB ! Convert .TEX --> .DVI $ QTEX EPICURELIB ! Convert .DVI --> .Q (QUIC)
Also, the EPICURE consultants can advise on database formats. To obtain a list of who's who in EPICURE, type:
Please make sure that you can state your needs clearly and briefly before contacting an EPICURE consultant. VAXMail is usually the preferred method of communication.$ HELP @USERGUIDE CONSULTANTS
Finally, there are two documents that give sort of an overview of the composition and purpose of the EPICURE database. They are Creation of Initial EPICURE OA Database from EPICS and New Devices by T. Lahey and T. Fink , and EPICURE Temporary Database Builder by T. Fink . The former describes the differences between module templates and device templates. The latter document shows how one goes about building a database, something one will need to do once the central database module file MDT_FILE.TXT has been modified.
PLEASE NOTE: the present organization of the EPICURE database and the method by which database builds and modifications take place are subject to major change in the near future.
The source files for the EPICURE device database are at present the human-readable repository for database information. They are stored in EPICURE_ROOT:[WORK.DATABASE.FE]. The ``grammar'' of the EPICURE database source files is defined in the two Command Language Definition (CLD) files OAMOD.CLD and OADEV.CLD listed above, which are in turn compiled by the Command Definition Utility (CDU) into an object file readable by the Command Language Interpreter (CLI). There are two types of database source files, DDT and MDT files. MDT files define the different types of modules in the beamline systems and their default properties. DDT files consist of device entries which describe the specific properties of each of the devices in the EPICURE system.
When a database is built, these source files are compiled into three binary section files which make up the Optimized Access (OA) database by a program called COA (Create Optimized Access database). The section files for the EPICURE OA database are centrally located for the WARNER\ LAVC in EPICURE_ROOT:[WORK.DATABASE]. They are:
The OA section files are optimized for quick access, and are not designed for human-readability. Therefore, an intermediary is necessary to make the information contained in the OA database available to users. The EDBServer is a process which must be running on a system for processes on that system to access the EPICURE database. A facility of UTI routines have been written to allow application programs (and the DARSERVER) to communicate with the EDBServer. These db_... routines are in EPICURELIB and on-line help for them is available .
This is the channel for accessing database information through EPICURE at the present time. There are numerous application programs which facilitate this process, such as DBPEEKER . Numerous enhancements to the existing EPICURE database system are either planned, under development, or in test .
The standard EPICURE data-aquisition channel centers around a front-end -VAX system with custom EPICURE data-aquisition software and hardware. Application programs on experimenter nodes can obtain data from the front-ends by passing requests to the DARSERVER process on their system. Requests are passes to and from the DARSERVER by way of VMS mailboxes. The DARSERVER collates requests with appropriate database information and sends them over DECnet to the DAS_SERVER running on the appropriate front-ends. There are several documents which provide an excellent overview of the data-aquisition system. A good place to start is the EPICURE User's Guide Volume III, EPICURE Software Release Note 37.2, pub. 28 August 1989.
The property and attribute codes for the EPICURE system are defined in EPICURE_INC:DBUSER.H. This document deals almost exclusively with the STATUS property, but there are many other important properties in the control system, as well. Consult EPICURE User's Guide: Volume III, page 80 for a list of such properties.
Information about a device's status bits is stored by the database in an array of structures called BITNAMES. The BITNAMES structure is defined in the public include file EPICURE_INC:DBUSER.H. Status bit names for a device are defined in the database MDT and DDT source files. The following should serve as an example of how status bits are defined in the database files:
B_STSNAMES ! Command verb to start BITNAMES list STSNAME - ! Command verb to start BITNAMES record /BITNUMBER=0 - ! Bit offset in status data /SHORTNAME=OPEN - ! Short bit name text /LONGNAME=VALVE_OPEN - ! Long bit name text /SETTEXT=OPEN - ! ON state text /CLRTEXT=0 - ! OFF state text /SETCOLOR=0 - ! Not supported at this time /CLRCOLOR=0 ! Not supported at this time STSNAME - ! Command verb to start BITNAMES record . ! <--+ . ! |------- Another record... . ! <--+ E_STSNAMES ! Command verb to end BITNAMES list
Bit names are defined in groups of text that closely resemble records and fields. Each status bit defined has its own record, and the bit text and other data occupy the fields of the record. The command verb B_STSNAMES begins the list of status bit definitions. Each status bit definition begins with the verb STSNAME, followed by a number of qualifiers. The list is terminated with the E_STSNAMES command verb. COA assigns a BITNAMES structure from a BITNAMES array to each STSNAME ``record'' as it parses the MDT file. Note that the continuation hyphen is not included after the last qualifier in each STSNAME ``record.''
The /BITNUMBER qualifier refers to the offset of the status bit in question in the status data from the device, starting from the 0 bit.
The /SHORTNAME and /LONGNAME are short and long names, respectively, for the status bit. They are displayed in the ``extended status page'' in the PAGE application, among other places .
The /SETTEXT and /CLRTEXT define the text associated with each state of the status bit. If the hardware returns a 1, then PAGE will display the /SETTEXT string as the current ``state'' of the status bit. The same applies if the hardware returns a 0, except that PAGE will instead display the /CLRTEXT string.
The /SETCOLOR and /CLRCOLOR qualifiers are not supported at this time.
This concludes the discussion on bit names in general. It is important to distinguish between status bits and generic status bits, in order that the module templates will make some sense. Subsection introduces generic status bits.
The solution chosen by the EPICURE designers has been to create five ``generic status bits'' which are tailored for use with magnet power supplies. The text associated with these generic status bits can be changed by adding a qualifier to the database MDT file. Thus, while the default generic status bit names won't always apply to every device, it is possible to override the text associated with the generic status bits. Having five system-wide status bits allows for the creation of five scaling routines to provide transparent status bit translation for application programs.
Section will discuss how to define and use the EPICURE\ generic status bits to display important status information for beamline device on a PAGE.
The Hardware column in Table is the bit value returned from the hardware. The State column in Table is the ON/OFF state associated by default with each hardware bit value. It will be shown below how to override the default ON/OFF bit values for generic status bits.
For the default display text associated with the two states of each of the generic status bits, refer to Section and Table .
Usually, all devices of the same module type will have the same status bit definitions. If this is the case, then all one needs to do is to make a module template with the appropriate generic status bit definitions; then those definitions will serve as defaults for every device of that module type. Of course, the defaults can always be overridden by re-defining the generic status bits in the device files. In either case, the commands are basically the same. All generic status bit information is specified by qualifiers of the form:
The hyphen at the end of the command is a continuation marker. The last qualifier in a list of qualifiers should not be followed by a qualifier, or COA might get confused. Above, QUALIFIER is the name of the qualifier as defined in the CLD (``grammar'') file, and value is the string or number which the qualifier is to be ``equated'' with./QUALIFIER=value -
The format of the bit mask qualifier in the module template is as follows:
The number above is in hexadecimal, and it indicates that the RAMP bit corresponds to bit position 0. The hyphen is a continuation hyphen, telling COA that more qualifiers are to follow./RAMP_MASK=0x0001 -
The hyphen above is a continuation hyphen, telling COA that more qualifiers are to follow. The color qualifiers take a parameter list of color keywords. The interested reader should consult the CLD definition files for EPICURE module templates. Refer to Appendix for another example of how color qualifiers are specified in the module template file. Table lists the color-definition qualifiers associated with each generic status bit./REM_A=(GREEN,.) -
The format of an override text statement is as follows:
In the above example, quotes around the text string are optional, and the hyphen at the end of the statement is a continuation hyphen, telling COA that more qualifiers are to follow./ON_POLARITY_MASK="Tpa" -
Table illustrates the effect of including a generic status bit in the /S_DI_FLAGS qualifier's parameter list. The syntax of the qualifier list is the same as for most CLI parameter lists:
In the above example, bit# corresponds to the name of a generic status bit, as listed in Table . Any subset of the five generic status bit names can be included in the parameter list. Refer to Appendix for an example of how the /S_DI_FLAGS qualifier works./S_DI_FLAGS=(bit1, bit2, ..., bitn)
For the above reasons, it is frequently advantageous to build a private test database in a work directory/area separate from the [WORK.DATABASE] project area. Such a database would have only a few devices and probably only one module template record, the template that is being ``customized.'' Building a private test database permits fast rebuilds and lets one be sure that a module template won't crash COA before appending it to MDT_FILE.TXT. It is beyond the scope of this document to explain how to generate a test database, but the process is not inherently difficult. Consult EPICURE Software Release 18.0 for more specifics on running COA to make a private test database.
For more information on these and other EPICURE scaling services, consult the various sources of information listed in Subsection .
One of the best examples of the utility of generic status bits coupled with the EPICURE scaling services is in the PAGE application. Section will demonstrate how PAGE obtains and displays generic status bit data for beamline devices.
The use of the EPICURELIB scaling services to obtain generic status bit information makes messing with the status PDB more or less transparent to the application. Provided that the status bits are defined correctly in the database, an application need only obtain the raw status data and the PDB, and then call the scaling service to interpret the data. No bitwise manipulation is needed.
Those bits with a defined ``good'' state are displayed in the following way by PAGE. If a bit is ON/GOOD, then PAGE displays the text string `` in the STATUS field. If the bit is OFF/BAD, then PAGE displays the text of the bit state returned by the scaling services in the STATUS field. If the bit is undefined, the PAGE displays three blank spaces in that portion of the STATUS field.
The other two generic status bits, polarity and ramp, PAGE considers to have no defined ``good'' states. Therefore, PAGE always displays the text of the states of the polarity and ramp bits if they are defined. If the bits are undefined, then blank text is displayed, just as for the on, ready, and remote bits.
Each device has one horizontal line on the screen associated with it in PAGE. PAGE displays the STATUS field of whatever line the cursor is on in a special way. All text in the STATUS field is capitalized, and for all five bits the text of the bit states is displayed, regardless of whether the bits are ON or OFF. Table summarizes how PAGE displays generic status bit information in the STATUS field.
In Table , the column PAGE Field contains the ordering of generic status bits as they are displayed in the STATUS field in the PAGE application. For an example of how status bits are displayed on an actual ``page,'' refer to Appendix .
STATUS - /READ_PROTECT=NONE - ! Read protection for devices /CRATE=0 - ! Stub for device CAMAC crate number /SLOT=0 - ! Stub for device CAMAC slot number /CHANNEL=0 - ! Stub for device channel /NODE=0 - ! Source node /MAXSIZE=2 - ! Max request data size /DATA_SIZE=2 - ! Status data size (bytes) /SS_SUBSYS=3 - ! Subsystem number /SS_CRATE=0 - ! Subsystem crate number /SS_DEVICE=0 - ! Subsystem device number /S_DI_FLAGS=(ON,READY,REMOTE) - ! ON/OFF state inversion flag /ON_MASK=0x1000 - ! Mask for on/off bit <=======+ /OFF_MASK=0x1000 - ! Mask for on/off bit || /RDY_MASK=0x0800 - ! Mask for ready bit BIT /REM_MASK=0x0100 - ! Mask for remote bit OFFSETS /POL_MASK=0x2000 - ! Mask for polarity bit (req.) /RAMP_MASK=0x4000 - ! Mask for ramp/dc bit || /DC_MASK=0x4000 - ! Mask for ramp/dc bit <=======+ /1_ON_ON_STATE=" " - ! ON text for on/off bit <-------+ /1_OFF_ON_STATE=TPB - ! OFF text for on/off bit | /2_ON_READY_STATE=" " - ! ON text for ready bit | /2_OFF_READY_STATE=TPA - ! OFF text for ready bit OVER- /3_ON_REMOTE_STATE=" " - ! ON text for remote bit RIDE /3_OFF_REMOTE_STATE=FAL - ! OFF text for remote bit TEXT /4_ON_POLARITY_STATE=SCR - ! ON text for polarity bit | /4_OFF_POLARITY_STATE=CHP - ! OFF text for polarity bit | /5_ON_RAMP_STATE=BYP - ! ON text for ramp bit | /5_OFF_RAMP_STATE="..." - ! OFF text for ramp bit <-------+ /ON_A=(GREEN,.) - ! Set color for on/off bit <=======+ /RDY_A=(GREEN,.) - ! Set color for ready bit || /REM_A=(GREEN,.) - ! Set color for remote bit || /POL_A=(WHITE,*) - ! Set color for polarity bit || /RAMP_A=(WHITE,.) - ! Set color for ramp bit COLOR /N_ON_A=(RED,*) - ! Clear color for on/off bit (Not /N_RDY_A=(RED,*) - ! Clear color for ready bit supp) /N_REM_A=(YELLOW,-) - ! Clear color for remote bit (req.) /N_POL_A=(YELLOW,-) - ! Clear color for polarity bit || /N_RAMP_A=(YELLOW,*) - ! Clear color for ramp bit <=======+ /QTI=2 - /RATE_INDEX=1 - /SET_DATA_OFFSET=0 - /ARRAY_OFFSET=0 B_STSNAMES ! Begin list of status bit defs. STSNAME - ! Begin status bit def. #1 /BITNUMBER=0 - ! Bit offset /SHORTNAME=LFAIL - ! Short name of status bit /LONGNAME=LATCHED_FAIL - ! Long name of status bit /SETTEXT=FAILED - ! Display when bit ON /CLRTEXT=OK - ! Display when bit OFF /SETCOLOR=" " - ! Set color (not supp.) /CLRCOLOR=" " ! Clear color (not supp.) E_STSNAMES ! End list of status bit defs.
Distribution:
normal.