Difference between revisions of "V4 DB RecordCommon"

From EPICSWIKI
 
 
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
EPICS V4: RecordCommon September 16 2005  
EPICS V4: Standard Support November 02 2005  
----
----


= Overview =
= Overview =


For V4 dbCommon.dbd and RecordCommon.dbd replace the V3 dbCommon.dbd.
This document describes two base supplied components for EPICS V4 databases.
dbCommon.dbd define widely used definitions and RecordCommon.dbd defines
# menuStructBase.dbd - menu and struct definitions
the fields that are common to all record types.
# baseSupport.dbd - link definitions for base supplied support
 


This document requires that the reader be familiar with:
This document requires that the reader be familiar with:
# V3 iocCore
# V3 iocCore
# V4 Design: Record Processing
# V4 DBD Statement Syntax
# V4 Design: dbdInterfaces
# V4 DB Record Instance Syntax
 
Unless the reader is familiar with these most of this document will
be very difficult to understand.


NOTE: This document is ahead of the two above V4 documents so it may use
slightly different syntax.
----
----
<center>
<center>
= dbCommon =
= menuStructBase.dbd =
  </center>
  </center>


<tt>dbCommon.dbd</tt> defines the following:
== Channel/Database Access Links ==


     # menu definitions for RecordCommon fields
    struct(ProcessLink) {
        field(pvname,string) { link}
        field(wait,boolean)
        field(timeout,float64)
    }
    struct(MonitorLink) {
        field(pvname,string) { link}
        field(process,boolean) // process this record when monitor occurs
        field(inheritSeverity,boolean)
    }
    struct(InputLink) {
        field(pvname,string) { link}
        field(process,boolean)
        field(wait,boolean)
        field(timeout,float64)
        field(inheritSeverity,boolean)
    }
    struct(OutputLink) {
        field(pvname,string) { link}
        field(process,boolean)
        field(wait,boolean)
        field(timeout,float64)
        field(inheritSeverity,boolean)
    }
 
== asynDriver Link ==
    struct(AsynLink) {
        field(portName,string)
        field(addr,int32)
        field(timeout,float64)
        field(drvPvt,string)
    }
 
== Definitions for recordCommon ==
 
     # menu definitions for recordCommon fields
     menu(menuPriority) {
     menu(menuPriority) {
         choice(menuPriorityLow, "Low")
         choice(menuPriorityLow, "Low")
Line 51: Line 84:
     }
     }


     menu(menuConvert) {
     #struct definitions for recordCommon
        choice(menuConvertRaw, "Raw")
        choice(menuConvertLinear, "Linear")
        choice(menuConvertTable, "Table")
    }
 
    struct(MonitorLink) {
        field(pvname,string) { link}
        field(process,bool) // process this record when monitor occurs
        field(inheritSeverity,bool)
    }
    struct(InputLink) {
        field(pvname,string) { link}
        field(parallel,bool)
        field(process,bool)
        field(wait,bool)
        field(inheritSeverity,bool)
    }
    struct(OutputLink) {
        field(pvname,string) { link}
        field(parallel,bool)
        field(process,bool)
        field(wait,bool)
        field(inheritSeverity,bool)
    }
    struct(ProcessLink) {
        field(pvname,string) { link}
        field(parallel,bool)
        field(wait,bool)
    }
 
    link(in,"MonitorLink",MonitorLink);
    link(in,"InputLink",InputLink);
    link(out,"OutputLink",OutputLink);
    link(process,"ProcessLink",ProcessLink);
 
    #definitions for common properties
     struct(TimeStamp) {
     struct(TimeStamp) {
         field(secondsPastEpoch,int64)
         field(secondsPastEpoch,int64)
Line 102: Line 99:
         }
         }
     }
     }
<b>Event NEEDS NEW DEFINITIONS</b>
<b>Event NEEDS NEW DEFINITIONS</b>
     struct Event {
     struct Event {
Line 109: Line 105:
         }
         }
         field(timeStampEvent,int16)
         field(timeStampEvent,int16)
         field(timeStampLink,link(in))
         field(timeStampLink,link)
     }
     }
