Difference between revisions of "V4 DBD Examples"

From EPICSWIKI
Line 1: Line 1:
Example Record Types Sept 27 2005
Example Record Types Sept 28 2005
= Overview =
= Overview =
This document present proposed V4 replacements for a few of the
This document present proposed V4 replacements for a few of the
Line 19: Line 19:
     }
     }
     field(out,
     field(out,
         link(out,array(string[3]) = {
         link(out,interface( LinkInt64, LinkFloat64))
            "outputLinkInt64",
            "outputLinkFloat64",
            "asynInt32",
            "asynFloat64"
        } ))
     )
     )
     field(outputRateOfChange, float64)
     field(outputRateOfChange, float64)
     field(desiredOutputLink,
     field(desiredOutputLink,
         link(in,array(string[2]) = {
         link(in,interface(LinkFloat64))
          "monitorLinkFloat64",
          "inputLinkFloat64"
        } ))
     )
     )
     field(closedLoop, bool)
     field(closedLoop, bool)
Line 62: Line 54:
     }
     }
     field(simOutputLink,
     field(simOutputLink,
         link(out,array(string[2]) = {
         link(out,interface(LinkFloat64))
            "outputLinkInt64",
            "outputLinkFloat64",
        } ))
     )
     )


     field(simModeLink,
     field(simModeLink,
         link(in,array(string[2]) = {
         link(in,interface(LinkBoolean))
          "monitorLinkString",
          "inputLinkString"
        } ))
     )
     )
     field(simMode, bool)  
     field(simMode, bool)  
Line 122: Line 108:
  include "dbCommon.dbd"
  include "dbCommon.dbd"
  struct(CalcInpLink) {
  struct(CalcInpLink) {
     field(link,link(in))
     field(link,link(in,interface(LinkFloat64))
        link(in,array(string[2]) = {
          "monitorLinkFloat64",
          "inputLinkFloat64"
        } ))
    )
     field(value,float64)
     field(value,float64)
  }
  }
Line 189: Line 170:
     field(unknownStateSeverity, menu(menuAlarmSevr))
     field(unknownStateSeverity, menu(menuAlarmSevr))
     field(changeStateSeverity, menu(menuAlarmSevr))
     field(changeStateSeverity, menu(menuAlarmSevr))
     field(inp,  
     field(inp, link(in,interface(LinkOctetArray,AsynDigital))
        link(in,array(string[3]) = {
            "inputLinkOctet",
            "asynDigital",
        } ))
    )
     field(rawValue, array(octet[])) {
     field(rawValue, array(octet[])) {
         design(no)
         design(no)
Line 233: Line 209:
     field(reArm,bool)
     field(reArm,bool)
     field(io,
     field(io,
         link(inout,array(string[4]) = {
         link(inout,interface(
           "monitorLinkArrayOctet",
           "LinkArrayOctet",
           "monitorLinkArrayBoolean",
           "LinkArrayBoolean",
           "monitorLinkArrayInt16",
           "LinkArrayInt16",
           "monitorLinkArrayInt32",
           "LinkArrayInt32",
           "monitorLinkArrayInt64",
           "LinkArrayInt64",
           "monitorLinkArrayFloat32",
           "LinkArrayFloat32",
           "monitorLinkArrayFloat64",
           "LinkArrayFloat64",
           "monitorLinkArrayString",
           "LinkArrayString",
          "inputLinkArrayOctet",
          "inputLinkArrayBoolean",
          "inputLinkArrayInt16",
          ... all input and link types
         } ))
         } ))
     )
     )

Revision as of 19:30, 28 September 2005

Example Record Types Sept 28 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 "dbCommon.dbd"
record(AoRecord) extends RecordCommon {
    field(value, float64) {
        asl(0)
    }
    field(outValue, float64) {
        readonly(yes)
    }
    field(out,
       link(out,interface( LinkInt64, LinkFloat64))
    )
    field(outputRateOfChange, float64)
    field(desiredOutputLink,
       link(in,interface(LinkFloat64))
    )
    field(closedLoop, bool)
    field(outputIncremental, bool)
    field(convert, menu(menuConvert)) {
        special(yes)
    }
    field(linearConvert, struct(LinearConvert)) {
        special(yes)
    }
    field(units, string)
    field(displayLimit, struct(DisplayLimit))
    field(controlLimit, struct(ControlLimit))
    field(alarmLimit, struct(AlarmLimit))
    field(alarmDeadband, float64)
    field(rawValue, int64) {
        design(no)
    }
    field(prevRawValue, int64) {
        design(no)
        readonly(yes)
    }
    field(readBackValue, int64) {
        design(no)
        readonly(yes)
    }
    field(init, bool) {
        design(no)
        readonly(yes)
    }
    field(simOutputLink,
       link(out,interface(LinkFloat64))
    )
    field(simModeLink,
       link(in,interface(LinkBoolean))
    )
    field(simMode, bool) 
    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,interface(LinkFloat64))
    field(value,float64)
}
record(CalcRecord) extends RecordCommon {
    field(result,float64) {
        asl(0)
    }
    field(calc,string) {
        special(yes)
    }
    field(input,array(struct(CalcInpLink)[])) 
    field(units,string)
    field(displayLimit,struct(DisplayLimit))
    field(alarmLimit,struct(AlarmLimit))
    field(alarmDeadband,float64)
    field(lastValueAlarmed,float64) {
        design(no)
        readonly(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(name, string)
    field(value, array(octet[]))
    field(severity, menu(menuAlarmSevr))
}
record(MbbiRecord) extends 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(in,interface(LinkOctetArray,AsynDigital))
    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 "dbCommon.dbd"
record(WaveformRecord) extends RecordCommon {
    field(value, array([])) {
        asl(0)
        special(yes)
    }
    field(reArm,bool)
    field(io,
        link(inout,interface(
          "LinkArrayOctet",
          "LinkArrayBoolean",
          "LinkArrayInt16",
          "LinkArrayInt32",
          "LinkArrayInt64",
          "LinkArrayFloat32",
          "LinkArrayFloat64",
          "LinkArrayString",
       } ))
    )
    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)
        }
    }
}