Files
pcas/src/std/rec/aiRecord.dbd
2012-09-04 00:40:37 -05:00

400 lines
8.7 KiB
Plaintext

#*************************************************************************
# Copyright (c) 2012 UChicago Argonne LLC, as Operator of Argonne
# National Laboratory.
# Copyright (c) 2002 The Regents of the University of California, as
# Operator of Los Alamos National Laboratory.
# EPICS BASE is distributed subject to a Software License Agreement found
# in file LICENSE that is included with this distribution.
#*************************************************************************
recordtype(ai) {
=head1 Analog Input (ai)
This record type is normally used to obtain an analog value from
a hardware input and convert it to engineering units. The record
supports linear and break-point conversion to engineering units,
smoothing, alarm limits, alarm filtering, and graphics and control
limits.
=head2 Parameter Fields
The record fields are described below grouped by functionality.
=head3 Input Specification
These fields control where (if anywhere) the record reads data from
when it is processed:
=fields INP, DTYP
I<Description?>
=head3 Units Conversion
These fields control how the raw input value gets converted into
engineering units:
=fields RVAL, ROFF, ASLO, AOFF, LINR, ESLO, EOFF, EGUL, EGUF
These fields are not used if the device support layer reads its
value in engineering units and puts it directly into the VAL field.
If the device support sets the RVAL field, the LINR field controls
how this gets converted into engineering units and placed in the
VAL field as follows:
=over 4
=item 1. RVAL is converted to a double and ROFF is added to it
=item 2. If ASLO is non-zero the value is multiplied by ASLO
=item 3. AOFF is added
=item 4. If LINR is C<NO CONVERSION> the units conversion is finished
after the above steps
=item 5. If LINR is C<LINEAR> or C<SLOPE>, the value from step 3
above is multiplied by ESLO and EOFF is added to complete the units
conversion process
=item 6. Any other value for LINR selects a particular breakpoint
table to be used on the value from step 3 above
=back
The distinction between the C<LINEAR> and C<SLOPE> settings for the
LINR field are in how the conversion parameters are calculated:
=over 4
=item *
With C<LINEAR> conversion the user must set EGUL and EGUF to the
lowest and highest possible engineering units values respectively
that can be converted by the hardware. The device support knows
the range of the raw data and calculates ESLO and EOFF from them.
=item *
C<SLOPE> conversion requires the user to calculate the appropriate
scaling and offset factors and put them directly in ESLO and EOFF.
=back
=head3 Smoothing Filter
This filter is usually only used if the device support sets the RVAL
field and the Units Conversion process is used. Device support that
directly sets the VAL field may implement the filter if desired.
The filter is controlled with a single parameter field:
=fields SMOO
The SMOO field should be set to a number between 0 and 1. If set to
zero the filter is not used (no smoothing), while if set to one the
result is infinite smoothing (the VAL field will never change). The
calculation performed is:
VAL = VAL * SMOO + (1 - SMOO) * New Data
where C<New Data> was the result from the Units Conversion above.
This implements a first-order infinite impulse response (IIR)
digital filter with z-plane pole at SMOO. The equivalent
continuous-time filter time constant E<tau> is given by
=over 4
E<tau> = E<minus>T / ln(SMOO)
=back
where T is the time between record processing.
=head3 Undefined Check
If after applying the smoothing filter the VAL field contains a NaN
(Not-a-Number) value, the UDF field is set to indicate that the
record value is undefined, which triggers a C<UDF_ALARM> with
severity C<INVALID_ALARM>.
=fields UDF
=head3 Operator Display Parameters
These parameters are used to present meaningful data to the operator.
=over 4
=item *
DESC is a string that is usually used to briefly describe the record.
=item *
EGU is a string of up to 16 characters giving the units that the
analog input measures.
=item *
The HOPR and LOPR fields set the upper and lower display limits for
the VAL, HIHI, HIGH, LOW, and LOLO fields.
=item *
The PREC field determines the floating point precision with which
to display VAL.
=back
=fields DESC, EGU, HOPR, LOPR, PREC
=head3 Alarm Parameters
...
=fields HIHI, HIGH, LOW, LOLO, HHSV, HSV, LSV, LLSV, HYST, AFTC
=cut
include "dbCommon.dbd"
field(VAL,DBF_DOUBLE) {
prompt("Current EGU Value")
promptgroup(GUI_INPUTS)
asl(ASL0)
pp(TRUE)
}
field(INP,DBF_INLINK) {
prompt("Input Specification")
promptgroup(GUI_INPUTS)
interest(1)
}
field(PREC,DBF_SHORT) {
prompt("Display Precision")
promptgroup(GUI_DISPLAY)
interest(1)
prop(YES)
}
field(LINR,DBF_MENU) {
prompt("Linearization")
promptgroup(GUI_CONVERT)
special(SPC_LINCONV)
pp(TRUE)
interest(1)
menu(menuConvert)
}
field(EGUF,DBF_DOUBLE) {
prompt("Engineer Units Full")
promptgroup(GUI_CONVERT)
special(SPC_LINCONV)
pp(TRUE)
interest(1)
}
field(EGUL,DBF_DOUBLE) {
prompt("Engineer Units Low")
promptgroup(GUI_CONVERT)
special(SPC_LINCONV)
pp(TRUE)
interest(1)
}
field(EGU,DBF_STRING) {
prompt("Engineering Units")
promptgroup(GUI_DISPLAY)
interest(1)
size(16)
prop(YES)
}
field(HOPR,DBF_DOUBLE) {
prompt("High Operating Range")
promptgroup(GUI_DISPLAY)
interest(1)
prop(YES)
}
field(LOPR,DBF_DOUBLE) {
prompt("Low Operating Range")
promptgroup(GUI_DISPLAY)
interest(1)
prop(YES)
}
field(AOFF,DBF_DOUBLE) {
prompt("Adjustment Offset")
promptgroup(GUI_CONVERT)
pp(TRUE)
interest(1)
}
field(ASLO,DBF_DOUBLE) {
prompt("Adjustment Slope")
promptgroup(GUI_CONVERT)
pp(TRUE)
interest(1)
initial("1")
}
field(SMOO,DBF_DOUBLE) {
prompt("Smoothing")
promptgroup(GUI_CONVERT)
interest(1)
}
field(HIHI,DBF_DOUBLE) {
prompt("Hihi Alarm Limit")
promptgroup(GUI_ALARMS)
pp(TRUE)
interest(1)
prop(YES)
}
field(LOLO,DBF_DOUBLE) {
prompt("Lolo Alarm Limit")
promptgroup(GUI_ALARMS)
pp(TRUE)
interest(1)
prop(YES)
}
field(HIGH,DBF_DOUBLE) {
prompt("High Alarm Limit")
promptgroup(GUI_ALARMS)
pp(TRUE)
interest(1)
prop(YES)
}
field(LOW,DBF_DOUBLE) {
prompt("Low Alarm Limit")
promptgroup(GUI_ALARMS)
pp(TRUE)
interest(1)
prop(YES)
}
field(HHSV,DBF_MENU) {
prompt("Hihi Severity")
promptgroup(GUI_ALARMS)
pp(TRUE)
interest(1)
prop(YES)
menu(menuAlarmSevr)
}
field(LLSV,DBF_MENU) {
prompt("Lolo Severity")
promptgroup(GUI_ALARMS)
pp(TRUE)
interest(1)
prop(YES)
menu(menuAlarmSevr)
}
field(HSV,DBF_MENU) {
prompt("High Severity")
promptgroup(GUI_ALARMS)
pp(TRUE)
interest(1)
prop(YES)
menu(menuAlarmSevr)
}
field(LSV,DBF_MENU) {
prompt("Low Severity")
promptgroup(GUI_ALARMS)
pp(TRUE)
interest(1)
prop(YES)
menu(menuAlarmSevr)
}
field(HYST,DBF_DOUBLE) {
prompt("Alarm Deadband")
promptgroup(GUI_ALARMS)
interest(1)
}
field(AFTC,DBF_DOUBLE) {
prompt("Alarm Filter Time Constant")
promptgroup(GUI_ALARMS)
interest(1)
}
field(ADEL,DBF_DOUBLE) {
prompt("Archive Deadband")
promptgroup(GUI_DISPLAY)
interest(1)
}
field(MDEL,DBF_DOUBLE) {
prompt("Monitor Deadband")
promptgroup(GUI_DISPLAY)
interest(1)
}
field(LALM,DBF_DOUBLE) {
prompt("Last Value Alarmed")
special(SPC_NOMOD)
interest(3)
}
field(AFVL,DBF_DOUBLE) {
prompt("Alarm Filter Value")
special(SPC_NOMOD)
interest(3)
}
field(ALST,DBF_DOUBLE) {
prompt("Last Value Archived")
special(SPC_NOMOD)
interest(3)
}
field(MLST,DBF_DOUBLE) {
prompt("Last Val Monitored")
special(SPC_NOMOD)
interest(3)
}
field(ESLO,DBF_DOUBLE) {
prompt("Raw to EGU Slope")
promptgroup(GUI_CONVERT)
pp(TRUE)
interest(2)
initial("1")
}
field(EOFF,DBF_DOUBLE) {
prompt("Raw to EGU Offset")
promptgroup(GUI_CONVERT)
pp(TRUE)
interest(2)
}
field(ROFF,DBF_LONG) {
prompt("Raw Offset, obsolete")
pp(TRUE)
interest(2)
}
field(PBRK,DBF_NOACCESS) {
prompt("Ptrto brkTable")
special(SPC_NOMOD)
interest(4)
extra("void * pbrk")
}
field(INIT,DBF_SHORT) {
prompt("Initialized?")
special(SPC_NOMOD)
interest(3)
}
field(LBRK,DBF_SHORT) {
prompt("LastBreak Point")
special(SPC_NOMOD)
interest(3)
}
field(RVAL,DBF_LONG) {
prompt("Current Raw Value")
pp(TRUE)
}
field(ORAW,DBF_LONG) {
prompt("Previous Raw Value")
special(SPC_NOMOD)
interest(3)
}
field(SIOL,DBF_INLINK) {
prompt("Sim Input Specifctn")
promptgroup(GUI_INPUTS)
interest(1)
}
field(SVAL,DBF_DOUBLE) {
prompt("Simulation Value")
}
field(SIML,DBF_INLINK) {
prompt("Sim Mode Location")
promptgroup(GUI_INPUTS)
interest(1)
}
field(SIMM,DBF_MENU) {
prompt("Simulation Mode")
interest(1)
menu(menuSimm)
}
field(SIMS,DBF_MENU) {
prompt("Sim mode Alarm Svrty")
promptgroup(GUI_INPUTS)
interest(2)
menu(menuAlarmSevr)
}
}