Difference between revisions of "V4 DBD Examples"

From EPICSWIKI
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
= Example Record Types =
Example Record Types November 02 2005
= Overview =
This document present proposed V4 replacements for a few of the
V3 record types.


== aoRecord ==
<center>
= aoRecord =
</center>


aoRecord.dbd might be defined as follows:
aoRecord.dbd might be defined as follows:


  include "dbCommon.dbd"
  include "menuStructBase.dbd"
  record(ao) extends iocRecord {
  record(AoRecord) {
     field(value, float64) {
     field(common,struct(RecordCommon))
    field(desiredValue, float64) {
         asl(0)
         asl(0)
        dynamic(yes)
     }
     }
     field(outValue, float64) {
     field(currentValue, float64) {
         readonly(yes)
         readonly(yes)
        dynamic(yes)
     }
     }
     field(out, device(out,analogOut))
     field(out,link)
     field(outputRateOfChange, float64)
     field(outputRateOfChange, float64)
     field(desiredOutputLink, link(in))
     field(desiredOutputLink,link)
     field(closedLoop, bool)
     field(closedLoop, bool)
     field(outputIncremental, bool)
     field(outputIncremental, bool)
Line 23: Line 27:
         special(yes)
         special(yes)
     }
     }
     field(linearConvert, struct(linearConvert)) {
     field(linearConvert, struct(LinearConvert)) {
         special(yes)
         special(yes)
     }
     }
    field(convertTable,string);
     field(units, string)
     field(units, string)
     field(displayLimit, struct(displayLimitF64))
     field(displayLimit, struct(DisplayLimit))
     field(controlLimit, struct(controlLimitF64))
     field(controlLimit, struct(ControlLimit))
     field(alarmLimit, struct(alarmLimitF64))
     field(alarmLimit, struct(AlarmLimit))
    field(alarmDeadband, float64)
     field(rawValue, int32) {
     field(rawValue, int32) {
         design(no)
         design(no)
        dynamic(yes)
    }
    field(prevRawValue, int32) {
        design(no)
        readonly(yes)
        dynamic(yes)
     }
     }
     field(readBackValue, int32) {
     field(readBackValue, int32) {
         design(no)
         design(no)
         readonly(yes)
         readonly(yes)
        dynamic(yes)
     }
     }
     field(oldReadBackValue, int32) {
     field(simulation,struct(SimulationFloat64))
        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(invalidAction, menu(menuIvoa))
     field(invalidValue, float64)
     field(invalidValue, float64)
    field(outValueModified, bool) {
        design(no)
        readonly(yes)
    }
     view(value) {
     view(value) {
         property(value, value) {
         property(value, value) {
Line 112: Line 75:
         }
         }
     }
     }
  }
  }  
 


== calcRecord ==
<center>
= calcRecord =
</center>


