extend calc, calcout and sub records and calc expressions to inputs A - U
To accomodate for the increased number of inputs, the size of CALC and OCAL fields has been doubled to 160 characters.
This commit is contained in:
@@ -81,11 +81,13 @@ link(calc, lnkCalcIf)
|
||||
=head3 Calculation Link C<"calc">
|
||||
|
||||
A calculation link is an input link that can evaluate mathematical expressions
|
||||
on scalar (double-precision floating-point) values obtained from up to 12 child
|
||||
on scalar (double-precision floating-point) values obtained from up to 21 child
|
||||
input links, and returns a double-precision floating-point result. The
|
||||
expression is evaluated by the EPICS Calc engine, and the result is returned as
|
||||
the value of the link.
|
||||
|
||||
Since UNRELEASED the number of inputs has been increased from 12 to 21.
|
||||
|
||||
Two additional expressions may also be provided and are evaluated to determine
|
||||
whether the record owning the link should be placed in alarm state. In both
|
||||
cases the result of the main calculation is available to these expressions as
|
||||
@@ -95,7 +97,7 @@ record will be placed in C<LINK/MAJOR> alarm. If not and the C<minor> expression
|
||||
evaluates to non-zero the record will be placed in C<LINK/MINOR> alarm state.
|
||||
|
||||
A calculation link can also be an output link, with the scalar output value
|
||||
being converted to a double and provided to the expression as C<VAL>. Up to 12
|
||||
being converted to a double and provided to the expression as C<VAL>. Up to 21
|
||||
additional input links can also be read and provided to the expression as above.
|
||||
The result of the calculation is forwarded to a child output link specified in
|
||||
the link's C<out> parameter.
|
||||
@@ -126,8 +128,8 @@ An optional expression that returns non-zero to raise a minor alarm.
|
||||
|
||||
=item args
|
||||
|
||||
A JSON list of up to 12 input arguments for the expression, which are assigned
|
||||
to the inputs C<A>, C<B>, C<C>, ... C<L>. Each input argument may be either a
|
||||
A JSON list of up to 24 input arguments for the expression, which are assigned
|
||||
to the inputs C<A>, C<B>, C<C>, ... C<U>. Each input argument may be either a
|
||||
numeric literal or an embedded JSON link inside C<{}> braces. The same input
|
||||
values are provided to the two alarm expressions as to the primary expression.
|
||||
|
||||
@@ -149,7 +151,7 @@ result should be displayed. Equivalent to the C<PREC> field of a record.
|
||||
|
||||
=item time
|
||||
|
||||
An optional string containing a single upper or lower-case letter C<A> ... C<L>
|
||||
An optional string containing a single upper or lower-case letter C<A> ... C<U>
|
||||
which must correspond to an input provided in the C<args> parameter. When the
|
||||
record containing such a link has C<TSEL> set to -2 (epicsTimeEventDeviceTime)
|
||||
the record's timestamp field C<TIME> will be read from the indicated input link
|
||||
|
||||
@@ -177,7 +177,7 @@ static jlif_result lnkCalc_string(jlink *pjlink, const char *val, size_t len)
|
||||
if (clink->pstate == ps_time) {
|
||||
char tinp;
|
||||
|
||||
if (len != 1 || (tinp = toupper((int) val[0])) < 'A' || tinp > 'L') {
|
||||
if (len != 1 || (tinp = toupper((int) val[0])) < 'A' || tinp >= 'A' + CALCPERFORM_NARGS) {
|
||||
errlogPrintf("lnkCalc: Bad 'time' parameter \"%.*s\"\n", (int) len, val);
|
||||
return jlif_stop;
|
||||
}
|
||||
|
||||
@@ -159,9 +159,9 @@ static long special(DBADDR *paddr, int after)
|
||||
#define indexof(field) calcRecord##field
|
||||
|
||||
static long get_linkNumber(int fieldIndex) {
|
||||
if (fieldIndex >= indexof(A) && fieldIndex <= indexof(L))
|
||||
if (fieldIndex >= indexof(A) && fieldIndex < indexof(A) + CALCPERFORM_NARGS)
|
||||
return fieldIndex - indexof(A);
|
||||
if (fieldIndex >= indexof(LA) && fieldIndex <= indexof(LL))
|
||||
if (fieldIndex >= indexof(LA) && fieldIndex < indexof(LA) + CALCPERFORM_NARGS)
|
||||
return fieldIndex - indexof(LA);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -14,6 +14,8 @@ and logical operations on values retrieved from other records. The result
|
||||
of its operations can then be accessed by another record so that it can
|
||||
then be used.
|
||||
|
||||
Since UNRELEASED the number of inputs has been increased from 12 to 21.
|
||||
|
||||
=head2 Parameter Fields
|
||||
|
||||
The record-specific fields are described below, grouped by functionality.
|
||||
@@ -34,9 +36,9 @@ These fields are described in L<Scan Fields|dbCommonRecord/Scan Fields>.
|
||||
|
||||
=head3 Read Parameters
|
||||
|
||||
The read parameters for the Calc record consist of 12 input links INPA,
|
||||
INPB, ... INPL. The fields can be database links, channel access links, or
|
||||
constants. If they are links, they must specify another record's field or a
|
||||
The read parameters for the Calc record consist of 21 input links INPA -
|
||||
INPU. The fields can be database links, channel access links, or constants.
|
||||
If they are links, they must specify another record's field or a
|
||||
channel access link. If they are constants, they will be initialized with
|
||||
the value they are configured with and can be changed via C<dbPuts>. They
|
||||
cannot be hardware addresses.
|
||||
@@ -45,7 +47,7 @@ See L<Address
|
||||
Specification|https://docs.epics-controls.org/en/latest/process-database/EPICS_Process_Database_Concepts.html#address-specification>
|
||||
for information on how to specify database links.
|
||||
|
||||
=fields INPA - INPL
|
||||
=fields INPA - INPU
|
||||
|
||||
=head3 Expression
|
||||
|
||||
@@ -117,7 +119,7 @@ radians to degrees
|
||||
|
||||
The expression uses the values retrieved from the INPx links as operands,
|
||||
though constants can be used as operands too. These values retrieved from
|
||||
the input links are stored in the A-L fields. The values to be used in the
|
||||
the input links are stored in the A-U fields. The values to be used in the
|
||||
expression are simply referenced by the field letter. For instance, the
|
||||
value obtained from INPA link is stored in the field A, and the value
|
||||
obtained from INPB is stored in field B. The field names can be included in
|
||||
@@ -125,7 +127,7 @@ the expression which will operate on their respective values, as in A+B.
|
||||
Also, the RNDM nullary function can be included as an operand in the
|
||||
expression in order to generate a random number between 0 and 1.
|
||||
|
||||
=fields A - L
|
||||
=fields A - U
|
||||
|
||||
The keyword VAL returns the current contents of the VAL field (which can be
|
||||
written to by a CA put, so it might I<not> be the result from the last time
|
||||
@@ -549,12 +551,12 @@ modifiable at run-time. They are used to process the record.
|
||||
The LALM field is used to implement the hysteresis factor for the alarm
|
||||
limits.
|
||||
|
||||
The LA-LL fields are used to decide when to trigger monitors for the
|
||||
The LA-LU fields are used to decide when to trigger monitors for the
|
||||
corresponding fields. For instance, if LA does not equal the value A,
|
||||
monitors for A are triggered. The MLST and ALST fields are used in the same
|
||||
manner for the VAL field.
|
||||
|
||||
=fields LALM, ALST, MLST, LA - LL
|
||||
=fields LALM, ALST, MLST, LA - LU
|
||||
|
||||
=cut
|
||||
|
||||
@@ -569,7 +571,7 @@ manner for the VAL field.
|
||||
promptgroup("30 - Action")
|
||||
special(SPC_CALC)
|
||||
pp(TRUE)
|
||||
size(80)
|
||||
size(160)
|
||||
initial("0")
|
||||
}
|
||||
field(INPA,DBF_INLINK) {
|
||||
@@ -632,6 +634,60 @@ manner for the VAL field.
|
||||
promptgroup("42 - Input G-L")
|
||||
interest(1)
|
||||
}
|
||||
field(INPM,DBF_INLINK) {
|
||||
prompt("Input M")
|
||||
special(SPC_MOD)
|
||||
promptgroup("43 - Input M-R")
|
||||
interest(1)
|
||||
}
|
||||
field(INPN,DBF_INLINK) {
|
||||
prompt("Input N")
|
||||
special(SPC_MOD)
|
||||
promptgroup("43 - Input M-R")
|
||||
interest(1)
|
||||
}
|
||||
field(INPO,DBF_INLINK) {
|
||||
prompt("Input O")
|
||||
special(SPC_MOD)
|
||||
promptgroup("43 - Input M-R")
|
||||
interest(1)
|
||||
}
|
||||
field(INPP,DBF_INLINK) {
|
||||
prompt("Input P")
|
||||
special(SPC_MOD)
|
||||
promptgroup("43 - Input M-R")
|
||||
interest(1)
|
||||
}
|
||||
field(INPQ,DBF_INLINK) {
|
||||
prompt("Input Q")
|
||||
special(SPC_MOD)
|
||||
promptgroup("43 - Input M-R")
|
||||
interest(1)
|
||||
}
|
||||
field(INPR,DBF_INLINK) {
|
||||
prompt("Input R")
|
||||
special(SPC_MOD)
|
||||
promptgroup("43 - Input M-R")
|
||||
interest(1)
|
||||
}
|
||||
field(INPS,DBF_INLINK) {
|
||||
prompt("Input S")
|
||||
special(SPC_MOD)
|
||||
promptgroup("44 - Input S-U")
|
||||
interest(1)
|
||||
}
|
||||
field(INPT,DBF_INLINK) {
|
||||
prompt("Input T")
|
||||
special(SPC_MOD)
|
||||
promptgroup("44 - Input S-U")
|
||||
interest(1)
|
||||
}
|
||||
field(INPU,DBF_INLINK) {
|
||||
prompt("Input U")
|
||||
special(SPC_MOD)
|
||||
promptgroup("44 - Input S-U")
|
||||
interest(1)
|
||||
}
|
||||
field(EGU,DBF_STRING) {
|
||||
prompt("Engineering Units")
|
||||
promptgroup("80 - Display")
|
||||
@@ -790,6 +846,42 @@ manner for the VAL field.
|
||||
prompt("Value of Input L")
|
||||
pp(TRUE)
|
||||
}
|
||||
field(M,DBF_DOUBLE) {
|
||||
prompt("Value of Input M")
|
||||
pp(TRUE)
|
||||
}
|
||||
field(N,DBF_DOUBLE) {
|
||||
prompt("Value of Input N")
|
||||
pp(TRUE)
|
||||
}
|
||||
field(O,DBF_DOUBLE) {
|
||||
prompt("Value of Input O")
|
||||
pp(TRUE)
|
||||
}
|
||||
field(P,DBF_DOUBLE) {
|
||||
prompt("Value of Input P")
|
||||
pp(TRUE)
|
||||
}
|
||||
field(Q,DBF_DOUBLE) {
|
||||
prompt("Value of Input Q")
|
||||
pp(TRUE)
|
||||
}
|
||||
field(R,DBF_DOUBLE) {
|
||||
prompt("Value of Input R")
|
||||
pp(TRUE)
|
||||
}
|
||||
field(S,DBF_DOUBLE) {
|
||||
prompt("Value of Input S")
|
||||
pp(TRUE)
|
||||
}
|
||||
field(T,DBF_DOUBLE) {
|
||||
prompt("Value of Input T")
|
||||
pp(TRUE)
|
||||
}
|
||||
field(U,DBF_DOUBLE) {
|
||||
prompt("Value of Input U")
|
||||
pp(TRUE)
|
||||
}
|
||||
field(LA,DBF_DOUBLE) {
|
||||
prompt("Prev Value of A")
|
||||
special(SPC_NOMOD)
|
||||
@@ -850,6 +942,51 @@ manner for the VAL field.
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(LM,DBF_DOUBLE) {
|
||||
prompt("Prev Value of M")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(LN,DBF_DOUBLE) {
|
||||
prompt("Prev Value of N")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(LO,DBF_DOUBLE) {
|
||||
prompt("Prev Value of O")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(LP,DBF_DOUBLE) {
|
||||
prompt("Prev Value of P")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(LQ,DBF_DOUBLE) {
|
||||
prompt("Prev Value of Q")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(LR,DBF_DOUBLE) {
|
||||
prompt("Prev Value of R")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(LS,DBF_DOUBLE) {
|
||||
prompt("Prev Value of S")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(LT,DBF_DOUBLE) {
|
||||
prompt("Prev Value of T")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(LU,DBF_DOUBLE) {
|
||||
prompt("Prev Value of U")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(LALM,DBF_DOUBLE) {
|
||||
prompt("Last Value Alarmed")
|
||||
special(SPC_NOMOD)
|
||||
@@ -870,7 +1007,7 @@ manner for the VAL field.
|
||||
prompt("Reverse Polish Calc")
|
||||
special(SPC_NOMOD)
|
||||
interest(4)
|
||||
extra("char rpcl[INFIX_TO_POSTFIX_SIZE(80)]")
|
||||
extra("char rpcl[INFIX_TO_POSTFIX_SIZE(160)]")
|
||||
}
|
||||
|
||||
=head2 Record Support
|
||||
@@ -970,7 +1107,7 @@ Archive and values change monitors are invoked if ADEL and MDEL conditions
|
||||
are met.
|
||||
|
||||
=item *
|
||||
Monitors for A-L are checked whenever other monitors are invoked.
|
||||
Monitors for A-U are checked whenever other monitors are invoked.
|
||||
|
||||
=item *
|
||||
NSEV and NSTA are reset to 0.
|
||||
|
||||
@@ -355,6 +355,15 @@ static long special(DBADDR *paddr, int after)
|
||||
case(calcoutRecordINPJ):
|
||||
case(calcoutRecordINPK):
|
||||
case(calcoutRecordINPL):
|
||||
case(calcoutRecordINPM):
|
||||
case(calcoutRecordINPN):
|
||||
case(calcoutRecordINPO):
|
||||
case(calcoutRecordINPP):
|
||||
case(calcoutRecordINPQ):
|
||||
case(calcoutRecordINPR):
|
||||
case(calcoutRecordINPS):
|
||||
case(calcoutRecordINPT):
|
||||
case(calcoutRecordINPU):
|
||||
case(calcoutRecordOUT):
|
||||
lnkIndex = fieldIndex - calcoutRecordINPA;
|
||||
plink = &prec->inpa + lnkIndex;
|
||||
@@ -406,9 +415,9 @@ static long special(DBADDR *paddr, int after)
|
||||
#define indexof(field) calcoutRecord##field
|
||||
|
||||
static long get_linkNumber(int fieldIndex) {
|
||||
if (fieldIndex >= indexof(A) && fieldIndex <= indexof(L))
|
||||
if (fieldIndex >= indexof(A) && fieldIndex < indexof(A) + CALCPERFORM_NARGS)
|
||||
return fieldIndex - indexof(A);
|
||||
if (fieldIndex >= indexof(LA) && fieldIndex <= indexof(LL))
|
||||
if (fieldIndex >= indexof(LA) && fieldIndex < indexof(LA) + CALCPERFORM_NARGS)
|
||||
return fieldIndex - indexof(LA);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -20,6 +20,8 @@ rather than the DBF_STRING fields used in the Wait record. For new
|
||||
databases, it is recommended that the Calcout record be used instead of the
|
||||
Wait record.
|
||||
|
||||
Since UNRELEASED the number of inputs has been increased from 12 to 21.
|
||||
|
||||
=head2 Parameter Fields
|
||||
|
||||
The record-specific fields are described below, grouped by functionality.
|
||||
@@ -57,18 +59,18 @@ These fields are listed in L<Scan Fields|dbCommonRecord/Scan Fields>.
|
||||
|
||||
=head3 Read Parameters
|
||||
|
||||
The read parameters for the Calcout record consists of 12 input links INPA,
|
||||
INPB, ... INPL. The fields can be database links, channel access links, or
|
||||
constants. If they are links, they must specify another record's field. If
|
||||
The read parameters for the Calcout record consists of 21 input links INPA -
|
||||
INPU. The fields can be database links, channel access links, or constants.
|
||||
If they are links, they must specify another record's field. If
|
||||
they are constants, they will be initialized with the value they are
|
||||
configured with and can be changed via C<dbPuts>. These fields cannot be
|
||||
hardware addresses. In addition, the Calcout record contains the INAV,
|
||||
INBV, ... INLV fields which indicate the status of the link fields, for
|
||||
hardware addresses. In addition, the Calcout record contains the INAV -
|
||||
INUV fields which indicate the status of the link fields, for
|
||||
example, whether or not the specified PV was found and a link to it
|
||||
established. See L<Operator Display Parameters> for an explanation of these
|
||||
fields.
|
||||
|
||||
=fields INPA - INPL
|
||||
=fields INPA - INPU
|
||||
|
||||
=head3 Expressions
|
||||
|
||||
@@ -146,14 +148,14 @@ angle from radians to degrees
|
||||
|
||||
The expression can use the values retrieved from the INPx links as
|
||||
operands, though constants can be used as operands too. These values
|
||||
retrieved from the input links are stored in the A-L fields. The values to
|
||||
retrieved from the input links are stored in the A-U fields. The values to
|
||||
be used in the expression are simple references by the field letter. For
|
||||
instance, the value obtained from the INPA link is stored in field A, and
|
||||
the values obtained from the INPB link is stored in the field B. The names
|
||||
can be included in the expression will operate on their respective values,
|
||||
as in A+B.
|
||||
|
||||
=fields A - L
|
||||
=fields A - U
|
||||
|
||||
The keyword VAL returns the current contents of the expression's result
|
||||
field, i.e. the VAL field for the CALC expression and the OVAL field for
|
||||
@@ -604,8 +606,8 @@ LOW, and LOLO fields. PREC controls the precision of the VAL field.
|
||||
|
||||
=head4 Menu calcoutINAV
|
||||
|
||||
The INAV-INLV fields indicate the status of the link to the PVs specified
|
||||
in the INPA-INPL fields respectively. These fields can have four possible
|
||||
The INAV-INUV fields indicate the status of the link to the PVs specified
|
||||
in the INPA-INPU fields respectively. These fields can have four possible
|
||||
values:
|
||||
|
||||
=menu calcoutINAV
|
||||
@@ -629,7 +631,7 @@ C<Constant> -- the corresponding link field is a constant.
|
||||
=back
|
||||
|
||||
The OUTV field indicates the status of the OUT link. If has the same
|
||||
possible values as the INAV-INLV fields.
|
||||
possible values as the INAV-INUV fields.
|
||||
|
||||
The CLCV and OLCV fields indicate the validity of the expression in the
|
||||
CALC and OCAL fields respectively. If the expression in invalid, the field
|
||||
@@ -640,7 +642,7 @@ The DLYA field is set to one during the delay specified in ODLY.
|
||||
See L<Fields Common to All Record Types|dbCommonRecord/Operator Display
|
||||
Parameters> for more on the record name (NAME) and description (DESC) fields.
|
||||
|
||||
=fields EGU, PREC, HOPR, LOPR, INAV - INLV, OUTV, CLCV, OCLV, DLYA, NAME, DESC
|
||||
=fields EGU, PREC, HOPR, LOPR, INAV - INUV, OUTV, CLCV, OCLV, DLYA, NAME, DESC
|
||||
|
||||
=head3 Alarm Parameters
|
||||
|
||||
@@ -684,12 +686,12 @@ modifiable at run-time. They are used to process the record.
|
||||
The LALM field is used to implement the hysteresis factor for the alarm
|
||||
limits.
|
||||
|
||||
The LA-LL fields are used to decide when to trigger monitors for the
|
||||
The LA-LU fields are used to decide when to trigger monitors for the
|
||||
corresponding fields. For instance, if LA does not equal the value for A,
|
||||
monitors for A are triggered. The MLST and ALST fields are used in the same
|
||||
manner for the VAL field.
|
||||
|
||||
=fields LALM, ALST, MLST, LA - LL
|
||||
=fields LALM, ALST, MLST, LA - LU
|
||||
|
||||
=cut
|
||||
|
||||
@@ -721,7 +723,7 @@ manner for the VAL field.
|
||||
promptgroup("30 - Action")
|
||||
special(SPC_CALC)
|
||||
pp(TRUE)
|
||||
size(80)
|
||||
size(160)
|
||||
initial("0")
|
||||
}
|
||||
field(CLCV,DBF_LONG) {
|
||||
@@ -800,6 +802,60 @@ manner for the VAL field.
|
||||
promptgroup("42 - Input G-L")
|
||||
interest(1)
|
||||
}
|
||||
field(INPM,DBF_INLINK) {
|
||||
prompt("Input M")
|
||||
special(SPC_MOD)
|
||||
promptgroup("43 - Input M-R")
|
||||
interest(1)
|
||||
}
|
||||
field(INPN,DBF_INLINK) {
|
||||
prompt("Input N")
|
||||
special(SPC_MOD)
|
||||
promptgroup("43 - Input M-R")
|
||||
interest(1)
|
||||
}
|
||||
field(INPO,DBF_INLINK) {
|
||||
prompt("Input O")
|
||||
special(SPC_MOD)
|
||||
promptgroup("43 - Input M-R")
|
||||
interest(1)
|
||||
}
|
||||
field(INPP,DBF_INLINK) {
|
||||
prompt("Input P")
|
||||
special(SPC_MOD)
|
||||
promptgroup("43 - Input M-R")
|
||||
interest(1)
|
||||
}
|
||||
field(INPQ,DBF_INLINK) {
|
||||
prompt("Input Q")
|
||||
special(SPC_MOD)
|
||||
promptgroup("43 - Input M-R")
|
||||
interest(1)
|
||||
}
|
||||
field(INPR,DBF_INLINK) {
|
||||
prompt("Input R")
|
||||
special(SPC_MOD)
|
||||
promptgroup("43 - Input M-R")
|
||||
interest(1)
|
||||
}
|
||||
field(INPS,DBF_INLINK) {
|
||||
prompt("Input S")
|
||||
special(SPC_MOD)
|
||||
promptgroup("44 - Input S-U")
|
||||
interest(1)
|
||||
}
|
||||
field(INPT,DBF_INLINK) {
|
||||
prompt("Input T")
|
||||
special(SPC_MOD)
|
||||
promptgroup("44 - Input S-U")
|
||||
interest(1)
|
||||
}
|
||||
field(INPU,DBF_INLINK) {
|
||||
prompt("Input U")
|
||||
special(SPC_MOD)
|
||||
promptgroup("44 - Input S-U")
|
||||
interest(1)
|
||||
}
|
||||
field(OUT,DBF_OUTLINK) {
|
||||
prompt("Output Specification")
|
||||
special(SPC_MOD)
|
||||
@@ -890,6 +946,69 @@ manner for the VAL field.
|
||||
menu(calcoutINAV)
|
||||
initial("1")
|
||||
}
|
||||
field(INMV,DBF_MENU) {
|
||||
prompt("INPM PV Status")
|
||||
special(SPC_NOMOD)
|
||||
interest(1)
|
||||
menu(calcoutINAV)
|
||||
initial("1")
|
||||
}
|
||||
field(INNV,DBF_MENU) {
|
||||
prompt("INPN PV Status")
|
||||
special(SPC_NOMOD)
|
||||
interest(1)
|
||||
menu(calcoutINAV)
|
||||
initial("1")
|
||||
}
|
||||
field(INOV,DBF_MENU) {
|
||||
prompt("INPO PV Status")
|
||||
special(SPC_NOMOD)
|
||||
interest(1)
|
||||
menu(calcoutINAV)
|
||||
initial("1")
|
||||
}
|
||||
field(INPV,DBF_MENU) {
|
||||
prompt("INPP PV Status")
|
||||
special(SPC_NOMOD)
|
||||
interest(1)
|
||||
menu(calcoutINAV)
|
||||
initial("1")
|
||||
}
|
||||
field(INQV,DBF_MENU) {
|
||||
prompt("INPQ PV Status")
|
||||
special(SPC_NOMOD)
|
||||
interest(1)
|
||||
menu(calcoutINAV)
|
||||
initial("1")
|
||||
}
|
||||
field(INRV,DBF_MENU) {
|
||||
prompt("INPR PV Status")
|
||||
special(SPC_NOMOD)
|
||||
interest(1)
|
||||
menu(calcoutINAV)
|
||||
initial("1")
|
||||
}
|
||||
field(INSV,DBF_MENU) {
|
||||
prompt("INPS PV Status")
|
||||
special(SPC_NOMOD)
|
||||
interest(1)
|
||||
menu(calcoutINAV)
|
||||
initial("1")
|
||||
}
|
||||
field(INTV,DBF_MENU) {
|
||||
prompt("INPT PV Status")
|
||||
special(SPC_NOMOD)
|
||||
interest(1)
|
||||
menu(calcoutINAV)
|
||||
initial("1")
|
||||
}
|
||||
field(INUV,DBF_MENU) {
|
||||
prompt("INPU PV Status")
|
||||
special(SPC_NOMOD)
|
||||
interest(1)
|
||||
menu(calcoutINAV)
|
||||
initial("1")
|
||||
}
|
||||
field(OUTV,DBF_MENU) {
|
||||
prompt("OUT PV Status")
|
||||
special(SPC_NOMOD)
|
||||
@@ -924,7 +1043,7 @@ manner for the VAL field.
|
||||
promptgroup("30 - Action")
|
||||
special(SPC_CALC)
|
||||
pp(TRUE)
|
||||
size(80)
|
||||
size(160)
|
||||
initial("0")
|
||||
}
|
||||
field(OCLV,DBF_LONG) {
|
||||
@@ -1104,6 +1223,42 @@ manner for the VAL field.
|
||||
prompt("Value of Input L")
|
||||
pp(TRUE)
|
||||
}
|
||||
field(M,DBF_DOUBLE) {
|
||||
prompt("Value of Input M")
|
||||
pp(TRUE)
|
||||
}
|
||||
field(N,DBF_DOUBLE) {
|
||||
prompt("Value of Input N")
|
||||
pp(TRUE)
|
||||
}
|
||||
field(O,DBF_DOUBLE) {
|
||||
prompt("Value of Input O")
|
||||
pp(TRUE)
|
||||
}
|
||||
field(P,DBF_DOUBLE) {
|
||||
prompt("Value of Input P")
|
||||
pp(TRUE)
|
||||
}
|
||||
field(Q,DBF_DOUBLE) {
|
||||
prompt("Value of Input Q")
|
||||
pp(TRUE)
|
||||
}
|
||||
field(R,DBF_DOUBLE) {
|
||||
prompt("Value of Input R")
|
||||
pp(TRUE)
|
||||
}
|
||||
field(S,DBF_DOUBLE) {
|
||||
prompt("Value of Input S")
|
||||
pp(TRUE)
|
||||
}
|
||||
field(T,DBF_DOUBLE) {
|
||||
prompt("Value of Input T")
|
||||
pp(TRUE)
|
||||
}
|
||||
field(U,DBF_DOUBLE) {
|
||||
prompt("Value of Input U")
|
||||
pp(TRUE)
|
||||
}
|
||||
field(OVAL,DBF_DOUBLE) {
|
||||
prompt("Output Value")
|
||||
asl(ASL0)
|
||||
@@ -1168,6 +1323,51 @@ manner for the VAL field.
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(LM,DBF_DOUBLE) {
|
||||
prompt("Prev Value of M")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(LN,DBF_DOUBLE) {
|
||||
prompt("Prev Value of N")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(LO,DBF_DOUBLE) {
|
||||
prompt("Prev Value of O")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(LP,DBF_DOUBLE) {
|
||||
prompt("Prev Value of P")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(LQ,DBF_DOUBLE) {
|
||||
prompt("Prev Value of Q")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(LR,DBF_DOUBLE) {
|
||||
prompt("Prev Value of R")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(LS,DBF_DOUBLE) {
|
||||
prompt("Prev Value of S")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(LT,DBF_DOUBLE) {
|
||||
prompt("Prev Value of T")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(LU,DBF_DOUBLE) {
|
||||
prompt("Prev Value of U")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(POVL,DBF_DOUBLE) {
|
||||
prompt("Prev Value of OVAL")
|
||||
asl(ASL0)
|
||||
@@ -1192,13 +1392,13 @@ manner for the VAL field.
|
||||
prompt("Reverse Polish Calc")
|
||||
special(SPC_NOMOD)
|
||||
interest(4)
|
||||
extra("char rpcl[INFIX_TO_POSTFIX_SIZE(80)]")
|
||||
extra("char rpcl[INFIX_TO_POSTFIX_SIZE(160)]")
|
||||
}
|
||||
field(ORPC,DBF_NOACCESS) {
|
||||
prompt("Reverse Polish OCalc")
|
||||
special(SPC_NOMOD)
|
||||
interest(4)
|
||||
extra("char orpc[INFIX_TO_POSTFIX_SIZE(80)]")
|
||||
extra("char orpc[INFIX_TO_POSTFIX_SIZE(160)]")
|
||||
}
|
||||
|
||||
=head2 Record Support
|
||||
@@ -1307,7 +1507,7 @@ Archive and value change monitors are invoked if ADEL and MDEL conditions
|
||||
are met.
|
||||
|
||||
=item *
|
||||
Monitors for A-L are checked whenever other monitors are invoked.
|
||||
Monitors for A-U are checked whenever other monitors are invoked.
|
||||
|
||||
=item *
|
||||
NSEV and NSTA are reset to 0
|
||||
|
||||
@@ -86,7 +86,7 @@ static long do_sub(subRecord *);
|
||||
static long fetch_values(subRecord *);
|
||||
static void monitor(subRecord *);
|
||||
|
||||
#define INP_ARG_MAX 12
|
||||
#define INP_ARG_MAX 21
|
||||
|
||||
static long init_record(struct dbCommon *pcommon, int pass)
|
||||
{
|
||||
@@ -196,9 +196,9 @@ static long special(DBADDR *paddr, int after)
|
||||
#define indexof(field) subRecord##field
|
||||
|
||||
static long get_linkNumber(int fieldIndex) {
|
||||
if (fieldIndex >= indexof(A) && fieldIndex <= indexof(L))
|
||||
if (fieldIndex >= indexof(A) && fieldIndex < indexof(A) + INP_ARG_MAX)
|
||||
return fieldIndex - indexof(A);
|
||||
if (fieldIndex >= indexof(LA) && fieldIndex <= indexof(LL))
|
||||
if (fieldIndex >= indexof(LA) && fieldIndex < indexof(LA) + INP_ARG_MAX)
|
||||
return fieldIndex - indexof(LA);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
The subroutine record is used to call a C initialization routine and a recurring
|
||||
scan routine. There is no device support for this record.
|
||||
|
||||
Since UNRELEASED the number of inputs has been increased from 12 to 21.
|
||||
|
||||
=recordtype sub
|
||||
|
||||
=cut
|
||||
@@ -30,17 +32,17 @@ These fields are described in L<Scan Fields|dbCommonRecord/Scan Fields>.
|
||||
|
||||
=head3 Read Parameters
|
||||
|
||||
The subroutine record has twelve input links (INPA-INPL), each of which has a
|
||||
corresponding value field (A-L). These fields are used to retrieve and store
|
||||
The subroutine record has 21 input links INPA - INPU, each of which has a
|
||||
corresponding value field A - U. These fields are used to retrieve and store
|
||||
values that can be passed to the subroutine that the record calls.
|
||||
|
||||
The input links can be either channel access or database links, or constants.
|
||||
When constants, the corresponding value field for the link is initialized with
|
||||
the constant value and the field's value can be changed at run-time via dbPuts.
|
||||
Otherwise, the values for (A-F) are fetched from the input links when the record
|
||||
is processed.
|
||||
Otherwise, the values for A - U are fetched from the input links when the
|
||||
record is processed.
|
||||
|
||||
=fields INPA - INPL, A - L
|
||||
=fields INPA - INPU, A - U
|
||||
|
||||
=head3 Subroutine Connection
|
||||
|
||||
@@ -115,11 +117,11 @@ processing routines or the monitors.
|
||||
VAL should be set by the subroutine. SADR holds the subroutine address and is
|
||||
set by the record processing routine.
|
||||
|
||||
The rest of these fields--LALM, ALST, MLST, and the LA-LL fields--are used to
|
||||
The rest of these fields--LALM, ALST, MLST, and the LA-LU fields--are used to
|
||||
implement the monitors. For example, when LA is not equal to A, the value-change
|
||||
monitors are called for that field.
|
||||
|
||||
=fields VAL, SADR, LALM, ALST, MLST, LA - LL
|
||||
=fields VAL, SADR, LALM, ALST, MLST, LA - LU
|
||||
|
||||
=head2 Record Support
|
||||
|
||||
@@ -161,7 +163,7 @@ recGblGetPrec() >>>.
|
||||
long (*get_graphic_double)(struct dbAddr *paddr, struct dbr_grDouble *p)
|
||||
|
||||
Sets the upper display and lower display limits for a field. If the field is
|
||||
VAL, A-L, LA-LL, HIHI, HIGH, LOW, or LOLO, the limits are set to HOPR and LOPR,
|
||||
VAL, A-U, LA-LU, HIHI, HIGH, LOW, or LOLO, the limits are set to HOPR and LOPR,
|
||||
else if the field has upper and lower limits defined they will be used, else the
|
||||
upper and lower maximum values for the field type will be used.
|
||||
|
||||
@@ -170,7 +172,7 @@ upper and lower maximum values for the field type will be used.
|
||||
long (*get_control_double)(struct dbAddr *paddr, struct dbr_ctrlDouble *p)
|
||||
|
||||
Sets the upper control and the lower control limits for a field. If the field is
|
||||
VAL, A-L, LA-LL, HIHI, HIGH, LOW, or LOLO, the limits are set to HOPR and LOPR,
|
||||
VAL, A-U, LA-LU, HIHI, HIGH, LOW, or LOLO, the limits are set to HOPR and LOPR,
|
||||
else if the field has upper and lower limits defined they will be used, else the
|
||||
upper and lower maximum values for the field type will be used.
|
||||
|
||||
@@ -241,7 +243,7 @@ met.
|
||||
|
||||
=item *
|
||||
|
||||
Monitors for A-L are invoked if value has changed.
|
||||
Monitors for A-U are invoked if value has changed.
|
||||
|
||||
=item *
|
||||
|
||||
@@ -500,6 +502,51 @@ processing.
|
||||
promptgroup("42 - Input G-L")
|
||||
interest(1)
|
||||
}
|
||||
field(INPM,DBF_INLINK) {
|
||||
prompt("Input M")
|
||||
promptgroup("43 - Input M-R")
|
||||
interest(1)
|
||||
}
|
||||
field(INPN,DBF_INLINK) {
|
||||
prompt("Input N")
|
||||
promptgroup("43 - Input M-R")
|
||||
interest(1)
|
||||
}
|
||||
field(INPO,DBF_INLINK) {
|
||||
prompt("Input O")
|
||||
promptgroup("43 - Input M-R")
|
||||
interest(1)
|
||||
}
|
||||
field(INPP,DBF_INLINK) {
|
||||
prompt("Input P")
|
||||
promptgroup("43 - Input M-R")
|
||||
interest(1)
|
||||
}
|
||||
field(INPQ,DBF_INLINK) {
|
||||
prompt("Input Q")
|
||||
promptgroup("43 - Input M-R")
|
||||
interest(1)
|
||||
}
|
||||
field(INPR,DBF_INLINK) {
|
||||
prompt("Input R")
|
||||
promptgroup("43 - Input M-R")
|
||||
interest(1)
|
||||
}
|
||||
field(INPS,DBF_INLINK) {
|
||||
prompt("Input S")
|
||||
promptgroup("44 - Input S-U")
|
||||
interest(1)
|
||||
}
|
||||
field(INPT,DBF_INLINK) {
|
||||
prompt("Input T")
|
||||
promptgroup("44 - Input S-U")
|
||||
interest(1)
|
||||
}
|
||||
field(INPU,DBF_INLINK) {
|
||||
prompt("Input U")
|
||||
promptgroup("44 - Input S-U")
|
||||
interest(1)
|
||||
}
|
||||
field(EGU,DBF_STRING) {
|
||||
prompt("Engineering Units")
|
||||
promptgroup("80 - Display")
|
||||
@@ -655,6 +702,42 @@ processing.
|
||||
prompt("Value of Input L")
|
||||
pp(TRUE)
|
||||
}
|
||||
field(M,DBF_DOUBLE) {
|
||||
prompt("Value of Input M")
|
||||
pp(TRUE)
|
||||
}
|
||||
field(N,DBF_DOUBLE) {
|
||||
prompt("Value of Input N")
|
||||
pp(TRUE)
|
||||
}
|
||||
field(O,DBF_DOUBLE) {
|
||||
prompt("Value of Input O")
|
||||
pp(TRUE)
|
||||
}
|
||||
field(P,DBF_DOUBLE) {
|
||||
prompt("Value of Input P")
|
||||
pp(TRUE)
|
||||
}
|
||||
field(Q,DBF_DOUBLE) {
|
||||
prompt("Value of Input Q")
|
||||
pp(TRUE)
|
||||
}
|
||||
field(R,DBF_DOUBLE) {
|
||||
prompt("Value of Input R")
|
||||
pp(TRUE)
|
||||
}
|
||||
field(S,DBF_DOUBLE) {
|
||||
prompt("Value of Input S")
|
||||
pp(TRUE)
|
||||
}
|
||||
field(T,DBF_DOUBLE) {
|
||||
prompt("Value of Input T")
|
||||
pp(TRUE)
|
||||
}
|
||||
field(U,DBF_DOUBLE) {
|
||||
prompt("Value of Input U")
|
||||
pp(TRUE)
|
||||
}
|
||||
field(LA,DBF_DOUBLE) {
|
||||
prompt("Prev Value of A")
|
||||
special(SPC_NOMOD)
|
||||
@@ -715,6 +798,51 @@ processing.
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(LM,DBF_DOUBLE) {
|
||||
prompt("Prev Value of M")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(LN,DBF_DOUBLE) {
|
||||
prompt("Prev Value of N")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(LO,DBF_DOUBLE) {
|
||||
prompt("Prev Value of O")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(LP,DBF_DOUBLE) {
|
||||
prompt("Prev Value of P")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(LQ,DBF_DOUBLE) {
|
||||
prompt("Prev Value of Q")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(LR,DBF_DOUBLE) {
|
||||
prompt("Prev Value of R")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(LS,DBF_DOUBLE) {
|
||||
prompt("Prev Value of S")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(LT,DBF_DOUBLE) {
|
||||
prompt("Prev Value of T")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(LU,DBF_DOUBLE) {
|
||||
prompt("Prev Value of U")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(LALM,DBF_DOUBLE) {
|
||||
prompt("Last Value Alarmed")
|
||||
special(SPC_NOMOD)
|
||||
|
||||
Reference in New Issue
Block a user