----
<center>
= RecordCommon =
</center>
<tt>RecordCommon.dbd</tt> must be part of every record, and defines the following:


     struct Disable {
     struct Disable {
        field(disabled,boolean)
         field(disableValue,int16) {
         field(disableValue,int16) {
             default("1")
             default("1")
         }
         }
         field(disableInput,int16)
         field(disableInput,int16)
         field(disableLink,link(in))
         field(disableLink,link)
         field(disableAlarmSeverity,menu(menuAlarmSevr))
         field(disableAlarmSeverity,menu(menuAlarmSevr))
     }
     }


     record(RecordCommon) {
     struct(ProcessLink) {
        field(block,boolean)
        field(link,link)
    }
 
    struct(RecordCommon) {
         field(description,string)
         field(description,string)
         field(scan,struct(Scan))
         field(scan,struct(Scan))
         field(event,struct(Event))
         field(event,struct(Event))
         field(accessSecurityGroup,string)
         field(accessSecurityGroup,string)
         field(pini,bool)
         field(processAtInit,boolean)
         field(disablePutField,bool)
         field(disablePutField,boolean)
         field(alarmAckSeverity,menu(menuAlarmSevr)) {
         field(alarmAckSeverity,menu(menuAlarmSevr)) {
             design(no)
             design(no)
             readonly(yes)
             readonly(yes)
         }
         }
         field(alarmAckTransient,bool) {
         field(alarmNoAckTransient,menu(menuAlarmSevr)) {
            readonly(yes)
        # highest level of alarm that does not have to be acknowledged"
            default("YES")
         }
         }
         field(udf,bool) {
         field(undefined,boolean) {
             dynamic(yes)
             dynamic(yes)
             default("1")
             default(true)
         }
         }
         field(time,struct(timeStamp)) {
         field(time,struct(TimeStamp)) {
             design(no)
             design(no)
             dynamic(yes)
             dynamic(yes)
Line 162: Line 156:
             default("Invalid")
             default("Invalid")
         }
         }
         field(processLink,array([] struct(Link))) {
         field(processLink,array(ProcessLink[])) {
             special(yes)
             special(yes)
         }
         }
Line 168: Line 162:


Although it has many fewer fields,
Although it has many fewer fields,
RecordCommon.dbd is a complete replacement for the V3 dbCommon.
RecordCommon is a complete replacement for the V3 dbCommon.
The following V3 fields are no longer needed:
The following V3 fields are no longer needed:
* private fields - Private fields will truly be privaye to the implementation
* private fields - Private fields will truly be private to the implementation
* previous value fields - All puts to database fields will be posted. The layer above will decide if clients should be notified of changes.
* previous value fields - All puts to database fields will be posted. The layer above will decide if clients should be notified of changes.
== Other common definitions ==
    menu(menuConvert) {
        choice(menuConvertRaw, "Raw")
        choice(menuConvertLinear, "Linear")
        choice(menuConvertTable, "Table")
    }
    struct(LinearConvert) {
        field(engUnitsHigh,float64)
        field(engUnitsLow,float64)
        field(slope,float64)
        field(intercept,float64)
    }
    struct(DisplayLimit) {
        field(low,float64)
        field(high,float64)
    }
    struct(ControlLimit) {
        field(low,float64)
        field(high,float64)
    }
    struct(AlarmLimit) {
        field(low,float64)
        field(lowSevr,menu(menuAlarmSevr))
        field(lowWarning,float64)
        field(lowWarningSevr,menu(menuAlarmSevr))
        field(highWarning,float64)
        field(highWarningSevr,menu(menuAlarmSevr))
        field(high,float64)
        field(highSevr,menu(menuAlarmSevr))
        field(hysteresis,float64)
    }
<b>MAY NEED NEW DEFINITION</b>
    struct(SimulationFloat64) {
        field(modeLink,link)
        field(mode,boolean)
        field(link,link)
        field(value,float64)
        field(alarmSevr,menu(menuAlarmSevr))
    }
----
<center>
= definition of record types =
</center>
Most record types are defined as follows:
    #include "menuStructBase.dbd"
    record(AiRecord) {
    field(common,struct(RecordCommon))
    ...
    }
----
<center>
= baseSupport.dbd =
</center>
== Channel/Database Access Support ==
Link support is provided for
* monitor support
* input support
* output
* process
For monitor, input, and output The following data types are supported:
* primitive types
* string
* arrays of primitive types and strings
    support(processLink,ProcessLink)
    support(monitorLink,MonitorLink)
    support(monitorLinkArray,MonitorLink)
    support(inputLink,InputLink)
    support(inputLinkArray,InputLink)
    support(outputLink,OutputLink)
    support(outputLinkArray)
== asynDriver support ==
    support(asynInt32,AsynLink)
    support(asynInt32Average,AsynLink)
    support(asynInt32Monitor,AsynLink)
    support(asynFloat64,AsynLink)
    support(asynFloat64Average,AsynLink)
    support(asynFloat64Monitor,AsynLink)
    support(asynDigitalMonitor,AsynLink)
    support(asynDigital,AsynLink)
    support(asynInt32Array,AsynLink)
    support(asynFloat64Array,AsynLink)
    support(asynOctet,AsynLink)
== struct support ==
For RecordCommon
    support(common) # no SupportStruct
For linear conversion
    support(linearConvert)
For simulation
    support(simulation)

Latest revision as of 19:51, 2 November 2005

EPICS V4: Standard Support November 02 2005


Overview

This document describes two base supplied components for EPICS V4 databases.

  1. menuStructBase.dbd - menu and struct definitions
  2. baseSupport.dbd - link definitions for base supplied support

This document requires that the reader be familiar with:

  1. V3 iocCore
  2. V4 DBD Statement Syntax
  3. V4 DB Record Instance Syntax

NOTE: This document is ahead of the two above V4 documents so it may use slightly different syntax.


menuStructBase.dbd

Channel/Database Access Links

    struct(ProcessLink) {
        field(pvname,string) { link}
        field(wait,boolean)
        field(timeout,float64)
    }
    struct(MonitorLink) {
        field(pvname,string) { link}
        field(process,boolean) // process this record when monitor occurs
        field(inheritSeverity,boolean) 
    }
    struct(InputLink) {
        field(pvname,string) { link}
        field(process,boolean)
        field(wait,boolean)
        field(timeout,float64)
        field(inheritSeverity,boolean)
    }
    struct(OutputLink) {
        field(pvname,string) { link}
        field(process,boolean)
        field(wait,boolean)
        field(timeout,float64)
        field(inheritSeverity,boolean)
    }

asynDriver Link

    struct(AsynLink) {
        field(portName,string)
        field(addr,int32)
        field(timeout,float64)
        field(drvPvt,string)
    }

Definitions for recordCommon

    # menu definitions for recordCommon fields
    menu(menuPriority) {
        choice(menuPriorityLow, "Low")
        choice(menuPriorityMedium, "Medium")
        choice(menuPriorityHigh, "High")
    }
    menu(menuScan) {
        choice(menuScanPassive, "Passive")
        choice(menuScanEvent, "Event")
        choice(menuScanInterrupt, "Interrupt")
        choice(menuScan10second, "10 second")
        choice(menuScan5second, "5 second")
        choice(menuScan2second, "2 second")
        choice(menuScan1second, "1 second")
        choice(menuScan_5second, ".5 second")
        choice(menuScan_2second, ".2 second")
        choice(menuScan_1second, ".1 second")
    }
    menu(menuAlarmSevr) {
        choice(menuAlarmSevrNone, "None")
        choice(menuAlarmSevrMinor, "Minor")
        choice(menuAlarmSevrMajor, "Major")
        choice(menuAlarmSevrInvalid, "Invalid")
    }
    #struct definitions for recordCommon
    struct(TimeStamp) {
        field(secondsPastEpoch,int64)
        field(nanoSeconds,int32)
    }
    struct Scan {
        field(scan,menu(menuScan)) {
            special(yes)
        }
        field(phase,int16)
        field(priority,menu(menuPriority)) {
            special(yes)
        }
    }

Event NEEDS NEW DEFINITIONS

    struct Event {
        field(eventNumber,int16) {
            special(yes)
        }
        field(timeStampEvent,int16)
        field(timeStampLink,link)
    }
    struct Disable {
        field(disabled,boolean)
        field(disableValue,int16) {
            default("1")
        }
        field(disableInput,int16)
        field(disableLink,link)
        field(disableAlarmSeverity,menu(menuAlarmSevr))
    }
    struct(ProcessLink) {
        field(block,boolean)
        field(link,link)
    }
    struct(RecordCommon) {
        field(description,string)
        field(scan,struct(Scan))
        field(event,struct(Event))
        field(accessSecurityGroup,string)
        field(processAtInit,boolean)
        field(disablePutField,boolean)
        field(alarmAckSeverity,menu(menuAlarmSevr)) {
            design(no)
            readonly(yes)
        }
        field(alarmNoAckTransient,menu(menuAlarmSevr)) {
        # highest level of alarm that does not have to be acknowledged"
        }
        field(undefined,boolean) {
            dynamic(yes)
            default(true)
        }
        field(time,struct(TimeStamp)) {
            design(no)
            dynamic(yes)
            readonly(yes)
        }
        field(disable,struct(Disable)) {
            special(yes)
        }
        field(alarmStatus,string) {
            default("UDF")
        }
        field(alarmSeverity,menu(menuAlarmSevr)) {
            readonly(yes)
            default("Invalid")
        }
        field(processLink,array(ProcessLink[])) {
            special(yes)
        }
    }

Although it has many fewer fields, RecordCommon is a complete replacement for the V3 dbCommon. The following V3 fields are no longer needed:

  • private fields - Private fields will truly be private to the implementation
  • previous value fields - All puts to database fields will be posted. The layer above will decide if clients should be notified of changes.


Other common definitions

    menu(menuConvert) {
        choice(menuConvertRaw, "Raw")
        choice(menuConvertLinear, "Linear")
        choice(menuConvertTable, "Table")
    }
    struct(LinearConvert) {
        field(engUnitsHigh,float64) 
        field(engUnitsLow,float64)
        field(slope,float64) 
        field(intercept,float64) 
    }
    struct(DisplayLimit) {
        field(low,float64) 
        field(high,float64)
    }
    struct(ControlLimit) {
        field(low,float64) 
        field(high,float64) 
    }
    struct(AlarmLimit) {
        field(low,float64) 
        field(lowSevr,menu(menuAlarmSevr)) 
        field(lowWarning,float64) 
        field(lowWarningSevr,menu(menuAlarmSevr)) 
        field(highWarning,float64) 
        field(highWarningSevr,menu(menuAlarmSevr)) 
        field(high,float64) 
        field(highSevr,menu(menuAlarmSevr)) 
        field(hysteresis,float64)
    }

MAY NEED NEW DEFINITION

    struct(SimulationFloat64) {
        field(modeLink,link)
        field(mode,boolean)
        field(link,link)
        field(value,float64)
        field(alarmSevr,menu(menuAlarmSevr))
    }

definition of record types

Most record types are defined as follows:

    #include "menuStructBase.dbd"
    record(AiRecord) {
    field(common,struct(RecordCommon))
    ...
    }

baseSupport.dbd


Channel/Database Access Support

Link support is provided for

  • monitor support
  • input support
  • output
  • process

For monitor, input, and output The following data types are supported:

  • primitive types
  • string
  • arrays of primitive types and strings
    support(processLink,ProcessLink)
    support(monitorLink,MonitorLink)
    support(monitorLinkArray,MonitorLink)
    support(inputLink,InputLink)
    support(inputLinkArray,InputLink)
    support(outputLink,OutputLink)
    support(outputLinkArray)

asynDriver support

    support(asynInt32,AsynLink)
    support(asynInt32Average,AsynLink)
    support(asynInt32Monitor,AsynLink)
    support(asynFloat64,AsynLink)
    support(asynFloat64Average,AsynLink)
    support(asynFloat64Monitor,AsynLink)
    support(asynDigitalMonitor,AsynLink)
    support(asynDigital,AsynLink)
    support(asynInt32Array,AsynLink)
    support(asynFloat64Array,AsynLink)
    support(asynOctet,AsynLink)

struct support

For RecordCommon

    support(common) # no SupportStruct

For linear conversion

    support(linearConvert)

For simulation

    support(simulation)