Difference between revisions of "V4 DBD Examples"

From EPICSWIKI
 
Line 166: Line 166:


  include "dbCommon.dbd"
  include "dbCommon.dbd"
struct(mbbiState) {
    field(severity, menu(menuAlarmSevr))
    field(rawValue, uint64)
    field(value, int16) {
        design(no)
        readonly(yes)
    }
}
  record(mbbi) extends iocRecord {
  record(mbbi) extends iocRecord {
     field(value,enum(stateNames)) {
    field(states, map(struct(mbbiState))) {
        special(yes)
    }
     field(value, enum(states)) {
         asl(0)
         asl(0)
         dynamic(yes)
         dynamic(yes)
     }
     }
     field(stateNames, array(string[]))
     field(unknownStateSeverity, menu(menuAlarmSevr))
    field(stateSeverities,array(menu(menuAlarmSevr)[]))
     field(changeStateSeverity, menu(menuAlarmSevr))
     field(unknownStateSeverity,menu(menuAlarmSevr))
     field(inp, device(in, digitalInput))
     field(changeStateSeverity,menu(menuAlarmSevr))
     field(rawValue, uint64) {
     field(mask,array(uint32[])) {
         design(no)
         special(yes)
    }
    field(nbits,int16) {
         readonly(yes)
         readonly(yes)
        dynamic(yes)
     }
     }
     field(inp,device(in,digitalInput))
     field(oldRawValue, uint64) {
    field(raw,uint32) {
         design(no)
         design(no)
         readonly(yes)
         readonly(yes)
         dynamic(yes)
         dynamic(yes)
     }
     }
     field(oldRaw,uint32) {
     field(hardwareShift, uint16) {
        design(no)
         readonly(yes)
         readonly(yes)
        dynamic(yes)
     }
     }
     field(hardwareMask,uint64 {
     field(hardwareMask, uint64 {
         readonly(yes)
         readonly(yes)
     }
     }
     field(lastValueAlarmed,int16) {
     field(lastValueAlarmed, int16) {
         design(no)
         design(no)
         readonly(yes)
         readonly(yes)
         dynamic(yes)
         dynamic(yes)
     }
     }
    field(shift,uint16) {
     field(simInputLink, link(in))
     field(simInputLink,link(in))
     field(simValue, uint64) {
     field(simValue,uint64)
        dynamic(yes)
     field(simModeLink,link(in))
    }
     field(simMode,menu(menuYesNo)) {
     field(simModeLink, link(in))
     field(simMode, menu(menuYesNo)) {
         dynamic(yes)
         dynamic(yes)
     }
     }
     field(simSevr,menu(menuAlarmSevr))
     field(simSevr, menu(menuAlarmSevr))
     view(choice) {
     view(choice) {
         property(value, value) {
         property(value, value) {
Line 221: Line 228:
     }
     }
  }
  }


== waveformRecord ==
== waveformRecord ==

Revision as of 22:32, 26 May 2005

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"
struct(mbbiState) {
    field(severity, menu(menuAlarmSevr))
    field(rawValue, uint64)
    field(value, int16) {
        design(no)
        readonly(yes)
    }
}
record(mbbi) extends iocRecord {
    field(states, map(struct(mbbiState))) {
        special(yes)
    }
    field(value, enum(states)) {
        asl(0)
        dynamic(yes)
    }
    field(unknownStateSeverity, menu(menuAlarmSevr))
    field(changeStateSeverity, menu(menuAlarmSevr))
    field(inp, device(in, digitalInput))
    field(rawValue, uint64) {
        design(no)
        readonly(yes)
        dynamic(yes)
    }
    field(oldRawValue, uint64) {
        design(no)
        readonly(yes)
        dynamic(yes)
    }
    field(hardwareShift, uint16) {
        readonly(yes)
    }
    field(hardwareMask, uint64 {
        readonly(yes)
    }
    field(lastValueAlarmed, int16) {
        design(no)
        readonly(yes)
        dynamic(yes)
    }
    field(simInputLink, link(in))
    field(simValue, uint64) {
        dynamic(yes)
    }
    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)
        }
    }
}