calcRecord.dbd defines the following:
calcRecord.dbd defines the following:


  include "dbCommon.dbd"
  include "menuStructBase.dbd"
  struct(calcInpLink) {
  struct(CalcInpLink) {
     field(link,link(in))
    field(block,boolean)
     field(link,link)
     field(value,float64)
     field(value,float64)
  }
  }
  record(calc) extends iocRecord {
 
     field(result,float64) {
  record(CalcRecord){
     field(common,struct(RecordCommon))
    field(value,float64) {
         asl(0)
         asl(0)
        dynamic(yes)
     }
     }
     field(calc,string) {
     field(calc,string) {
         special(yes)
         special(yes)
     }
     }
     field(inp,array(struct(calcInpLink)[])) {
     field(input,array(struct(CalcInpLink)[]))  
        dynamic(yes)
    }
     field(units,string)
     field(units,string)
     field(displayLimit,struct(displayLimitF64))
     field(displayLimit,struct(DisplayLimit))
     field(alarmLimit,struct(alarmLimitF64))
     field(alarmLimit,struct(AlarmLimit))
    field(alarmDeadband,float64)
    field(lastValueAlarmed,float64) {
        design(no)
        readonly(yes)
        dynamic(yes)
    }
    field(rpcl,private("char *"))
     view(result) {
     view(result) {
         property(value, result) {
         property(value, result) {
Line 161: Line 118:




== mbbiRecord ==
<center>
= mbbiRecord =
</center>


mbbiRecord.dbd could be:
mbbiRecord.dbd could be:


  include "dbCommon.dbd"
  include "menuStructBase.dbd"
  struct(mbbiState) {
  struct(MbbiState) {
    field(name, string)
    field(value, array(octet[]))
     field(severity, menu(menuAlarmSevr))
     field(severity, menu(menuAlarmSevr))
    field(rawValue, uint64)
    field(value, int16) {
        design(no)
        readonly(yes)
    }
  }
  }
  record(mbbi) extends iocRecord {
  record(MbbiRecord) {
     field(states, map(struct(mbbiState))) {
     field(common,struct(RecordCommon))
    field(state, array(struct(MbbiState)[])) {
         special(yes)
         special(yes)
     }
     }
     field(value, enum(states)) {
#NOTE: stateName needed because enum must refer to array of string
    field(stateName,array(string[])) {
        design(no) readonly(yes)
    }
     field(value, enum(stateName)) {
         asl(0)
         asl(0)
        dynamic(yes)
     }
     }
     field(unknownStateSeverity, menu(menuAlarmSevr))
     field(unknownStateSeverity, menu(menuAlarmSevr))
     field(changeStateSeverity, menu(menuAlarmSevr))
     field(changeStateSeverity, menu(menuAlarmSevr))
     field(inp, device(in, digitalInput))
     field(inp, link)
     field(rawValue, uint64) {
     field(rawValue, array(octet[])) {
         design(no)
         design(no)
        readonly(yes)
        dynamic(yes)
    }
    field(oldRawValue, uint64) {
        design(no)
        readonly(yes)
        dynamic(yes)
    }
    field(hardwareShift, uint16) {
         readonly(yes)
         readonly(yes)
     }
     }
     field(hardwareMask, uint64 {
     field(hardwareShift, int16) {
         readonly(yes)
         readonly(yes)
     }
     }
     field(lastValueAlarmed, int16) {
     field(hardwareMask, array(octet[]) {
        design(no)
         readonly(yes)
         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) {
     view(choice) {
         property(value, value) {
         property(value, value) {
Line 229: Line 169:
  }
  }


== waveformRecord ==
<center>
= waveformRecord =
</center>


waveformRecord.dbd defines the following:
waveformRecord.dbd defines the following:


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

Latest revision as of 19:54, 2 November 2005

Example Record Types November 02 2005

Overview

This document present proposed V4 replacements for a few of the V3 record types.

aoRecord

aoRecord.dbd might be defined as follows:

include "menuStructBase.dbd"
record(AoRecord) {
    field(common,struct(RecordCommon))
    field(desiredValue, float64) {
        asl(0)
    }
    field(currentValue, float64) {
        readonly(yes)
    }
    field(out,link)
    field(outputRateOfChange, float64)
    field(desiredOutputLink,link)
    field(closedLoop, bool)
    field(outputIncremental, bool)
    field(convert, menu(menuConvert)) {
        special(yes)
    }
    field(linearConvert, struct(LinearConvert)) {
        special(yes)
    }
    field(convertTable,string);
    field(units, string)
    field(displayLimit, struct(DisplayLimit))
    field(controlLimit, struct(ControlLimit))
    field(alarmLimit, struct(AlarmLimit))
    field(rawValue, int32) {
        design(no)
    }
    field(readBackValue, int32) {
        design(no)
        readonly(yes)
    }
    field(simulation,struct(SimulationFloat64))
    field(invalidAction, menu(menuIvoa))
    field(invalidValue, float64)
    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 "menuStructBase.dbd"
struct(CalcInpLink) {
    field(block,boolean)
    field(link,link)
    field(value,float64)
}
record(CalcRecord){
    field(common,struct(RecordCommon))
    field(value,float64) {
        asl(0)
    }
    field(calc,string) {
        special(yes)
    }
    field(input,array(struct(CalcInpLink)[])) 
    field(units,string)
    field(displayLimit,struct(DisplayLimit))
    field(alarmLimit,struct(AlarmLimit))
    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 "menuStructBase.dbd"
struct(MbbiState) {
    field(name, string)
    field(value, array(octet[]))
    field(severity, menu(menuAlarmSevr))
}
record(MbbiRecord) {
    field(common,struct(RecordCommon))
    field(state, array(struct(MbbiState)[])) {
        special(yes)
    }
  1. NOTE: stateName needed because enum must refer to array of string
    field(stateName,array(string[])) {
        design(no) readonly(yes)
    }
    field(value, enum(stateName)) {
        asl(0)
    }
    field(unknownStateSeverity, menu(menuAlarmSevr))
    field(changeStateSeverity, menu(menuAlarmSevr))
    field(inp, link)
    field(rawValue, array(octet[])) {
        design(no)
        readonly(yes)
    }
    field(hardwareShift, int16) {
        readonly(yes)
    }
    field(hardwareMask, array(octet[]) {
        readonly(yes)
    }
    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 "menuStructBase.dbd"
record(WaveformRecord) {
    field(common,struct(RecordCommon))
    field(value, array([])) {
        asl(0)
        special(yes)
    }
    field(reArm,bool)
    field(io,link)
    field(units,string)
    field(displayLimit,struct(DisplayLimit))
    field(busy,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)
        }
    }
}