V4 DBD Examples

From EPICSWIKI
Revision as of 20:20, 17 May 2005 by AndrewJohnson (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Example Record Types

aoRecord

aoRecord.dbd might be defined as follows:

include "dbCommon.dbd"
record(ao) extends iocRecord {
    field(value, float64) {
        asl(0)
        dynamic(yes)
    }
    field(outValue, float64) {
        readonly(yes)
        dynamic(yes)
    }
    field(out, device(out,analogOut))
    field(outputRateOfChange, float64)
    field(desiredOutputLink, link(in))
    field(closedLoop, bool)
    field(outputIncremental, bool)
    field(convert, menu(menuConvert)) {
        special(yes)
    }
    field(linearConvert, struct(linearConvert)) {
        special(yes)
    }
    field(units, string)
    field(displayLimit, struct(displayLimitF64))
    field(controlLimit, struct(controlLimitF64))
    field(alarmLimit, struct(alarmLimitF64))
    field(alarmDeadband, float64)
    field(rawValue, int32) {
        design(no)
        dynamic(yes)
    }
    field(prevRawValue, int32) {
        design(no)
        readonly(yes)
        dynamic(yes)
    }
    field(readBackValue, int32) {
        design(no)
        readonly(yes)
        dynamic(yes)
    }
    field(oldReadBackValue, int32) {
        design(no)
        readonly(yes)
        dynamic(yes)
    }
    field(prevValue, float64) {
        design(no)
        readonly(yes)
        dynamic(yes)
    }
    field(lastValueAlarmed, float64) {
        design(no)
        readonly(yes)
        dynamic(yes)
    }
    field(pbrk, private("void *"))
    field(init, bool) {
        design(no)
        readonly(yes)
    }
    field(lbrk, int16) {
        design(no)
        readonly(yes)
        dynamic(yes)
    }
    field(simOutputLink, link(out))
    field(simModeLink, link(in))
    field(simMode, bool) {
        dynamic(yes)
    }
    field(simSevr, menu(menuAlarmSevr))
    field(invalidAction, menu(menuIvoa))
    field(invalidValue, float64)
    field(outValueModified, bool) {
        design(no)
        readonly(yes)
    }
    view(value) {
        property(value, value) {
            property(units, units)
            property(timeStamp, time)
            property(alarmSeverity, alarmSeverity)
            property(alarmStatus, alarmStatus)
            property(displayLimit, displayLimit)
            property(controlLimit, controlLimit)
            property(alarmLimit, alarmLimit)
        }
    }
    view(output) {
        property(value, outValue) {
            property(units, units)
            property(timeStamp, time)
            property(alarmSeverity, alarmSeverity)
            property(alarmStatus, alarmStatus)
            property(displayLimit, displayLimit)
        }
    }
    view(raw) {
        property(value, rawValue) {
            property(timeStamp, time)
        }
    }
    view(readback) {
        property(value, readBackValue) {
            property(timeStamp, time)
        }
    }
}


calcRecord

calcRecord.dbd defines the following:

include "dbCommon.dbd"
struct(calcInpLink) {
    field(link,link(in))
    field(value,float64)
}
record(calc) extends iocRecord {
    field(result,float64) {
        asl(0)
        dynamic(yes)
    }
    field(calc,string) {
        special(yes)
    }
    field(inp,array(struct(calcInpLink)[])) {
        dynamic(yes)
    }
    field(units,string)
    field(displayLimit,struct(displayLimitF64))
    field(alarmLimit,struct(alarmLimitF64))
    field(alarmDeadband,float64)
    field(lastValueAlarmed,float64) {
        design(no)
        readonly(yes)
        dynamic(yes)
    }
    field(rpcl,private("char *"))
    view(result) {
        property(value, result) {
            property(units, units)
            property(timeStamp, time)
            property(alarmSeverity, alarmSeverity)
            property(alarmStatus, alarmStatus)
            property(displayLimit, displayLimit)
            property(alarmLimit, alarmLimit)
        }
    }
    view(expression) {
        property(value, calc)
    }
}


mbbiRecord

mbbiRecord.dbd could be:

include "dbCommon.dbd"
record(mbbi) extends iocRecord {
    field(value,enum(stateNames)) {
        asl(0)
        dynamic(yes)
    }
    field(stateNames, array(string[]))
    field(stateSeverities,array(menu(menuAlarmSevr)[]))
    field(unknownStateSeverity,menu(menuAlarmSevr))
    field(changeStateSeverity,menu(menuAlarmSevr))
    field(mask,array(uint32[])) {
        special(yes)
    }
    field(nbits,int16) {
        readonly(yes)
    }
    field(inp,device(in,digitalInput))
    field(raw,uint32) {
        design(no)
        readonly(yes)
        dynamic(yes)
    }
    field(oldRaw,uint32) {
        design(no)
        readonly(yes)
        dynamic(yes)
    }
    field(hardwareMask,uint64 {
        readonly(yes)
    }
    field(lastValueAlarmed,int16) {
        design(no)
        readonly(yes)
        dynamic(yes)
    }
    field(shift,uint16) {
    field(simInputLink,link(in))
    field(simValue,uint64)
    field(simModeLink,link(in))
    field(simMode,menu(menuYesNo)) {
        dynamic(yes)
    }
    field(simSevr,menu(menuAlarmSevr))
    view(choice) {
        property(value, value) {
            property(timeStamp, time)
            property(alarmSeverity, alarmSeverity)
            property(alarmStatus, alarmStatus)
        }
    }
    view(raw) {
        property(value, raw) {
            property(timeStamp, time)
        }
    }
}


waveformRecord

waveformRecord.dbd defines the following:

include "dbCommon.dbd"
record(waveform) extends iocRecord {
    field(value, array([])) {
        asl(0)
        special(yes)
        dynamic(yes)
    }
    field(reArm,bool)
    field(inp,device(in,waveformIO))
    field(units,string)
    field(displayLimit,struct(displayLimit))
    field(busy,bool) {
        design(no)
        readonly(yes)
    }
    field(simInputLink,link(in))
    field(simModeLink,link(in))
    field(simMode,menu(menuYesNo)) {
        dynamic(yes)
    }
    field(simSevr,menu(menuYesNo))
    view(value) {
        property(value, value) {
            property(units, units)
            property(timeStamp, time)
            property(alarmSeverity, alarmSeverity)
            property(alarmStatus, alarmStatus)
            property(displayLimit, displayLimit)
        }
    }
}