Various POD updates & experiments.
This commit is contained in:
committed by
Ralph Lange
parent
38037f0873
commit
61cc341132
@@ -1,3 +1,42 @@
|
||||
#*************************************************************************
|
||||
# Copyright (c) 2012 The University of Chicago, 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.
|
||||
#*************************************************************************
|
||||
|
||||
=title Array Subroutine Record (aSub)
|
||||
|
||||
...
|
||||
|
||||
=head2 Record-specific Menus
|
||||
|
||||
=head3 Menu aSubLFLG
|
||||
|
||||
The LFLG field uses this menu to ...
|
||||
|
||||
=menu aSubLFLG
|
||||
|
||||
=head3 Menu aSubEFLG
|
||||
|
||||
The EFLG field uses this menu to ...
|
||||
|
||||
=menu aSubEFLG
|
||||
|
||||
...
|
||||
|
||||
=head2 Parameter Fields
|
||||
|
||||
The record-specific fields are described below.
|
||||
|
||||
=recordtype aSub
|
||||
|
||||
...
|
||||
|
||||
=cut
|
||||
|
||||
menu(aSubLFLG) {
|
||||
choice(aSubLFLG_IGNORE,"IGNORE")
|
||||
choice(aSubLFLG_READ,"READ")
|
||||
@@ -191,6 +230,15 @@ recordtype(aSub) {
|
||||
promptgroup(GUI_INPUTS)
|
||||
interest(1)
|
||||
}
|
||||
|
||||
=head3 Input Fields
|
||||
|
||||
...
|
||||
|
||||
=fields A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U
|
||||
|
||||
=cut
|
||||
|
||||
field(A,DBF_NOACCESS) {
|
||||
prompt("Input value A")
|
||||
asl(ASL0)
|
||||
@@ -968,6 +1016,15 @@ recordtype(aSub) {
|
||||
promptgroup(GUI_OUTPUT)
|
||||
interest(1)
|
||||
}
|
||||
|
||||
=head3 Value Fields
|
||||
|
||||
...
|
||||
|
||||
=fields VALA, VALB, VALC, VALD, VALE, VALF, VALG, VALH, VALI, VALJ, VALK, VALL, VALM, VALN, VALO, VALP, VALQ, VALR, VALS, VALT, VALU
|
||||
|
||||
=cut
|
||||
|
||||
field(VALA,DBF_NOACCESS) {
|
||||
prompt("Output value A")
|
||||
asl(ASL0)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#*************************************************************************
|
||||
# Copyright (c) 2012 UChicago Argonne LLC, as Operator of Argonne
|
||||
# Copyright (c) 2013 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.
|
||||
@@ -7,7 +7,7 @@
|
||||
# in file LICENSE that is included with this distribution.
|
||||
#*************************************************************************
|
||||
|
||||
=head1 Analog Input Record (ai)
|
||||
=title Analog Input Record (ai)
|
||||
|
||||
This record type is normally used to obtain an analog value from a hardware
|
||||
input and convert it to engineering units.
|
||||
@@ -63,32 +63,26 @@ fairly common for GPIB and similar high-level device interfaces.
|
||||
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
|
||||
=over
|
||||
|
||||
=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.
|
||||
|
||||
@@ -97,7 +91,7 @@ value from step 3 above.
|
||||
The distinction between the C<LINEAR> and C<SLOPE> settings for the LINR field
|
||||
are in how the conversion parameters are calculated:
|
||||
|
||||
=over 4
|
||||
=over
|
||||
|
||||
=item *
|
||||
With C<LINEAR> conversion the user must set EGUL and EGUF to the lowest and
|
||||
@@ -128,7 +122,7 @@ 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:
|
||||
|
||||
=over 4
|
||||
=over
|
||||
|
||||
VAL = VAL * SMOO + (1 - SMOO) * New Data
|
||||
|
||||
@@ -139,7 +133,7 @@ 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
|
||||
=over
|
||||
|
||||
E<tau> = E<minus>T / ln(SMOO)
|
||||
|
||||
@@ -161,18 +155,18 @@ C<INVALID_ALARM>.
|
||||
These parameters are used to present meaningful data to the operator.
|
||||
They do not affect the functioning of the record at all.
|
||||
|
||||
=over 4
|
||||
=over
|
||||
|
||||
=item *
|
||||
DESC is a string that is usually used to briefly describe the record.
|
||||
|
||||
=item *
|
||||
EGU is a string of up to 16 characters naming the engineering units that the
|
||||
VAL field represents.
|
||||
EGU is a string of up to 16 characters naming the engineering units that the VAL
|
||||
field represents.
|
||||
|
||||
=item *
|
||||
The HOPR and LOPR fields set the upper and lower display limits for
|
||||
the VAL, HIHI, HIGH, LOW, and LOLO fields.
|
||||
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 (i.e. the number of
|
||||
@@ -188,9 +182,11 @@ DOUBLE fields.
|
||||
The user configures limit alarms by putting numerical values into the HIHI,
|
||||
HIGH, LOW and LOLO fields, and by setting the associated alarm severity in the
|
||||
corresponding HHSV, HSV, LSV and LLSV menu fields.
|
||||
|
||||
The HYST field controls hysteresis to prevent alarm chattering from an input
|
||||
signal that is close to one of the limits and suffers from significant readout
|
||||
noise.
|
||||
|
||||
The AFTC field sets the time constant on a low-pass filter that delays the
|
||||
reporting of limit alarms until the signal has been within the alarm range for
|
||||
that number of seconds (the default AFTC value of zero retains the previous
|
||||
@@ -207,6 +203,7 @@ by the appropriate deadband.
|
||||
If these fields are set to zero, a monitor will be triggered every time the
|
||||
value changes; if set to -1, a monitor will be sent every time the record is
|
||||
processed.
|
||||
|
||||
The ADEL field sets the deadband for archive monitors (C<DBE_LOG> events), while
|
||||
the MDEL field controls value monitors (C<DBE_VALUE> events).
|
||||
|
||||
@@ -444,7 +441,7 @@ The record provides several fields to support simulation of absent hardware.
|
||||
If the SIML field is set it is used to read a value into the SIMM field, which
|
||||
controls whether simulation is used or not:
|
||||
|
||||
=over 4
|
||||
=over
|
||||
|
||||
=item *
|
||||
SIMM must be zero (C<NO>) for the record to request a value from the device
|
||||
@@ -518,6 +515,7 @@ Most device supports also provide an C<init_record()> routine to configure the
|
||||
record instance and connect it to the hardware or driver support layer, and if
|
||||
using the record's L</Units Conversion> features they set C<special_linconv()>
|
||||
as well.
|
||||
|
||||
The individual routines are described below.
|
||||
|
||||
=head3 Device Support Routines
|
||||
@@ -576,8 +574,9 @@ value to its caller.
|
||||
In most cases the device support will create the I/O Interrupt Scan lists that
|
||||
it returns for itself, by calling C<void scanIoInit(IOSCANPVT *piosl)> once for
|
||||
each separate interrupt source.
|
||||
That API allocates memory and inializes the list, then passes back a pointer to
|
||||
the new list in the location at C<*piosl>.
|
||||
That routine allocates memory and inializes the list, then passes back a pointer
|
||||
to the new list in the location at C<*piosl>.
|
||||
|
||||
When the device support receives notification that the interrupt has occurred,
|
||||
it announces that to the IOC by calling C<void scanIoRequest(IOSCANPVT iosl)>
|
||||
which will arrange for the appropriate records to be processed in a suitable
|
||||
@@ -587,9 +586,10 @@ on embedded architectures (vxWorks and RTEMS).
|
||||
|
||||
=head4 long read_ai(aiRecord *prec)
|
||||
|
||||
This essential routine is called whenever the record is processed, and is
|
||||
responsible for performing (or at least initiating) a read operation for the
|
||||
addressed device and (eventually) returning its value to the record.
|
||||
This essential routine is called when the record wants a new value from the
|
||||
addressed device.
|
||||
It is responsible for performing (or at least initiating) a read operation, and
|
||||
(eventually) returning its value to the record.
|
||||
|
||||
... PACT and asynchronous processing ...
|
||||
|
||||
@@ -609,9 +609,10 @@ These calculations can be expressed in terms of the minimum and maximum raw
|
||||
values that the C<read_ai()> routine can put in the RVAL field.
|
||||
When RVAL is set to I<RVAL_max> the VAL field will be set to EGUF, and when RVAL
|
||||
is set to I<RVAL_min> the VAL field will become EGUL.
|
||||
|
||||
The fomulae to use are:
|
||||
|
||||
=over 4
|
||||
=over
|
||||
|
||||
EOFF = (I<RVAL_max> * EGUL E<minus> I<RVAL_min> * EGUF) /
|
||||
(I<RVAL_max> E<minus> I<RVAL_min>)
|
||||
@@ -621,7 +622,7 @@ ESLO = (EGUF E<minus> EGUL) / (I<RVAL_max> E<minus> I<RVAL_min>)
|
||||
=back
|
||||
|
||||
Note that the record support sets EOFF to EGUL before calling this routine,
|
||||
which is a very common case (I<RVAL_min> is zero).
|
||||
which is a very common case (when I<RVAL_min> is zero).
|
||||
|
||||
=head3 Extended Device Support
|
||||
|
||||
|
||||
@@ -1,308 +0,0 @@
|
||||
#*************************************************************************
|
||||
# Copyright (c) 2002 The University of Chicago, 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 Versions 3.13.7
|
||||
# and higher are distributed subject to a Software License Agreement found
|
||||
# in file LICENSE that is included with this distribution.
|
||||
#*************************************************************************
|
||||
menu(aoOIF) {
|
||||
choice(aoOIF_Full,"Full")
|
||||
choice(aoOIF_Incremental,"Incremental")
|
||||
}
|
||||
recordtype(ao) {
|
||||
include "dbCommon.dbd"
|
||||
field(VAL,DBF_DOUBLE) {
|
||||
prompt("Desired Output")
|
||||
promptgroup(GUI_OUTPUT)
|
||||
asl(ASL0)
|
||||
pp(TRUE)
|
||||
}
|
||||
field(OVAL,DBF_DOUBLE) {
|
||||
prompt("Output Value")
|
||||
}
|
||||
field(OUT,DBF_OUTLINK) {
|
||||
prompt("Output Specification")
|
||||
promptgroup(GUI_OUTPUT)
|
||||
interest(1)
|
||||
}
|
||||
field(OROC,DBF_DOUBLE) {
|
||||
prompt("Output Rate of Chang")
|
||||
promptgroup(GUI_OUTPUT)
|
||||
interest(1)
|
||||
}
|
||||
field(DOL,DBF_INLINK) {
|
||||
prompt("Desired Output Loc")
|
||||
promptgroup(GUI_OUTPUT)
|
||||
interest(1)
|
||||
}
|
||||
field(OMSL,DBF_MENU) {
|
||||
prompt("Output Mode Select")
|
||||
promptgroup(GUI_OUTPUT)
|
||||
interest(1)
|
||||
menu(menuOmsl)
|
||||
}
|
||||
field(OIF,DBF_MENU) {
|
||||
prompt("Out Full/Incremental")
|
||||
promptgroup(GUI_OUTPUT)
|
||||
interest(1)
|
||||
menu(aoOIF)
|
||||
}
|
||||
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("Eng Units Full")
|
||||
promptgroup(GUI_CONVERT)
|
||||
special(SPC_LINCONV)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
}
|
||||
field(EGUL,DBF_DOUBLE) {
|
||||
prompt("Eng 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(ROFF,DBF_LONG) {
|
||||
prompt("Raw Offset, obsolete")
|
||||
pp(TRUE)
|
||||
interest(2)
|
||||
}
|
||||
field(EOFF,DBF_DOUBLE) {
|
||||
prompt("EGU to Raw Offset")
|
||||
promptgroup(GUI_CONVERT)
|
||||
pp(TRUE)
|
||||
interest(2)
|
||||
}
|
||||
field(ESLO,DBF_DOUBLE) {
|
||||
prompt("EGU to Raw Slope")
|
||||
promptgroup(GUI_CONVERT)
|
||||
pp(TRUE)
|
||||
interest(2)
|
||||
initial("1")
|
||||
}
|
||||
field(DRVH,DBF_DOUBLE) {
|
||||
prompt("Drive High Limit")
|
||||
promptgroup(GUI_OUTPUT)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
prop(YES)
|
||||
}
|
||||
field(DRVL,DBF_DOUBLE) {
|
||||
prompt("Drive Low Limit")
|
||||
promptgroup(GUI_OUTPUT)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
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)
|
||||
}
|
||||
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(ADEL,DBF_DOUBLE) {
|
||||
prompt("Archive Deadband")
|
||||
promptgroup(GUI_DISPLAY)
|
||||
interest(1)
|
||||
}
|
||||
field(MDEL,DBF_DOUBLE) {
|
||||
prompt("Monitor Deadband")
|
||||
promptgroup(GUI_DISPLAY)
|
||||
interest(1)
|
||||
}
|
||||
field(RVAL,DBF_LONG) {
|
||||
prompt("Current Raw Value")
|
||||
pp(TRUE)
|
||||
}
|
||||
field(ORAW,DBF_LONG) {
|
||||
prompt("Previous Raw Value")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(RBV,DBF_LONG) {
|
||||
prompt("Readback Value")
|
||||
special(SPC_NOMOD)
|
||||
}
|
||||
field(ORBV,DBF_LONG) {
|
||||
prompt("Prev Readback Value")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(PVAL,DBF_DOUBLE) {
|
||||
prompt("Previous value")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(LALM,DBF_DOUBLE) {
|
||||
prompt("Last Value Alarmed")
|
||||
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(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(SIOL,DBF_OUTLINK) {
|
||||
prompt("Sim Output Specifctn")
|
||||
promptgroup(GUI_INPUTS)
|
||||
interest(1)
|
||||
}
|
||||
field(SIML,DBF_INLINK) {
|
||||
prompt("Sim Mode Location")
|
||||
promptgroup(GUI_INPUTS)
|
||||
interest(1)
|
||||
}
|
||||
field(SIMM,DBF_MENU) {
|
||||
prompt("Simulation Mode")
|
||||
interest(1)
|
||||
menu(menuYesNo)
|
||||
}
|
||||
field(SIMS,DBF_MENU) {
|
||||
prompt("Sim mode Alarm Svrty")
|
||||
promptgroup(GUI_INPUTS)
|
||||
interest(2)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(IVOA,DBF_MENU) {
|
||||
prompt("INVALID output action")
|
||||
promptgroup(GUI_OUTPUT)
|
||||
interest(2)
|
||||
menu(menuIvoa)
|
||||
}
|
||||
field(IVOV,DBF_DOUBLE) {
|
||||
prompt("INVALID output value")
|
||||
promptgroup(GUI_OUTPUT)
|
||||
interest(2)
|
||||
}
|
||||
field(OMOD,DBF_UCHAR) {
|
||||
prompt("Was OVAL modified?")
|
||||
special(SPC_NOMOD)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,917 @@
|
||||
#*************************************************************************
|
||||
# Copyright (c) 2013 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.
|
||||
#*************************************************************************
|
||||
|
||||
=title Analog Output Record (ao)
|
||||
|
||||
This record type is normally used to send an analog value to an output device,
|
||||
converting it from engineering units into an integer value if necessary.
|
||||
The record supports alarm and drive limits, rate-of-change limiting, output
|
||||
value integration, linear and break-point conversion from engineering units, and
|
||||
graphics and control limits.
|
||||
|
||||
=head2 Record-specific Menus
|
||||
|
||||
=head3 Menu aoOIF
|
||||
|
||||
The OIF field which uses this menu controls whether the record acts as an
|
||||
integrator (C<Incremental>) or not (C<Full>).
|
||||
|
||||
=menu aoOIF
|
||||
|
||||
=head2 Parameter Fields
|
||||
|
||||
The record-specific fields are described below.
|
||||
|
||||
=recordtype ao
|
||||
|
||||
=cut
|
||||
|
||||
menu(aoOIF) {
|
||||
choice(aoOIF_Full,"Full")
|
||||
choice(aoOIF_Incremental,"Incremental")
|
||||
}
|
||||
|
||||
recordtype(ao) {
|
||||
|
||||
=head3 Output Value Determination
|
||||
|
||||
These fields control how the record determines the value to be output when it
|
||||
gets processed:
|
||||
|
||||
=fields OMSL, DOL, OIF, PVAL, DRVH, DRVL, VAL, OROC, OVAL
|
||||
|
||||
The following steps are performed in order during record processing.
|
||||
|
||||
=head4 Fetch Value, Integrate
|
||||
|
||||
The OMSL menu field is used to determine whether the DOL link and OIF menu
|
||||
fields should be used during processing or not:
|
||||
|
||||
=over
|
||||
|
||||
=item *
|
||||
If OMSL is C<supervisory> the DOL and OIF fields are not used.
|
||||
The new output value is taken from the VAL field, which may have been set from
|
||||
elsewhere.
|
||||
|
||||
=item *
|
||||
If OMSL is C<closed_loop> the DOL link field is read to obtain a value; if OIF
|
||||
is C<Incremental> and the DOL link was read successfully, the record's previous
|
||||
output value PVAL is added to it.
|
||||
|
||||
=back
|
||||
|
||||
=head4 Drive Limits
|
||||
|
||||
The output value is now clipped to the range DRVL to DRVH inclusive, provided
|
||||
that DRVH > DRVL.
|
||||
The result is copied into both the VAL and PVAL fields.
|
||||
|
||||
=head4 Limit Rate of Change
|
||||
|
||||
If the OROC field is not zero, the VAL field is now adjusted so it is no more
|
||||
than OROC different to the previous output value given in OVAL.
|
||||
OROC thus determines the maximum change in the output value that can occur each
|
||||
time the record gets processed.
|
||||
The result is copied into the OVAL field, which is used as the input to the
|
||||
following Units Conversion processing stage.
|
||||
|
||||
=head3 Units Conversion
|
||||
|
||||
...
|
||||
|
||||
|
||||
For analog output records that do not use the Soft Channel device support
|
||||
routine, the specified conversions (if any) are performed on the OVAL field and
|
||||
the resulting value in the RVAL field is sent to the address contained in the
|
||||
output link after it is adjusted by the values in the AOFF and ASLO fields.
|
||||
|
||||
=fields LINR, RVAL, ROFF, EGUF, EGUL, AOFF, ASLO, ESLO, EOFF
|
||||
|
||||
=head4 Conversion Related Fields and the Conversion Process
|
||||
|
||||
Except for analog outputs that use Soft Channel device support, the LINR field
|
||||
determines if a conversion is performed and which conversion algorithm is used
|
||||
to convert OVAL to RVAL.
|
||||
|
||||
The LINR field can specify C<LINEAR> or C<SLOPE> for linear conversions,
|
||||
C<NO CONVERSION> for no conversions at all, or the name of a breakpoint table
|
||||
such as C<typeKdegC> for breakpoint conversions.
|
||||
|
||||
Note that the ESLO, EOFF, EGUF, and EGUL fields are only used for linear
|
||||
conversions.
|
||||
Also note that none of these fields have any significance for records that use
|
||||
the Soft Channel device support module.
|
||||
|
||||
=over
|
||||
|
||||
=item EGUF, EGUF
|
||||
|
||||
The user must calculate these fields when configuring the database for records
|
||||
that use C<LINEAR> conversions.
|
||||
They are used to calculate the values for ESLO and EOFF.
|
||||
See Conversion Specification for more information on how to calculate these
|
||||
fields.
|
||||
|
||||
=item AOFF, ASLO
|
||||
|
||||
These fields are adjustment parameters for the raw output values.
|
||||
They are applied to the raw output value after conversion from engineering
|
||||
units.
|
||||
|
||||
=item ESLO, EOFF
|
||||
|
||||
Computed by device support using EGUF and EGUL when LINR specifies C<LINEAR>.
|
||||
These values must be supplied by the user when LINR specifies C<SLOPE>.
|
||||
Used only when LINR is C<LINEAR> or C<SLOPE>.
|
||||
|
||||
=item ROFF
|
||||
|
||||
This field can be used to offset the raw value generated by the conversion
|
||||
process, which is needed for some kinds of hardware.
|
||||
|
||||
=back
|
||||
|
||||
Conversion proceeds as follows:
|
||||
|
||||
=over
|
||||
|
||||
=item 1. If LINR==LINEAR or LINR==SLOPE, then X = (VAL - EOFF) / ESLO,
|
||||
else if LINR==NO_CONVERSION, then X = VAL,
|
||||
else X is obtained via breakpoint table.
|
||||
|
||||
=item 2. X = (X - AOFF) / ASLO
|
||||
|
||||
=item 3. RVAL = round(X) - ROFF
|
||||
|
||||
=back
|
||||
|
||||
To see how the Raw Soft Channel device support routine uses these
|
||||
fields, see L</Device Support For Soft Records> below for more
|
||||
information.
|
||||
|
||||
=head3 Output Specification
|
||||
|
||||
The analog output record sends its desired output to the address in the
|
||||
OUT field. For analog outputs that write their values to devices, the
|
||||
OUT field must specify the address of the I/O card. In addition, the
|
||||
DTYP field must contain the name of the device support module. Be aware
|
||||
that the address format differs according to the I/O bus used. See
|
||||
Address Specification for information on the format of hardware
|
||||
addresses. The user can see a list of the device support modules
|
||||
currently supported at the user's local site by using the dbst utility
|
||||
in R3.13.
|
||||
|
||||
For soft records the output link can be a database link, a channel
|
||||
access link, or a constant value. If the link is a constant, no output
|
||||
is sent. See Address Specification for information on the format of
|
||||
database and channel access addresses.
|
||||
|
||||
=fields DTYP, OUT
|
||||
|
||||
=head3 Operator Display Parameters
|
||||
|
||||
These parameters are used to present meaningful data to the operator.
|
||||
They display the value and other parameters of the analog output either
|
||||
textually or graphically.
|
||||
|
||||
EGU is a string of up to 16 characters describing the units that the
|
||||
analog output measures. It is retrieved by the get_units record support
|
||||
routine.
|
||||
|
||||
The HOPR and LOPR fields set the upper and lower display limits for the
|
||||
VAL, OVAL, PVAL, HIHI, HIGH, LOW, and LOLO fields. Both the
|
||||
get_graphic_double and get_control_double record support routines
|
||||
retrieve these fields. If these values are defined, they must be in the
|
||||
range: DRVL E<lt>= LOPR E<lt>= HOPR E<lt>= DRVH.
|
||||
|
||||
The PREC field determines the floating point precision with which to
|
||||
display VAL, OVAL and PVAL. It is used whenever the get_precision
|
||||
record support routine is called.
|
||||
|
||||
See Fields Common to All Record Types for more on the record name
|
||||
(NAME) and description (DESC) fields.
|
||||
|
||||
=fields EGU, HOPR, LOPR, PREC, NAME, DESC
|
||||
|
||||
=head3 Alarm Parameters
|
||||
|
||||
The possible alarm conditions for analog outputs are the SCAN, READ,
|
||||
INVALID and limit alarms. The SCAN, READ, and INVALID alarms are called
|
||||
by the record or device support routines.
|
||||
|
||||
The limit alarms are configured by the user in the HIHI, LOLO, HIGH,
|
||||
and LOW fields, which must be floating-point values. For each of these
|
||||
fields, there is a corresponding severity field which can be either
|
||||
NO_ALARM, MINOR, or MAJOR.
|
||||
|
||||
See Alarm Specification for a complete explanation of alarms and these
|
||||
fields. See Invalid Alarm Output Action for more information on the
|
||||
IVOA and IVOV fields. Alarm Fields lists other fields related to a
|
||||
alarms that are common to all record types.
|
||||
|
||||
=fields HIHI, HIGH, LOW, LOLO, HHSV, HSV, LSV, LLSV, HYST, IVOA, IVOV
|
||||
|
||||
=head3 Monitor Parameters
|
||||
|
||||
These parameters are used to specify deadbands for monitors on the VAL
|
||||
field. The monitors are sent when the value field exceeds the last
|
||||
monitored field by the specified deadband. If these fields have a value
|
||||
of zero, everytime the value changes, a monitor will be triggered; if
|
||||
they have a value of -1, everytime the record is processed, monitors
|
||||
are triggered. ADEL is the deadband for archive monitors, and MDEL the
|
||||
deadband for all other types of monitors. See Monitor Specification for
|
||||
a complete explanation of monitors.
|
||||
|
||||
=fields ADEL, MDEL
|
||||
|
||||
=head3 Run-time and Simulation Mode Parameters
|
||||
|
||||
These parameters are used by the run-time code for processing the
|
||||
analog output. They are not configurable. They represent the current
|
||||
state of the record. The record support routines use some of them for
|
||||
more efficient processing.
|
||||
|
||||
The ORAW field is used to decide if monitors should be triggered for
|
||||
RVAL when monitors are triggered for VAL. The RBV field is the actual
|
||||
read back value obtained from the hardware itself or from the
|
||||
associated device driver. It is the responsibility of the device
|
||||
support routine to give this field a value.
|
||||
|
||||
ORBV is used to decide if monitors should be triggered for RBV at the
|
||||
same time monitors are triggered for changes in VAL.
|
||||
|
||||
The LALM, MLST, and ALST fields are used to implement the hysteresis
|
||||
factors for monitor callbacks.
|
||||
|
||||
The INIT field is used to initialize the LBRK field and for smoothing.
|
||||
|
||||
The PBRK field contains a pointer to the current breakpoint table (if
|
||||
any), and LBRK contains a pointer to the last breakpoint table used.
|
||||
|
||||
The OMOD field indicates whether OVAL differs from VAL. It will be
|
||||
different if VAL or OVAL have changed since the last time the record
|
||||
was processed, or if VAL has been adjusted by OROC during the current
|
||||
processing.
|
||||
|
||||
=fields ORAW, RBV, ORBV, LALM, ALST, MLST, INIT, PBRK, LBRK, PVAL, OMOD
|
||||
|
||||
The following fields are used to operate the analog output in the
|
||||
simulation mode. See Fields Common to Many Record Types for more
|
||||
information on these fields.
|
||||
|
||||
=fields SIOL, SIML, SIMM, SIMS
|
||||
|
||||
=cut
|
||||
|
||||
include "dbCommon.dbd"
|
||||
field(VAL,DBF_DOUBLE) {
|
||||
prompt("Desired Output")
|
||||
promptgroup(GUI_OUTPUT)
|
||||
asl(ASL0)
|
||||
pp(TRUE)
|
||||
}
|
||||
field(OVAL,DBF_DOUBLE) {
|
||||
prompt("Output Value")
|
||||
}
|
||||
field(OUT,DBF_OUTLINK) {
|
||||
prompt("Output Specification")
|
||||
promptgroup(GUI_OUTPUT)
|
||||
interest(1)
|
||||
}
|
||||
field(OROC,DBF_DOUBLE) {
|
||||
prompt("Output Rate of Change")
|
||||
promptgroup(GUI_OUTPUT)
|
||||
interest(1)
|
||||
}
|
||||
field(DOL,DBF_INLINK) {
|
||||
prompt("Desired Output Loc")
|
||||
promptgroup(GUI_OUTPUT)
|
||||
interest(1)
|
||||
}
|
||||
field(OMSL,DBF_MENU) {
|
||||
prompt("Output Mode Select")
|
||||
promptgroup(GUI_OUTPUT)
|
||||
interest(1)
|
||||
menu(menuOmsl)
|
||||
}
|
||||
field(OIF,DBF_MENU) {
|
||||
prompt("Out Full/Incremental")
|
||||
promptgroup(GUI_OUTPUT)
|
||||
interest(1)
|
||||
menu(aoOIF)
|
||||
}
|
||||
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("Eng Units Full")
|
||||
promptgroup(GUI_CONVERT)
|
||||
special(SPC_LINCONV)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
}
|
||||
field(EGUL,DBF_DOUBLE) {
|
||||
prompt("Eng 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(ROFF,DBF_LONG) {
|
||||
prompt("Raw Offset, obsolete")
|
||||
pp(TRUE)
|
||||
interest(2)
|
||||
}
|
||||
field(EOFF,DBF_DOUBLE) {
|
||||
prompt("EGU to Raw Offset")
|
||||
promptgroup(GUI_CONVERT)
|
||||
pp(TRUE)
|
||||
interest(2)
|
||||
}
|
||||
field(ESLO,DBF_DOUBLE) {
|
||||
prompt("EGU to Raw Slope")
|
||||
promptgroup(GUI_CONVERT)
|
||||
pp(TRUE)
|
||||
interest(2)
|
||||
initial("1")
|
||||
}
|
||||
field(DRVH,DBF_DOUBLE) {
|
||||
prompt("Drive High Limit")
|
||||
promptgroup(GUI_OUTPUT)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
prop(YES)
|
||||
}
|
||||
field(DRVL,DBF_DOUBLE) {
|
||||
prompt("Drive Low Limit")
|
||||
promptgroup(GUI_OUTPUT)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
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)
|
||||
}
|
||||
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(ADEL,DBF_DOUBLE) {
|
||||
prompt("Archive Deadband")
|
||||
promptgroup(GUI_DISPLAY)
|
||||
interest(1)
|
||||
}
|
||||
field(MDEL,DBF_DOUBLE) {
|
||||
prompt("Monitor Deadband")
|
||||
promptgroup(GUI_DISPLAY)
|
||||
interest(1)
|
||||
}
|
||||
field(RVAL,DBF_LONG) {
|
||||
prompt("Current Raw Value")
|
||||
pp(TRUE)
|
||||
}
|
||||
field(ORAW,DBF_LONG) {
|
||||
prompt("Previous Raw Value")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(RBV,DBF_LONG) {
|
||||
prompt("Readback Value")
|
||||
special(SPC_NOMOD)
|
||||
}
|
||||
field(ORBV,DBF_LONG) {
|
||||
prompt("Prev Readback Value")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(PVAL,DBF_DOUBLE) {
|
||||
prompt("Previous value")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(LALM,DBF_DOUBLE) {
|
||||
prompt("Last Value Alarmed")
|
||||
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(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(SIOL,DBF_OUTLINK) {
|
||||
prompt("Sim Output Specifctn")
|
||||
promptgroup(GUI_INPUTS)
|
||||
interest(1)
|
||||
}
|
||||
field(SIML,DBF_INLINK) {
|
||||
prompt("Sim Mode Location")
|
||||
promptgroup(GUI_INPUTS)
|
||||
interest(1)
|
||||
}
|
||||
field(SIMM,DBF_MENU) {
|
||||
prompt("Simulation Mode")
|
||||
interest(1)
|
||||
menu(menuYesNo)
|
||||
}
|
||||
field(SIMS,DBF_MENU) {
|
||||
prompt("Sim mode Alarm Svrty")
|
||||
promptgroup(GUI_INPUTS)
|
||||
interest(2)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(IVOA,DBF_MENU) {
|
||||
prompt("INVALID output action")
|
||||
promptgroup(GUI_OUTPUT)
|
||||
interest(2)
|
||||
menu(menuIvoa)
|
||||
}
|
||||
field(IVOV,DBF_DOUBLE) {
|
||||
prompt("INVALID output value")
|
||||
promptgroup(GUI_OUTPUT)
|
||||
interest(2)
|
||||
}
|
||||
field(OMOD,DBF_UCHAR) {
|
||||
prompt("Was OVAL modified?")
|
||||
special(SPC_NOMOD)
|
||||
}
|
||||
}
|
||||
|
||||
=head2 Record Support
|
||||
|
||||
=head3 Record Support Routines
|
||||
|
||||
The following are the record support routines that would be of interest
|
||||
to an application developer. Other routines are the get_units,
|
||||
get_precision, get_graphic_double, and get_control_double routines.
|
||||
|
||||
=over
|
||||
|
||||
=item init_record
|
||||
|
||||
This routine initializes SIMM if SIML is a constant or creates a
|
||||
channel access link if SIML is PV_LINK. If SIOL is PV_LINK a channel
|
||||
access link is created.
|
||||
|
||||
This routine next checks to see that device support is available. If
|
||||
DOL is a constant, then VAL is initialized with its value and UDF is
|
||||
set to FALSE.
|
||||
|
||||
The routine next checks to see if the device support write routine is
|
||||
defined. If either device support or the device support write routine
|
||||
does not exist, an error message is issued and processing is
|
||||
terminated.
|
||||
|
||||
For compatibility with old device supports that don't know EOFF, if
|
||||
both EOFF and ESLO have their default value, EOFF is set to EGUL.
|
||||
|
||||
If device support includes init_record, it is called.
|
||||
|
||||
INIT is set TRUE. This causes PBRK, LBRK, and smoothing to be
|
||||
re-initialized. If "backwards" linear conversion is requested, then VAL
|
||||
is computed from RVAL using the algorithm:
|
||||
|
||||
VAL = ((RVAL+ROFF) * ASLO + AOFF) * ESLO + EOFF
|
||||
|
||||
and UDF is set to FALSE.
|
||||
|
||||
For breakpoint conversion, a call is made to cvtEngToRawBpt and UDF is
|
||||
then set to FALSE. PVAL is set to VAL.
|
||||
|
||||
=item process
|
||||
|
||||
See next section.
|
||||
|
||||
=item special
|
||||
|
||||
The only special processing for analog output records is SPC_LINCONV
|
||||
which is invoked whenever either of the fields LINR, EGUF, EGUL or ROFF
|
||||
is changed If the device support routine special_linconv exists it is
|
||||
called.
|
||||
|
||||
INIT is set TRUE. This causes PBRK, LBRK, and smoothing to be
|
||||
re-initialized.
|
||||
|
||||
=item get_value
|
||||
|
||||
Fills in the values of struct valueDes so that they refer to VAL.
|
||||
|
||||
=item get_alarm_double
|
||||
|
||||
Sets the following values:
|
||||
|
||||
upper_alarm_limit = HIHI
|
||||
upper_warning_limit = HIGH
|
||||
lower_warning_limit = LOW
|
||||
lower_alarm_limit = LOLO
|
||||
|
||||
=back
|
||||
|
||||
=head3 Record Processing
|
||||
|
||||
Routine process implements the following algorithm:
|
||||
|
||||
=over
|
||||
|
||||
=item 1. Check to see that the appropriate device support module
|
||||
exists. If it doesn't, an error message is issued and processing is
|
||||
terminated with the PACT field set to TRUE. This ensures that processes
|
||||
will no longer be called for this record. Thus error storms will not
|
||||
occur.
|
||||
|
||||
=item 2. Check PACT: If PACT is FALSE call fetch_values and convert
|
||||
which perform the following steps:
|
||||
|
||||
=over
|
||||
|
||||
=item * fetch_values:
|
||||
|
||||
=over
|
||||
|
||||
=item * if DOL is DB_LINK and OMSL is CLOSED_LOOP then get value from
|
||||
DOL
|
||||
|
||||
=item * if OIF is INCREMENTAL then set value = value + VAL else value =
|
||||
VAL
|
||||
|
||||
=back
|
||||
|
||||
=item * convert:
|
||||
|
||||
=over
|
||||
|
||||
=item * If Drive limits are defined force value to be within limits
|
||||
|
||||
=item * Set VAL equal to value
|
||||
|
||||
=item * Set UDF to FALSE.
|
||||
|
||||
=item * If OVAL is undefined set it equal to value
|
||||
|
||||
=item * If OROC is defined and not 0 make |value-OVAL| E<lt>=OROC
|
||||
|
||||
=item * Set OVAL equal to value
|
||||
|
||||
=item * Compute RVAL from OVAL. using linear or break point table
|
||||
conversion. For linear conversions the algorithm is RVAL =
|
||||
(OVAL-EOFF)/ESLO.
|
||||
|
||||
=item * For break point table conversion a call is made to
|
||||
cvtEngToRawBpt.
|
||||
|
||||
=item * After that, for all conversion types AOFF, ASLO, and ROFF are
|
||||
calculated in, using the formula RVAL = (RVAL -AOFF) / ASLO - ROFF.
|
||||
|
||||
=back
|
||||
|
||||
=back
|
||||
|
||||
=item 3. Check alarms: This routine checks to see if the new VAL causes
|
||||
the alarm status and severity to change. If so, NSEV, NSTA and y are
|
||||
set. It also honors the alarm hysteresis factor (HYST). Thus the value
|
||||
must change by at least HYST before the alarm status and severity is
|
||||
reduced.
|
||||
|
||||
=item 4. Check severity and write the new value. See Invalid Alarm
|
||||
Output Action for details on how invalid alarms affect output records.
|
||||
|
||||
=item 5. If PACT has been changed to TRUE, the device support write
|
||||
output routine has started but has not completed writing the new value.
|
||||
In this case, the processing routine merely returns, leaving PACT TRUE.
|
||||
|
||||
=item 6. Check to see if monitors should be invoked:
|
||||
|
||||
=over
|
||||
|
||||
=item * Alarm monitors are invoked if the alarm status or severity has
|
||||
changed.
|
||||
|
||||
=item * Archive and value change monitors are invoked if ADEL and MDEL
|
||||
conditions are met.
|
||||
|
||||
=item * Monitors for RVAL and for RBV are checked whenever other
|
||||
monitors are invoked.
|
||||
|
||||
=item * NSEV and NSTA are reset to 0.
|
||||
|
||||
=back
|
||||
|
||||
=item 7. Scan forward link if necessary, set PACT and INIT FALSE, and
|
||||
return.
|
||||
|
||||
=back
|
||||
|
||||
=head2 Device Support
|
||||
|
||||
=head3 Fields Of Interest To Device Support
|
||||
|
||||
Each analog output record must have an associated set of device support
|
||||
routines. The primary responsibility of the device support routines is
|
||||
to output a new value whenever write_ao is called. The device support
|
||||
routines are primarily interested in the following fields:
|
||||
|
||||
=over
|
||||
|
||||
=item *
|
||||
PACT E<mdash> Process Active, used to indicate asynchronous completion
|
||||
|
||||
=item *
|
||||
DPVT E<mdash> Device Private, reserved for device support to use
|
||||
|
||||
=item *
|
||||
OUT E<mdash> Output Link, provides addressing information
|
||||
|
||||
=item *
|
||||
EGUF E<mdash> Engineering Units Full
|
||||
|
||||
=item *
|
||||
EGUL E<mdash> Engineering Units Low
|
||||
|
||||
=item *
|
||||
ESLO E<mdash> Engineering Unit Slope
|
||||
|
||||
=item *
|
||||
EOFF E<mdash> Engineering Unit Offset
|
||||
|
||||
=item *
|
||||
OVAL E<mdash> Output Value, in Engineering units
|
||||
|
||||
=item *
|
||||
RVAL E<mdash> Raw Output Value, after conversion
|
||||
|
||||
=back
|
||||
|
||||
=head3 Device Support routines
|
||||
|
||||
Device support consists of the following routines:
|
||||
|
||||
=over
|
||||
|
||||
=item C<long report(int level)>
|
||||
|
||||
This optional routine is called by the IOC command C<dbior> and is passed the
|
||||
report level that was requested by the user.
|
||||
It should print a report on the state of the device support to stdout.
|
||||
The C<level> parameter may be used to output increasingly more detailed
|
||||
information at higher levels, or to select different types of information with
|
||||
different levels.
|
||||
Level zero should print no more than a small summary.
|
||||
|
||||
=item C<long init(int after)>
|
||||
|
||||
This optional routine is called twice at IOC initialization time.
|
||||
The first call happens before any of the C<init_record()> calls are made, with
|
||||
the integer parameter C<after> set to 0.
|
||||
The second call happens after all of the C<init_record()> calls have been made,
|
||||
with C<after> set to 1.
|
||||
|
||||
=item C<long init_record(aoRecord *prec)>
|
||||
|
||||
This optional routine is called by the record initialization code for each ao
|
||||
record instance that has its DTYP field set to use this device support.
|
||||
It is normally used to check that the OUT address has the expected type and
|
||||
points to a valid device; to allocate any record-specific buffer space and
|
||||
other memory; and to connect any communication channels needed for the
|
||||
C<write_ao()> routine to work properly.
|
||||
|
||||
If the record type's unit conversion features are used, the C<init_record()>
|
||||
routine should calculate appropriate values for the ESLO and EOFF fields from
|
||||
the EGUL and EGUF field values.
|
||||
This calculation only has to be performed if the record's LINR field is set to
|
||||
C<LINEAR>, but it is not necessary to check that condition first.
|
||||
This same calculation takes place in the C<special_linconv()> routine, so the
|
||||
implementation can usually just call that routine to perform the task.
|
||||
|
||||
If the the last output value can be read back from the hardware, this routine
|
||||
should also fetch that value and put it into the record's RVAL or VAL field. The
|
||||
return value should be zero if the RVAL field has been set, or 2 if either the
|
||||
VAL field has been set or if the last output value cannot be retrieved.
|
||||
|
||||
=item C<long get_ioint_info(int cmd, aoRecord *prec, IOSCANPVT *piosl)>
|
||||
|
||||
This optional routine is called whenever the record's SCAN field is being
|
||||
changed to or from the value C<I/O Intr> to find out which I/O Interrupt Scan
|
||||
list the record should be added to or deleted from.
|
||||
If this routine is not provided, it will not be possible to set the SCAN field
|
||||
to the value C<I/O Intr> at all.
|
||||
|
||||
The C<cmd> parameter is zero when the record is being added to the scan list,
|
||||
and one when it is being removed from the list.
|
||||
The routine must determine which interrupt source the record should be connected
|
||||
to, which it indicates by the scan list that it points the location at C<*piosl>
|
||||
to before returning.
|
||||
It can prevent the SCAN field from being changed at all by returning a non-zero
|
||||
value to its caller.
|
||||
|
||||
In most cases the device support will create the I/O Interrupt Scan lists that
|
||||
it returns for itself, by calling C<void scanIoInit(IOSCANPVT *piosl)> once for
|
||||
each separate interrupt source.
|
||||
That API allocates memory and inializes the list, then passes back a pointer to
|
||||
the new list in the location at C<*piosl>.
|
||||
When the device support receives notification that the interrupt has occurred,
|
||||
it announces that to the IOC by calling C<void scanIoRequest(IOSCANPVT iosl)>
|
||||
which will arrange for the appropriate records to be processed in a suitable
|
||||
thread.
|
||||
The C<scanIoRequest()> routine is safe to call from an interrupt service routine
|
||||
on embedded architectures (vxWorks and RTEMS).
|
||||
|
||||
=item C<long write_ao(aoRecord *prec)>
|
||||
|
||||
This essential routine is called whenever the record has a new output value to
|
||||
send to the device. It is responsible for performing the write operation, using
|
||||
either the engineering units value found in the record's OVAL field, or the raw
|
||||
value from the record's RVAL field if the record type's unit conversion
|
||||
facilities are used. A return value of zero indicates success, any other value
|
||||
indicates that an error occurred.
|
||||
|
||||
This routine must not block (busy-wait) if the device takes more than a few
|
||||
microseconds to accept the new value. In that case the routine must use
|
||||
asynchronous completion to tell the record when the write operation eventually
|
||||
completes. It signals that this is an asynchronous operation by setting the
|
||||
record's PACT field to TRUE before it returns, having arranged for the record's
|
||||
C<process()> routine to be called later once the write operation is over. When
|
||||
that happens the C<write_ao()> routine will be called again with PACT still set
|
||||
to TRUE; it should then set it to FALSE to indicate the write has completed, and
|
||||
return.
|
||||
|
||||
=item C<long special_linconv(aoRecord *prec, int after)>
|
||||
|
||||
This optional routine should be provided if the record type's unit conversion
|
||||
features are used by the device support's C<write_ao()> routine utilizing the
|
||||
RVAL field rather than OVAL or VAL.
|
||||
It is called by the record code whenever any of the the fields LINR, EGUL or
|
||||
EGUF are modified and LINR has the value C<LINEAR>.
|
||||
The routine must calculate and set the fields EOFF and ESLO appropriately based
|
||||
on the new values of EGUL and EGUF.
|
||||
|
||||
These calculations can be expressed in terms of the minimum and maximum raw
|
||||
values that the C<write_ao()> routine can accept in the RVAL field.
|
||||
When VAL is EGUF the RVAL field will be set to I<RVAL_max>, and when VAL is
|
||||
EGUL the RVAL field will become I<RVAL_min>.
|
||||
The fomulae to use are:
|
||||
|
||||
=over 4
|
||||
|
||||
EOFF = (I<RVAL_max> * EGUL E<minus> I<RVAL_min> * EGUF) /
|
||||
(I<RVAL_max> E<minus> I<RVAL_min>)
|
||||
|
||||
ESLO = (EGUF E<minus> EGUL) / (I<RVAL_max> E<minus> I<RVAL_min>)
|
||||
|
||||
=back
|
||||
|
||||
Note that the record support sets EOFF to EGUL before calling this routine,
|
||||
which is a very common case (I<RVAL_min> is zero).
|
||||
|
||||
=back
|
||||
|
||||
=head2 Device Support For Soft Records
|
||||
|
||||
Two soft device support modules Soft Channel and Raw Soft Channel are
|
||||
provided for output records not related to actual hardware devices. The
|
||||
OUT link type must be either a CONSTANT, DB_LINK, or CA_LINK.
|
||||
|
||||
=head3 Soft Channel
|
||||
|
||||
This module writes the current value of OVAL.
|
||||
|
||||
If the OUT link type is PV_LINK, then dbCaAddInlink is called by
|
||||
init_record. init_record always returns a value of 2, which means that
|
||||
no conversion will ever be attempted.
|
||||
|
||||
write_ao calls recGblPutLinkValue to write the current value of VAL.
|
||||
See Soft Output for details.
|
||||
|
||||
=head3 Raw Soft Channel
|
||||
|
||||
This module is like the previous except that it writes the current
|
||||
value of RVAL.
|
||||
|
||||
=cut
|
||||
@@ -6,6 +6,33 @@
|
||||
# EPICS BASE is distributed subject to a Software License Agreement found
|
||||
# in file LICENSE that is included with this distribution.
|
||||
#*************************************************************************
|
||||
|
||||
=title Compress Record (compress)
|
||||
|
||||
...
|
||||
|
||||
=head2 Record-specific Menus
|
||||
|
||||
=head3 Menu compressALG
|
||||
|
||||
The ALG field which uses this menu controls the compression algorithm used.
|
||||
|
||||
...
|
||||
|
||||
=menu compressALG
|
||||
|
||||
...
|
||||
|
||||
=head2 Parameter Fields
|
||||
|
||||
The record-specific fields are described below.
|
||||
|
||||
=recordtype compress
|
||||
|
||||
...
|
||||
|
||||
=cut
|
||||
|
||||
menu(compressALG) {
|
||||
choice(compressALG_N_to_1_Low_Value,"N to 1 Low Value")
|
||||
choice(compressALG_N_to_1_High_Value,"N to 1 High Value")
|
||||
@@ -16,8 +43,6 @@ menu(compressALG) {
|
||||
}
|
||||
recordtype(compress) {
|
||||
|
||||
=head1 Compress Record (compress)
|
||||
|
||||
=fields VAL
|
||||
|
||||
=cut
|
||||
|
||||
@@ -7,10 +7,25 @@
|
||||
# in file LICENSE that is included with this distribution.
|
||||
#*************************************************************************
|
||||
|
||||
=head1 Waveform Record (waveform)
|
||||
=title Waveform Record (waveform)
|
||||
|
||||
...
|
||||
|
||||
=head2 Record-specific Menus
|
||||
|
||||
=head3 Menu waveformPOST
|
||||
|
||||
The MPST and APST fields use this menu to determine when to post new value
|
||||
and archive monitors respectively.
|
||||
|
||||
=menu waveformPOST
|
||||
|
||||
...
|
||||
|
||||
=head2 Parameter Fields
|
||||
|
||||
The record-specific fields are described below.
|
||||
|
||||
=recordtype waveform
|
||||
|
||||
...
|
||||
@@ -124,17 +139,6 @@ recordtype(waveform) {
|
||||
interest(2)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
|
||||
=head3 Menu waveformPOST
|
||||
|
||||
...
|
||||
|
||||
=menu waveformPOST
|
||||
|
||||
...
|
||||
|
||||
=cut
|
||||
|
||||
field(MPST,DBF_MENU) {
|
||||
prompt("Post Value Monitors")
|
||||
promptgroup(GUI_DISPLAY)
|
||||
|
||||
Reference in New Issue
Block a user