Merge changes from 3.15 branch into 7.0
This commit is contained in:
@@ -1,143 +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 is distributed subject to a Software License Agreement found
|
||||
# in file LICENSE that is included with this distribution.
|
||||
#*************************************************************************
|
||||
menu(aaiPOST) {
|
||||
choice(aaiPOST_Always,"Always")
|
||||
choice(aaiPOST_OnChange,"On Change")
|
||||
}
|
||||
recordtype(aai) {
|
||||
include "dbCommon.dbd"
|
||||
field(VAL,DBF_NOACCESS) {
|
||||
prompt("Value")
|
||||
asl(ASL0)
|
||||
special(SPC_DBADDR)
|
||||
pp(TRUE)
|
||||
extra("void * val")
|
||||
#=type DOUBLE[]
|
||||
#=read Yes
|
||||
#=write Yes
|
||||
}
|
||||
field(PREC,DBF_SHORT) {
|
||||
prompt("Display Precision")
|
||||
promptgroup("80 - Display")
|
||||
interest(1)
|
||||
prop(YES)
|
||||
}
|
||||
field(INP,DBF_INLINK) {
|
||||
prompt("Input Specification")
|
||||
promptgroup("40 - Input")
|
||||
interest(1)
|
||||
}
|
||||
field(EGU,DBF_STRING) {
|
||||
prompt("Engineering Units")
|
||||
promptgroup("80 - Display")
|
||||
interest(1)
|
||||
size(16)
|
||||
prop(YES)
|
||||
}
|
||||
field(HOPR,DBF_DOUBLE) {
|
||||
prompt("High Operating Range")
|
||||
promptgroup("80 - Display")
|
||||
interest(1)
|
||||
prop(YES)
|
||||
}
|
||||
field(LOPR,DBF_DOUBLE) {
|
||||
prompt("Low Operating Range")
|
||||
promptgroup("80 - Display")
|
||||
interest(1)
|
||||
prop(YES)
|
||||
}
|
||||
field(NELM,DBF_ULONG) {
|
||||
prompt("Number of Elements")
|
||||
promptgroup("30 - Action")
|
||||
special(SPC_NOMOD)
|
||||
interest(1)
|
||||
initial("1")
|
||||
}
|
||||
field(FTVL,DBF_MENU) {
|
||||
prompt("Field Type of Value")
|
||||
promptgroup("30 - Action")
|
||||
special(SPC_NOMOD)
|
||||
interest(1)
|
||||
menu(menuFtype)
|
||||
}
|
||||
field(NORD,DBF_ULONG) {
|
||||
prompt("Number elements read")
|
||||
special(SPC_NOMOD)
|
||||
}
|
||||
field(BPTR,DBF_NOACCESS) {
|
||||
prompt("Buffer Pointer")
|
||||
special(SPC_NOMOD)
|
||||
interest(4)
|
||||
extra("void * bptr")
|
||||
}
|
||||
field(SIML,DBF_INLINK) {
|
||||
prompt("Simulation Mode Link")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(1)
|
||||
}
|
||||
field(SIMM,DBF_MENU) {
|
||||
prompt("Simulation Mode")
|
||||
special(SPC_MOD)
|
||||
interest(1)
|
||||
menu(menuYesNo)
|
||||
}
|
||||
field(SIMS,DBF_MENU) {
|
||||
prompt("Simulation Mode Severity")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(2)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(SIOL,DBF_INLINK) {
|
||||
prompt("Simulation Input Link")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(1)
|
||||
}
|
||||
field(OLDSIMM,DBF_MENU) {
|
||||
prompt("Prev. Simulation Mode")
|
||||
special(SPC_NOMOD)
|
||||
interest(4)
|
||||
menu(menuSimm)
|
||||
}
|
||||
field(SSCN,DBF_MENU) {
|
||||
prompt("Sim. Mode Scan")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(1)
|
||||
menu(menuScan)
|
||||
initial("65535")
|
||||
}
|
||||
field(SDLY,DBF_DOUBLE) {
|
||||
prompt("Sim. Mode Async Delay")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(2)
|
||||
initial("-1.0")
|
||||
}
|
||||
%#include "callback.h"
|
||||
field(SIMPVT,DBF_NOACCESS) {
|
||||
prompt("Sim. Mode Private")
|
||||
special(SPC_NOMOD)
|
||||
interest(4)
|
||||
extra("epicsCallback *simpvt")
|
||||
}
|
||||
field(MPST,DBF_MENU) {
|
||||
prompt("Post Value Monitors")
|
||||
promptgroup("80 - Display")
|
||||
interest(1)
|
||||
menu(aaiPOST)
|
||||
}
|
||||
field(APST,DBF_MENU) {
|
||||
prompt("Post Archive Monitors")
|
||||
promptgroup("80 - Display")
|
||||
interest(1)
|
||||
menu(aaiPOST)
|
||||
}
|
||||
field(HASH,DBF_ULONG) {
|
||||
prompt("Hash of OnChange data.")
|
||||
interest(3)
|
||||
}
|
||||
}
|
||||
505
modules/database/src/std/rec/aaiRecord.dbd.pod
Normal file
505
modules/database/src/std/rec/aaiRecord.dbd.pod
Normal file
@@ -0,0 +1,505 @@
|
||||
#*************************************************************************
|
||||
# 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 is distributed subject to a Software License Agreement found
|
||||
# in file LICENSE that is included with this distribution.
|
||||
#*************************************************************************
|
||||
|
||||
=title Array Analog Input (aai)
|
||||
|
||||
The array analog input record type is used to read array data. The array data can
|
||||
contain any of the supported data types. The record is in many ways similar to the
|
||||
waveform record. It allows, however, the device support to allocate the array
|
||||
storage.
|
||||
|
||||
=recordtype aai
|
||||
|
||||
=cut
|
||||
|
||||
include "menuFtype.dbd"
|
||||
|
||||
menu(aaiPOST) {
|
||||
choice(aaiPOST_Always,"Always")
|
||||
choice(aaiPOST_OnChange,"On Change")
|
||||
}
|
||||
|
||||
recordtype(aai) {
|
||||
|
||||
=head2 Parameter Fields
|
||||
|
||||
The record-specific fields are described below, grouped by functionality.
|
||||
|
||||
=head3 Scan Parameters
|
||||
|
||||
The array analog input record has the standard fields for specifying under what
|
||||
circumstances the record will be processed. These fields are listed in L<Scan
|
||||
Fields>. In addition, L<Scanning Specification> explains how these fields are
|
||||
used. Note that I/O event scanning is only supported for those card types that
|
||||
interrupt.
|
||||
|
||||
=head3 Read Parameters
|
||||
|
||||
These fields are configurable by the user to specify how and from where the record
|
||||
reads its data. The INP field determines from where the array analog input gets
|
||||
its input. It can be a hardware address, a channel access or database link, or a
|
||||
constant. Only in records that use soft device support can the INP field be a
|
||||
channel access link, a database link, or a constant. Otherwise, the INP field must
|
||||
be a hardware address. See L<Address Specification> for information on the format
|
||||
of hardware addresses and database links.
|
||||
|
||||
=head4 Fields related to waveform reading
|
||||
|
||||
The DTYP field must contain the name of the appropriate device support module.
|
||||
The values retrieved from the input link are placed in an array referenced by
|
||||
VAL. (If the INP link is a constant, elements can be placed in the array via
|
||||
dbPuts.) NELM specifies the number of elements that the array will hold, while
|
||||
FTVL specifies the data type of the elements.
|
||||
|
||||
=fields DTYP, INP, NELM, FTVL
|
||||
|
||||
=head4 Possible data types for FTVL
|
||||
|
||||
=menu menuFtype
|
||||
|
||||
=head3 Operator Display Parameters
|
||||
|
||||
These parameters are used to present meaningful data to the operator. They
|
||||
display the value and other parameters of the waveform either textually or
|
||||
graphically.
|
||||
|
||||
=head4 Fields related to I<Operator Display>
|
||||
|
||||
EGU is a string of up to 16 characters describing the units that the array data
|
||||
measures. It is retrieved by the C<<< get_units() >>> record support routine.
|
||||
|
||||
The HOPR and LOPR fields set the upper and lower display limits for array
|
||||
elements referenced by the VAL field. Both the C<<< get_graphic_double() >>> and
|
||||
C<<< get_control_double() >>> record support routines retrieve these fields.
|
||||
|
||||
The PREC field determines the floating point precision with which to display the
|
||||
array values. It is used whenever the C<<< get_precision() >>> record support
|
||||
routine is called.
|
||||
|
||||
See L<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 array analog input record has the alarm parameters common to all record types.
|
||||
|
||||
=head3 Monitor Parameters
|
||||
|
||||
These parameters are used to determine when to send monitors placed on the VAL
|
||||
field. The APST and MPST fields are a menu with choices "Always" and "On
|
||||
Change". The default is "Always", thus monitors will normally be sent every time
|
||||
the record processes. Selecting "On Change" causes a 32-bit hash of the VAL
|
||||
field buffer to be calculated and compared with the previous hash value every
|
||||
time the record processes; the monitor will only be sent if the hash is
|
||||
different, indicating that the buffer has changed. Note that there is a small
|
||||
chance that two different value buffers might result in the same hash value, so
|
||||
for critical systems "Always" may be a better choice, even though it re-sends
|
||||
duplicate data.
|
||||
|
||||
=head4 Record fields related to I<Monitor Parameters>
|
||||
|
||||
=fields APST, MPST, HASH
|
||||
|
||||
=head4 Menu choices for C<APST> and C<MPST> fields
|
||||
|
||||
=menu aaiPOST
|
||||
|
||||
=head3 Run-time Parameters
|
||||
|
||||
These parameters are used by the run-time code for processing the array analog
|
||||
input record. They are not configured using a configuration tool. Only the VAL
|
||||
field is modifiable at run-time.
|
||||
|
||||
VAL references the array where the array analog input record stores its data. The
|
||||
BPTR field holds the address of the array.
|
||||
|
||||
The NORD field holds a counter of the number of elements that have been read
|
||||
into the array.
|
||||
|
||||
=fields VAL, BPTR, NORD
|
||||
|
||||
The following fields are used to operate the array analog input record in the
|
||||
simulation mode. See L<Simulation Mode> for more information on the simulation
|
||||
mode fields.
|
||||
|
||||
=fields SIOL, SIML, SIMM, SIMS
|
||||
|
||||
=begin html
|
||||
|
||||
<br>
|
||||
<hr>
|
||||
<br>
|
||||
|
||||
=end html
|
||||
|
||||
=head2 Record Support
|
||||
|
||||
=head3 Record Support Routines
|
||||
|
||||
=head4 init_record
|
||||
|
||||
static long init_record(aaiRecord *prec, int pass)
|
||||
|
||||
If device support includes C<init_record()>, it is called.
|
||||
|
||||
Checks if device support allocated array space. If not, space for the array is
|
||||
allocated using NELM and FTVL. The array address is stored in the record.
|
||||
|
||||
This routine initializes SIMM with the value of SIML if SIML type is CONSTANT
|
||||
link or creates a channel access link if SIML type is PV_LINK. VAL is likewise
|
||||
initialized if SIOL is CONSTANT or PV_LINK.
|
||||
|
||||
This routine next checks to see that device support is available and a device
|
||||
support read routine is defined. If either does not exist, an error message is
|
||||
issued and processing is terminated
|
||||
|
||||
=head4 process
|
||||
|
||||
static long process(aaiRecord *prec)
|
||||
|
||||
See L</"Record Processing"> section below.
|
||||
|
||||
=head4 cvt_dbaddr
|
||||
|
||||
static long cvt_dbaddr(DBADDR *paddr)
|
||||
|
||||
This is called by dbNameToAddr. It makes the dbAddr structure refer to the
|
||||
actual buffer holding the result.
|
||||
|
||||
=head4 get_array_info
|
||||
|
||||
static long get_array_info(DBADDR *paddr, long *no_elements, long *offset)
|
||||
|
||||
Obtains values from the array referenced by VAL.
|
||||
|
||||
=head4 put_array_info
|
||||
|
||||
static long put_array_info(DBADDR *paddr, long nNew)
|
||||
|
||||
Writes values into the array referenced by VAL.
|
||||
|
||||
=head4 get_units
|
||||
|
||||
static long get_units(DBADDR *paddr, char *units)
|
||||
|
||||
Retrieves EGU.
|
||||
|
||||
=head4 get_prec
|
||||
|
||||
static long get_precision(DBADDR *paddr, long *precision)
|
||||
|
||||
Retrieves PREC if field is VAL field. Otherwise, calls C<<< recGblGetPrec() >>>.
|
||||
|
||||
=head4 get_graphic_double
|
||||
|
||||
static long get_graphic_double(DBADDR *paddr, struct dbr_grDouble *pgd)
|
||||
|
||||
Sets the upper display and lower display limits for a field. If the field is VAL
|
||||
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.
|
||||
|
||||
Sets the following values:
|
||||
|
||||
upper_disp_limit = HOPR
|
||||
lower_disp_limit = LOPR
|
||||
|
||||
=head4 get_control_double
|
||||
|
||||
static long get_control_double(DBADDR *paddr, struct dbr_ctrlDouble *pcd)
|
||||
|
||||
Sets the upper control and the lower control limits for a field. If the field is
|
||||
VAL 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.
|
||||
|
||||
Sets the following values
|
||||
|
||||
upper_ctrl_limit = HOPR
|
||||
lower_ctrl_limit = LOPR
|
||||
|
||||
=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
|
||||
still set to TRUE. This ensures that processes will no longer be called for this
|
||||
record. Thus error storms will not occur.
|
||||
|
||||
=item 2.
|
||||
|
||||
Call device support read routine C<read_aai()>.
|
||||
|
||||
=item 3.
|
||||
|
||||
If PACT has been changed to TRUE, the device support read routine has started
|
||||
but has not completed writing the new value. In this case, the processing
|
||||
routine merely returns, leaving PACT TRUE.
|
||||
|
||||
=item 4.
|
||||
|
||||
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 APST or MPST are Always or if
|
||||
the result of the hash calculation is different.
|
||||
|
||||
=item *
|
||||
|
||||
NSEV and NSTA are reset to 0.
|
||||
|
||||
=back
|
||||
|
||||
=item 5.
|
||||
|
||||
Scan forward link if necessary, set PACT FALSE, and return.
|
||||
|
||||
=back
|
||||
|
||||
=begin html
|
||||
|
||||
<br>
|
||||
<hr>
|
||||
<br>
|
||||
|
||||
=end html
|
||||
|
||||
=cut
|
||||
|
||||
include "dbCommon.dbd"
|
||||
field(VAL,DBF_NOACCESS) {
|
||||
prompt("Value")
|
||||
asl(ASL0)
|
||||
special(SPC_DBADDR)
|
||||
pp(TRUE)
|
||||
extra("void * val")
|
||||
#=type DOUBLE[]
|
||||
#=read Yes
|
||||
#=write Yes
|
||||
}
|
||||
field(PREC,DBF_SHORT) {
|
||||
prompt("Display Precision")
|
||||
promptgroup("80 - Display")
|
||||
interest(1)
|
||||
prop(YES)
|
||||
}
|
||||
field(INP,DBF_INLINK) {
|
||||
prompt("Input Specification")
|
||||
promptgroup("40 - Input")
|
||||
interest(1)
|
||||
}
|
||||
field(EGU,DBF_STRING) {
|
||||
prompt("Engineering Units")
|
||||
promptgroup("80 - Display")
|
||||
interest(1)
|
||||
size(16)
|
||||
prop(YES)
|
||||
}
|
||||
field(HOPR,DBF_DOUBLE) {
|
||||
prompt("High Operating Range")
|
||||
promptgroup("80 - Display")
|
||||
interest(1)
|
||||
prop(YES)
|
||||
}
|
||||
field(LOPR,DBF_DOUBLE) {
|
||||
prompt("Low Operating Range")
|
||||
promptgroup("80 - Display")
|
||||
interest(1)
|
||||
prop(YES)
|
||||
}
|
||||
field(NELM,DBF_ULONG) {
|
||||
prompt("Number of Elements")
|
||||
promptgroup("30 - Action")
|
||||
special(SPC_NOMOD)
|
||||
interest(1)
|
||||
initial("1")
|
||||
}
|
||||
field(FTVL,DBF_MENU) {
|
||||
prompt("Field Type of Value")
|
||||
promptgroup("30 - Action")
|
||||
special(SPC_NOMOD)
|
||||
interest(1)
|
||||
menu(menuFtype)
|
||||
}
|
||||
field(NORD,DBF_ULONG) {
|
||||
prompt("Number elements read")
|
||||
special(SPC_NOMOD)
|
||||
}
|
||||
field(BPTR,DBF_NOACCESS) {
|
||||
prompt("Buffer Pointer")
|
||||
special(SPC_NOMOD)
|
||||
interest(4)
|
||||
extra("void * bptr")
|
||||
}
|
||||
field(SIML,DBF_INLINK) {
|
||||
prompt("Simulation Mode Link")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(1)
|
||||
}
|
||||
field(SIMM,DBF_MENU) {
|
||||
prompt("Simulation Mode")
|
||||
special(SPC_MOD)
|
||||
interest(1)
|
||||
menu(menuYesNo)
|
||||
}
|
||||
field(SIMS,DBF_MENU) {
|
||||
prompt("Simulation Mode Severity")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(2)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(SIOL,DBF_INLINK) {
|
||||
prompt("Simulation Input Link")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(1)
|
||||
}
|
||||
field(OLDSIMM,DBF_MENU) {
|
||||
prompt("Prev. Simulation Mode")
|
||||
special(SPC_NOMOD)
|
||||
interest(4)
|
||||
menu(menuSimm)
|
||||
}
|
||||
field(SSCN,DBF_MENU) {
|
||||
prompt("Sim. Mode Scan")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(1)
|
||||
menu(menuScan)
|
||||
initial("65535")
|
||||
}
|
||||
field(SDLY,DBF_DOUBLE) {
|
||||
prompt("Sim. Mode Async Delay")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(2)
|
||||
initial("-1.0")
|
||||
}
|
||||
%#include "callback.h"
|
||||
field(SIMPVT,DBF_NOACCESS) {
|
||||
prompt("Sim. Mode Private")
|
||||
special(SPC_NOMOD)
|
||||
interest(4)
|
||||
extra("epicsCallback *simpvt")
|
||||
}
|
||||
field(MPST,DBF_MENU) {
|
||||
prompt("Post Value Monitors")
|
||||
promptgroup("80 - Display")
|
||||
interest(1)
|
||||
menu(aaiPOST)
|
||||
}
|
||||
field(APST,DBF_MENU) {
|
||||
prompt("Post Archive Monitors")
|
||||
promptgroup("80 - Display")
|
||||
interest(1)
|
||||
menu(aaiPOST)
|
||||
}
|
||||
field(HASH,DBF_ULONG) {
|
||||
prompt("Hash of OnChange data.")
|
||||
interest(3)
|
||||
}
|
||||
}
|
||||
|
||||
=head2 Device Support
|
||||
|
||||
=head3 Fields Of Interest To Device Support
|
||||
|
||||
Each array analog input record record must have an associated set of device
|
||||
support routines. The primary responsibility of the device support routines is to
|
||||
obtain a new array value whenever C<read_aai()> is called. The device support
|
||||
routines are primarily interested in the following fields:
|
||||
|
||||
=fields PACT, DPVT, NSEV, NSTA, INP, NELM, FTVL, BPTR, NORD
|
||||
|
||||
=head3 Device Support Routines
|
||||
|
||||
Device support consists of the following routines:
|
||||
|
||||
=head4 report
|
||||
|
||||
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.
|
||||
|
||||
=head4 init
|
||||
|
||||
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.
|
||||
|
||||
=head4 init_record
|
||||
|
||||
long init_record(dbCommon *precord)
|
||||
|
||||
This routine is optional. If provided, it is called by the record support
|
||||
C<init_record()> routine.
|
||||
|
||||
=head4 get_ioint_info
|
||||
|
||||
long get_ioint_info(int cmd, dbCommon *precord, IOSCANPVT *ppvt)
|
||||
|
||||
This routine is called by the ioEventScan system each time the record is added
|
||||
or deleted from an I/O event scan list. cmd has the value (0,1) if the
|
||||
record is being (added to, deleted from) an I/O event list. It must be
|
||||
provided for any device type that can use the ioEvent scanner.
|
||||
|
||||
=head4 read_aai
|
||||
|
||||
long read_aai(dbCommon *precord)
|
||||
|
||||
This routine must provide a new input value. It returns the following values:
|
||||
|
||||
=over
|
||||
|
||||
=item *
|
||||
|
||||
0: Success.
|
||||
|
||||
=item *
|
||||
|
||||
Other: Error.
|
||||
|
||||
=back
|
||||
|
||||
=head3 Device Support For Soft Records
|
||||
|
||||
The C<<< Soft Channel >>> device support module is provided to read values from
|
||||
other records and store them in arrays. If INP is a constant link, then read_aai
|
||||
does nothing. In this case, the record can be used to hold arrays written via
|
||||
dbPuts. If INP is a database or channel access link, the new array value is read
|
||||
from the link. NORD is set.
|
||||
|
||||
This module places a value directly in VAL and NORD is set to the number of items
|
||||
in the array.
|
||||
|
||||
If the INP link type is constant, then NORD is set to zero.
|
||||
|
||||
=cut
|
||||
@@ -1,143 +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 is distributed subject to a Software License Agreement found
|
||||
# in file LICENSE that is included with this distribution.
|
||||
#*************************************************************************
|
||||
menu(aaoPOST) {
|
||||
choice(aaoPOST_Always,"Always")
|
||||
choice(aaoPOST_OnChange,"On Change")
|
||||
}
|
||||
recordtype(aao) {
|
||||
include "dbCommon.dbd"
|
||||
field(VAL,DBF_NOACCESS) {
|
||||
prompt("Value")
|
||||
asl(ASL0)
|
||||
special(SPC_DBADDR)
|
||||
pp(TRUE)
|
||||
extra("void * val")
|
||||
#=type DOUBLE[]
|
||||
#=read Yes
|
||||
#=write Yes
|
||||
}
|
||||
field(PREC,DBF_SHORT) {
|
||||
prompt("Display Precision")
|
||||
promptgroup("80 - Display")
|
||||
interest(1)
|
||||
prop(YES)
|
||||
}
|
||||
field(OUT,DBF_OUTLINK) {
|
||||
prompt("Output Specification")
|
||||
promptgroup("50 - Output")
|
||||
interest(1)
|
||||
}
|
||||
field(EGU,DBF_STRING) {
|
||||
prompt("Engineering Units")
|
||||
promptgroup("80 - Display")
|
||||
interest(1)
|
||||
size(16)
|
||||
prop(YES)
|
||||
}
|
||||
field(HOPR,DBF_DOUBLE) {
|
||||
prompt("High Operating Range")
|
||||
promptgroup("80 - Display")
|
||||
interest(1)
|
||||
prop(YES)
|
||||
}
|
||||
field(LOPR,DBF_DOUBLE) {
|
||||
prompt("Low Operating Range")
|
||||
promptgroup("80 - Display")
|
||||
interest(1)
|
||||
prop(YES)
|
||||
}
|
||||
field(NELM,DBF_ULONG) {
|
||||
prompt("Number of Elements")
|
||||
promptgroup("30 - Action")
|
||||
special(SPC_NOMOD)
|
||||
interest(1)
|
||||
initial("1")
|
||||
}
|
||||
field(FTVL,DBF_MENU) {
|
||||
prompt("Field Type of Value")
|
||||
promptgroup("30 - Action")
|
||||
special(SPC_NOMOD)
|
||||
interest(1)
|
||||
menu(menuFtype)
|
||||
}
|
||||
field(NORD,DBF_ULONG) {
|
||||
prompt("Number elements read")
|
||||
special(SPC_NOMOD)
|
||||
}
|
||||
field(BPTR,DBF_NOACCESS) {
|
||||
prompt("Buffer Pointer")
|
||||
special(SPC_NOMOD)
|
||||
interest(4)
|
||||
extra("void * bptr")
|
||||
}
|
||||
field(SIML,DBF_INLINK) {
|
||||
prompt("Simulation Mode Link")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(1)
|
||||
}
|
||||
field(SIMM,DBF_MENU) {
|
||||
prompt("Simulation Mode")
|
||||
special(SPC_MOD)
|
||||
interest(1)
|
||||
menu(menuYesNo)
|
||||
}
|
||||
field(SIMS,DBF_MENU) {
|
||||
prompt("Simulation Mode Severity")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(2)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(SIOL,DBF_OUTLINK) {
|
||||
prompt("Simulation Output Link")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(1)
|
||||
}
|
||||
field(OLDSIMM,DBF_MENU) {
|
||||
prompt("Prev. Simulation Mode")
|
||||
special(SPC_NOMOD)
|
||||
interest(4)
|
||||
menu(menuSimm)
|
||||
}
|
||||
field(SSCN,DBF_MENU) {
|
||||
prompt("Sim. Mode Scan")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(1)
|
||||
menu(menuScan)
|
||||
initial("65535")
|
||||
}
|
||||
field(SDLY,DBF_DOUBLE) {
|
||||
prompt("Sim. Mode Async Delay")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(2)
|
||||
initial("-1.0")
|
||||
}
|
||||
%#include "callback.h"
|
||||
field(SIMPVT,DBF_NOACCESS) {
|
||||
prompt("Sim. Mode Private")
|
||||
special(SPC_NOMOD)
|
||||
interest(4)
|
||||
extra("epicsCallback *simpvt")
|
||||
}
|
||||
field(MPST,DBF_MENU) {
|
||||
prompt("Post Value Monitors")
|
||||
promptgroup("80 - Display")
|
||||
interest(1)
|
||||
menu(aaoPOST)
|
||||
}
|
||||
field(APST,DBF_MENU) {
|
||||
prompt("Post Archive Monitors")
|
||||
promptgroup("80 - Display")
|
||||
interest(1)
|
||||
menu(aaoPOST)
|
||||
}
|
||||
field(HASH,DBF_ULONG) {
|
||||
prompt("Hash of OnChange data.")
|
||||
interest(3)
|
||||
}
|
||||
}
|
||||
503
modules/database/src/std/rec/aaoRecord.dbd.pod
Normal file
503
modules/database/src/std/rec/aaoRecord.dbd.pod
Normal file
@@ -0,0 +1,503 @@
|
||||
#*************************************************************************
|
||||
# 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 is distributed subject to a Software License Agreement found
|
||||
# in file LICENSE that is included with this distribution.
|
||||
#*************************************************************************
|
||||
|
||||
=title Array Analog Output (aao)
|
||||
|
||||
The array analog output record type is used to write array data. The array data
|
||||
can contain any of the supported data types. The record is in many ways similar to
|
||||
the waveform record but outputs arrays instead of reading them. It also allows the
|
||||
device support to allocate the array storage.
|
||||
|
||||
=recordtype aao
|
||||
|
||||
=cut
|
||||
|
||||
include "menuFtype.dbd"
|
||||
|
||||
menu(aaoPOST) {
|
||||
choice(aaoPOST_Always,"Always")
|
||||
choice(aaoPOST_OnChange,"On Change")
|
||||
}
|
||||
|
||||
recordtype(aao) {
|
||||
|
||||
=head2 Parameter Fields
|
||||
|
||||
The record-specific fields are described below, grouped by functionality.
|
||||
|
||||
=head3 Scan Parameters
|
||||
|
||||
The array analog output record has the standard fields for specifying under what
|
||||
circumstances the record will be processed. These fields are listed in L<Scan
|
||||
Fields>. In addition, L<Scanning Specification> explains how these fields are
|
||||
used. I/O event scanning is only available when supported by device support.
|
||||
|
||||
=head3 Write Parameters
|
||||
|
||||
These fields are configurable by the user to specify how and where to the record
|
||||
writes its data. The OUT field determines where the array analog output writes its
|
||||
output. It can be a hardware address, a channel access or database link, or a
|
||||
constant. Only in records that use soft device support can the OUT field be a
|
||||
channel access link, a database link, or a constant. Otherwise, the OUT field must
|
||||
be a hardware address. See L<Address Specification> for information on the format
|
||||
of hardware addresses and database links.
|
||||
|
||||
=head4 Fields related to array writing
|
||||
|
||||
The DTYP field must contain the name of the appropriate device support module. The
|
||||
values in the array referenced by are written to the location specified in the OUT
|
||||
field. (If the OUT link is a constant, no data are written.) NELM specifies the
|
||||
maximum number of elements that the array can hold, while FTVL specifies the data
|
||||
type of the elements.
|
||||
|
||||
=fields DTYP, OUT, NELM, FTVL
|
||||
|
||||
=head4 Possible data types for FTVL
|
||||
|
||||
=menu menuFtype
|
||||
|
||||
=head3 Operator Display Parameters
|
||||
|
||||
These parameters are used to present meaningful data to the operator. They
|
||||
display the value and other parameters of the waveform either textually or
|
||||
graphically.
|
||||
|
||||
=head4 Fields related to I<Operator Display>
|
||||
|
||||
EGU is a string of up to 16 characters describing the units that the array data
|
||||
measures. It is retrieved by the C<<< get_units >>> record support routine.
|
||||
|
||||
The HOPR and LOPR fields set the upper and lower display limits for array
|
||||
elements referenced by the VAL field. Both the C<<< get_graphic_double >>> and
|
||||
C<<< get_control_double >>> record support routines retrieve these fields.
|
||||
|
||||
The PREC field determines the floating point precision with which to display the
|
||||
array values. It is used whenever the C<<< get_precision >>> record support
|
||||
routine is called.
|
||||
|
||||
See L<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 array analog output record has the alarm parameters common to all record
|
||||
types.
|
||||
|
||||
=head3 Monitor Parameters
|
||||
|
||||
These parameters are used to determine when to send monitors placed on the VAL
|
||||
field. The APST and MPST fields are a menu with choices "Always" and "On
|
||||
Change". The default is "Always", thus monitors will normally be sent every time
|
||||
the record processes. Selecting "On Change" causes a 32-bit hash of the VAL
|
||||
field buffer to be calculated and compared with the previous hash value every
|
||||
time the record processes; the monitor will only be sent if the hash is
|
||||
different, indicating that the buffer has changed. Note that there is a small
|
||||
chance that two different value buffers might result in the same hash value, so
|
||||
for critical systems "Always" may be a better choice, even though it re-sends
|
||||
duplicate data.
|
||||
|
||||
=head4 Record fields related to I<Monitor Parameters>
|
||||
|
||||
=fields APST, MPST, HASH
|
||||
|
||||
=head4 Menu choices for C<APST> and C<MPST> fields
|
||||
|
||||
=menu aaoPOST
|
||||
|
||||
=head3 Run-time Parameters
|
||||
|
||||
These parameters are used by the run-time code for processing the array analog
|
||||
output record. They are not configured using a configuration tool. Only the VAL
|
||||
field is modifiable at run-time.
|
||||
|
||||
VAL references the array where the array analog output record stores its data. The
|
||||
BPTR field holds the address of the array.
|
||||
|
||||
The NORD field holds a counter of the number of elements that have been written to
|
||||
the output,
|
||||
|
||||
=fields VAL, BPTR, NORD
|
||||
|
||||
The following fields are used to operate the array analog output record in the
|
||||
simulation mode. See L<Simulation Mode> for more information on the simulation
|
||||
mode fields.
|
||||
|
||||
=fields SIOL, SIML, SIMM, SIMS
|
||||
|
||||
=begin html
|
||||
|
||||
<br>
|
||||
<hr>
|
||||
<br>
|
||||
|
||||
=end html
|
||||
|
||||
=head2 Record Support
|
||||
|
||||
=head3 Record Support Routines
|
||||
|
||||
=head4 init_record
|
||||
|
||||
static long init_record(aaoRecord *prec, int pass)
|
||||
|
||||
If device support includes C<init_record()>, it is called.
|
||||
|
||||
Checks if device support allocated array space. If not, space for the array is
|
||||
allocated using NELM and FTVL. The array address is stored in the record.
|
||||
|
||||
This routine initializes SIMM with the value of SIML if SIML type is CONSTANT
|
||||
link or creates a channel access link if SIML type is PV_LINK. VAL is likewise
|
||||
initialized if SIOL is CONSTANT or PV_LINK.
|
||||
|
||||
This routine next checks to see that device support is available and a device
|
||||
support write routine is defined. If either does not exist, an error message is
|
||||
issued and processing is terminated
|
||||
|
||||
=head4 process
|
||||
|
||||
static long process(aaoRecord *prec)
|
||||
|
||||
See L</"Record Processing"> section below.
|
||||
|
||||
=head4 cvt_dbaddr
|
||||
|
||||
static long cvt_dbaddr(DBADDR *paddr)
|
||||
|
||||
This is called by dbNameToAddr. It makes the dbAddr structure refer to the
|
||||
actual buffer holding the result.
|
||||
|
||||
=head4 get_array_info
|
||||
|
||||
static long get_array_info(DBADDR *paddr, long *no_elements, long *offset)
|
||||
|
||||
Obtains values from the array referenced by VAL.
|
||||
|
||||
=head4 put_array_info
|
||||
|
||||
static long put_array_info(DBADDR *paddr, long nNew)
|
||||
|
||||
Writes values into the array referenced by VAL.
|
||||
|
||||
=head4 get_units
|
||||
|
||||
static long get_units(DBADDR *paddr, char *units)
|
||||
|
||||
Retrieves EGU.
|
||||
|
||||
=head4 get_prec
|
||||
|
||||
static long get_precision(DBADDR *paddr, long *precision)
|
||||
|
||||
Retrieves PREC if field is VAL field. Otherwise, calls C<<< recGblGetPrec() >>>.
|
||||
|
||||
=head4 get_graphic_double
|
||||
|
||||
static long get_graphic_double(DBADDR *paddr, struct dbr_grDouble *pgd)
|
||||
|
||||
Sets the upper display and lower display limits for a field. If the field is VAL
|
||||
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.
|
||||
|
||||
Sets the following values:
|
||||
|
||||
upper_disp_limit = HOPR
|
||||
lower_disp_limit = LOPR
|
||||
|
||||
=head4 get_control_double
|
||||
|
||||
static long get_control_double(DBADDR *paddr, struct dbr_ctrlDouble *pcd)
|
||||
|
||||
Sets the upper control and the lower control limits for a field. If the field is
|
||||
VAL 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.
|
||||
|
||||
Sets the following values
|
||||
|
||||
upper_ctrl_limit = HOPR
|
||||
lower_ctrl_limit = LOPR
|
||||
|
||||
=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
|
||||
still set to TRUE. This ensures that processes will no longer be called for this
|
||||
record. Thus error storms will not occur.
|
||||
|
||||
=item 2.
|
||||
|
||||
Call device support write routine C<write_aao>.
|
||||
|
||||
=item 3.
|
||||
|
||||
If PACT has been changed to TRUE, the device support read routine has started
|
||||
but has not completed writing the new value. In this case, the processing
|
||||
routine merely returns, leaving PACT TRUE.
|
||||
|
||||
=item 4.
|
||||
|
||||
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 APST or MPST are Always or if
|
||||
the result of the hash calculation is different.
|
||||
|
||||
=item *
|
||||
|
||||
NSEV and NSTA are reset to 0.
|
||||
|
||||
=back
|
||||
|
||||
=item 5.
|
||||
|
||||
Scan forward link if necessary, set PACT FALSE, and return.
|
||||
|
||||
=back
|
||||
|
||||
=begin html
|
||||
|
||||
<br>
|
||||
<hr>
|
||||
<br>
|
||||
|
||||
=end html
|
||||
|
||||
=cut
|
||||
|
||||
include "dbCommon.dbd"
|
||||
field(VAL,DBF_NOACCESS) {
|
||||
prompt("Value")
|
||||
asl(ASL0)
|
||||
special(SPC_DBADDR)
|
||||
pp(TRUE)
|
||||
extra("void * val")
|
||||
#=type DOUBLE[]
|
||||
#=read Yes
|
||||
#=write Yes
|
||||
}
|
||||
field(PREC,DBF_SHORT) {
|
||||
prompt("Display Precision")
|
||||
promptgroup("80 - Display")
|
||||
interest(1)
|
||||
prop(YES)
|
||||
}
|
||||
field(OUT,DBF_OUTLINK) {
|
||||
prompt("Output Specification")
|
||||
promptgroup("50 - Output")
|
||||
interest(1)
|
||||
}
|
||||
field(EGU,DBF_STRING) {
|
||||
prompt("Engineering Units")
|
||||
promptgroup("80 - Display")
|
||||
interest(1)
|
||||
size(16)
|
||||
prop(YES)
|
||||
}
|
||||
field(HOPR,DBF_DOUBLE) {
|
||||
prompt("High Operating Range")
|
||||
promptgroup("80 - Display")
|
||||
interest(1)
|
||||
prop(YES)
|
||||
}
|
||||
field(LOPR,DBF_DOUBLE) {
|
||||
prompt("Low Operating Range")
|
||||
promptgroup("80 - Display")
|
||||
interest(1)
|
||||
prop(YES)
|
||||
}
|
||||
field(NELM,DBF_ULONG) {
|
||||
prompt("Number of Elements")
|
||||
promptgroup("30 - Action")
|
||||
special(SPC_NOMOD)
|
||||
interest(1)
|
||||
initial("1")
|
||||
}
|
||||
field(FTVL,DBF_MENU) {
|
||||
prompt("Field Type of Value")
|
||||
promptgroup("30 - Action")
|
||||
special(SPC_NOMOD)
|
||||
interest(1)
|
||||
menu(menuFtype)
|
||||
}
|
||||
field(NORD,DBF_ULONG) {
|
||||
prompt("Number elements read")
|
||||
special(SPC_NOMOD)
|
||||
}
|
||||
field(BPTR,DBF_NOACCESS) {
|
||||
prompt("Buffer Pointer")
|
||||
special(SPC_NOMOD)
|
||||
interest(4)
|
||||
extra("void * bptr")
|
||||
}
|
||||
field(SIML,DBF_INLINK) {
|
||||
prompt("Simulation Mode Link")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(1)
|
||||
}
|
||||
field(SIMM,DBF_MENU) {
|
||||
prompt("Simulation Mode")
|
||||
special(SPC_MOD)
|
||||
interest(1)
|
||||
menu(menuYesNo)
|
||||
}
|
||||
field(SIMS,DBF_MENU) {
|
||||
prompt("Simulation Mode Severity")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(2)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(SIOL,DBF_OUTLINK) {
|
||||
prompt("Simulation Output Link")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(1)
|
||||
}
|
||||
field(OLDSIMM,DBF_MENU) {
|
||||
prompt("Prev. Simulation Mode")
|
||||
special(SPC_NOMOD)
|
||||
interest(4)
|
||||
menu(menuSimm)
|
||||
}
|
||||
field(SSCN,DBF_MENU) {
|
||||
prompt("Sim. Mode Scan")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(1)
|
||||
menu(menuScan)
|
||||
initial("65535")
|
||||
}
|
||||
field(SDLY,DBF_DOUBLE) {
|
||||
prompt("Sim. Mode Async Delay")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(2)
|
||||
initial("-1.0")
|
||||
}
|
||||
%#include "callback.h"
|
||||
field(SIMPVT,DBF_NOACCESS) {
|
||||
prompt("Sim. Mode Private")
|
||||
special(SPC_NOMOD)
|
||||
interest(4)
|
||||
extra("epicsCallback *simpvt")
|
||||
}
|
||||
field(MPST,DBF_MENU) {
|
||||
prompt("Post Value Monitors")
|
||||
promptgroup("80 - Display")
|
||||
interest(1)
|
||||
menu(aaoPOST)
|
||||
}
|
||||
field(APST,DBF_MENU) {
|
||||
prompt("Post Archive Monitors")
|
||||
promptgroup("80 - Display")
|
||||
interest(1)
|
||||
menu(aaoPOST)
|
||||
}
|
||||
field(HASH,DBF_ULONG) {
|
||||
prompt("Hash of OnChange data.")
|
||||
interest(3)
|
||||
}
|
||||
}
|
||||
|
||||
=head2 Device Support
|
||||
|
||||
=head3 Fields Of Interest To Device Support
|
||||
|
||||
Each array analog output record record must have an associated set of device
|
||||
support routines. The primary responsibility of the device support routines is to
|
||||
write the array data value whenever C<write_aao()> is called. The device support
|
||||
routines are primarily interested in the following fields:
|
||||
|
||||
=fields PACT, DPVT, NSEV, NSTA, OUT, NELM, FTVL, BPTR, NORD
|
||||
|
||||
=head3 Device Support Routines
|
||||
|
||||
Device support consists of the following routines:
|
||||
|
||||
=head4 report
|
||||
|
||||
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.
|
||||
|
||||
=head4 init
|
||||
|
||||
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.
|
||||
|
||||
=head4 init_record
|
||||
|
||||
init_record(dbCommon *precord)
|
||||
|
||||
This routine is optional. If provided, it is called by the record support
|
||||
C<init_record()> routine.
|
||||
|
||||
=head4 get_ioint_info
|
||||
|
||||
long get_ioint_info(int cmd, dbCommon *precord, IOSCANPVT *ppvt)
|
||||
|
||||
This routine is called by the ioEventScan system each time the record is added
|
||||
or deleted from an I/O event scan list. cmd has the value (0,1) if the
|
||||
record is being (added to, deleted from) an I/O event list. It must be
|
||||
provided for any device type that can use the ioEvent scanner.
|
||||
|
||||
=head4 write_aao
|
||||
|
||||
long write_aao(dbCommon *precord)
|
||||
|
||||
This routine must write the array data to output. It returns the following values:
|
||||
|
||||
=over
|
||||
|
||||
=item *
|
||||
|
||||
0: Success.
|
||||
|
||||
=item *
|
||||
|
||||
Other: Error.
|
||||
|
||||
=back
|
||||
|
||||
=head3 Device Support For Soft Records
|
||||
|
||||
The C<<< Soft Channel >>> device support module is provided to write values to
|
||||
other records and store them in arrays. If OUT is a constant link, then
|
||||
C<write_aao()> does nothing. In this case, the record can be used to hold arrays
|
||||
written via dbPuts. If OUT is a database or channel access link, the array value
|
||||
is written to the link. NORD is set to the number of items in the array.
|
||||
|
||||
|
||||
If the OUT link type is constant, then NORD is set to zero.
|
||||
|
||||
=cut
|
||||
@@ -190,7 +190,13 @@ 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
|
||||
behavior).
|
||||
behavior). The record must be scanned often enough for the filtering action to
|
||||
work effectively and the alarm severity can only change when the record is
|
||||
processed, but that processing does not have to be regular; the filter uses the
|
||||
time since the record last processed in its calculation. Setting AFTC to a
|
||||
positive number of seconds will delay the record going into or out of a minor
|
||||
alarm severity or from minor to major severity until the input signal has been
|
||||
in the alarm range for that number of seconds.
|
||||
|
||||
=fields HIHI, HIGH, LOW, LOLO, HHSV, HSV, LSV, LLSV, HYST, AFTC, LALM
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
# 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.
|
||||
# in file LICENSE that is included with this distribution.
|
||||
#*************************************************************************
|
||||
|
||||
=title Analog Output Record (ao)
|
||||
@@ -104,33 +104,32 @@ 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.
|
||||
The EGUF and EGUL fields should be set for C<LINEAR> conversions, and the ESLO
|
||||
and EOFF fields for C<SLOPE> conversion. 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
|
||||
The user must set 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 ESLO, EOFF
|
||||
|
||||
Computed by device support from 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 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
|
||||
@@ -168,8 +167,7 @@ addresses.
|
||||
|
||||
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.
|
||||
is sent.
|
||||
|
||||
=fields DTYP, OUT
|
||||
|
||||
@@ -193,8 +191,8 @@ 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.
|
||||
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, HOPR, LOPR, PREC, NAME, DESC
|
||||
|
||||
@@ -209,9 +207,10 @@ 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
|
||||
See L<Invalid Output Action Fields|dbCommonOutput/Invalid Output Action Fields>
|
||||
for more information on the IVOA and IVOV fields.
|
||||
|
||||
L<Alarm Fields|dbCommonRecord/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
|
||||
@@ -260,15 +259,15 @@ 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.
|
||||
The following fields are used when the record is in simulation mode. See
|
||||
L<Fields Common to Output Record Types|dbCommonOutput/Simulation Fields> for
|
||||
more information on these fields.
|
||||
|
||||
=fields SIOL, SIML, SIMM, SIMS
|
||||
|
||||
=cut
|
||||
|
||||
include "dbCommon.dbd"
|
||||
include "dbCommon.dbd"
|
||||
field(VAL,DBF_DOUBLE) {
|
||||
prompt("Desired Output")
|
||||
promptgroup("50 - Output")
|
||||
@@ -602,6 +601,8 @@ get_precision, get_graphic_double, and get_control_double routines.
|
||||
|
||||
=item init_record
|
||||
|
||||
C<long init_record(aoRecord *prec, int pass);>
|
||||
|
||||
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.
|
||||
@@ -633,10 +634,14 @@ then set to FALSE. PVAL is set to VAL.
|
||||
|
||||
=item process
|
||||
|
||||
C<long process(aoRecord *prec);>
|
||||
|
||||
See next section.
|
||||
|
||||
=item special
|
||||
|
||||
C<long special(DBADDR *paddr, int after);>
|
||||
|
||||
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
|
||||
@@ -647,6 +652,8 @@ re-initialized.
|
||||
|
||||
=item get_alarm_double
|
||||
|
||||
C<long get_alarm_double(DBADDR *, struct dbr_alDouble *);>
|
||||
|
||||
Sets the following values:
|
||||
|
||||
upper_alarm_limit = HIHI
|
||||
@@ -796,7 +803,9 @@ Device support consists of the following routines:
|
||||
|
||||
=over
|
||||
|
||||
=item C<long report(int level)>
|
||||
=item report
|
||||
|
||||
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.
|
||||
@@ -806,7 +815,9 @@ 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)>
|
||||
=item init
|
||||
|
||||
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
|
||||
@@ -814,7 +825,9 @@ 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)>
|
||||
=item init_record
|
||||
|
||||
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.
|
||||
@@ -836,7 +849,9 @@ 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)>
|
||||
=item get_ioint_info
|
||||
|
||||
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
|
||||
@@ -864,7 +879,9 @@ 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)>
|
||||
=item write_ao
|
||||
|
||||
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
|
||||
@@ -883,7 +900,9 @@ 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)>
|
||||
=item special_linconv
|
||||
|
||||
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
|
||||
|
||||
@@ -318,10 +318,13 @@ XOR : Bitwise Exclusive Or
|
||||
C<~> : One's Complement
|
||||
|
||||
=item *
|
||||
C<<< << >>> : Left shift
|
||||
C<<< << >>> : Arithmetic Left Shift
|
||||
|
||||
=item *
|
||||
C<<< >> >>> : Right shift
|
||||
C<<< >> >>> : Arithmetic Right Shift
|
||||
|
||||
=item *
|
||||
C<<<< >>> >>>> : Logical Right Shift
|
||||
|
||||
=back
|
||||
|
||||
|
||||
@@ -350,10 +350,13 @@ XOR : Bitwise Exclusive Or
|
||||
C<~> : One's Complement
|
||||
|
||||
=item *
|
||||
C<<< << >>> : Left shift
|
||||
C<<< << >>> : Arithmetic Left Shift
|
||||
|
||||
=item *
|
||||
C<<< >> >>> : Right shift
|
||||
C<<< >> >>> : Arithmetic Right Shift
|
||||
|
||||
=item *
|
||||
C<<<< >>> >>>> : Logical Right Shift
|
||||
|
||||
=back
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* 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.
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
/* recEvent.c - Record Support Routines for Event records */
|
||||
@@ -103,7 +103,7 @@ static long init_record(struct dbCommon *pcommon, int pass)
|
||||
recGblInitSimm(pcommon, &prec->sscn, &prec->oldsimm, &prec->simm, &prec->siml);
|
||||
recGblInitConstantLink(&prec->siol, DBF_STRING, &prec->sval);
|
||||
|
||||
if( (pdset=(struct eventdset *)(prec->dset)) && (pdset->init_record) )
|
||||
if( (pdset=(struct eventdset *)(prec->dset)) && (pdset->init_record) )
|
||||
status=(*pdset->init_record)(prec);
|
||||
|
||||
prec->epvt = eventNameToHandle(prec->val);
|
||||
@@ -118,12 +118,12 @@ static long process(struct dbCommon *pcommon)
|
||||
long status=0;
|
||||
unsigned char pact=prec->pact;
|
||||
|
||||
if((pdset!=NULL) && (pdset->number >= 5) && pdset->read_event )
|
||||
if((pdset!=NULL) && (pdset->number >= 5) && pdset->read_event )
|
||||
status=readValue(prec); /* read the new value */
|
||||
/* check if device support set pact */
|
||||
if ( !pact && prec->pact ) return(0);
|
||||
prec->pact = TRUE;
|
||||
|
||||
|
||||
postEvent(prec->epvt);
|
||||
|
||||
recGblGetTimeStampSimm(prec, prec->simm, &prec->siol);
|
||||
|
||||
@@ -133,33 +133,28 @@ static void wdogCallback(epicsCallback *arg)
|
||||
|
||||
return;
|
||||
}
|
||||
static long wdogInit(histogramRecord *prec)
|
||||
|
||||
static void wdogInit(histogramRecord *prec)
|
||||
{
|
||||
myCallback *pcallback;
|
||||
|
||||
if (!prec->wdog && prec->sdel > 0) {
|
||||
/* initialize a callback object */
|
||||
pcallback = calloc(1, sizeof(myCallback));
|
||||
pcallback->prec = prec;
|
||||
if (!pcallback)
|
||||
return -1;
|
||||
|
||||
callbackSetCallback(wdogCallback, &pcallback->callback);
|
||||
callbackSetUser(pcallback, &pcallback->callback);
|
||||
callbackSetPriority(priorityLow, &pcallback->callback);
|
||||
prec->wdog = pcallback;
|
||||
}
|
||||
|
||||
if (!prec->wdog)
|
||||
return -1;
|
||||
pcallback = prec->wdog;
|
||||
if (!pcallback)
|
||||
return -1;
|
||||
if (prec->sdel > 0) {
|
||||
myCallback *pcallback = prec->wdog;
|
||||
|
||||
if (!pcallback) {
|
||||
/* initialize a callback object */
|
||||
pcallback = calloc(1, sizeof(myCallback));
|
||||
if (!pcallback)
|
||||
return;
|
||||
|
||||
pcallback->prec = prec;
|
||||
callbackSetCallback(wdogCallback, &pcallback->callback);
|
||||
callbackSetUser(pcallback, &pcallback->callback);
|
||||
callbackSetPriority(priorityLow, &pcallback->callback);
|
||||
prec->wdog = pcallback;
|
||||
}
|
||||
|
||||
/* start new timer on monitor */
|
||||
callbackRequestDelayed(&pcallback->callback, prec->sdel);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static long init_record(struct dbCommon *pcommon, int pass)
|
||||
|
||||
@@ -1,173 +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 is distributed subject to a Software License Agreement found
|
||||
# in file LICENSE that is included with this distribution.
|
||||
#*************************************************************************
|
||||
menu(histogramCMD) {
|
||||
choice(histogramCMD_Read,"Read")
|
||||
choice(histogramCMD_Clear,"Clear")
|
||||
choice(histogramCMD_Start,"Start")
|
||||
choice(histogramCMD_Stop,"Stop")
|
||||
}
|
||||
recordtype(histogram) {
|
||||
include "dbCommon.dbd"
|
||||
field(VAL,DBF_NOACCESS) {
|
||||
prompt("Value")
|
||||
asl(ASL0)
|
||||
special(SPC_DBADDR)
|
||||
extra("void * val")
|
||||
#=type ULONG[]
|
||||
#=read Yes
|
||||
#=write Yes
|
||||
}
|
||||
field(NELM,DBF_USHORT) {
|
||||
prompt("Num of Array Elements")
|
||||
promptgroup("30 - Action")
|
||||
special(SPC_NOMOD)
|
||||
interest(1)
|
||||
initial("1")
|
||||
}
|
||||
field(CSTA,DBF_SHORT) {
|
||||
prompt("Collection Status")
|
||||
special(SPC_NOMOD)
|
||||
interest(1)
|
||||
initial("1")
|
||||
}
|
||||
field(CMD,DBF_MENU) {
|
||||
prompt("Collection Control")
|
||||
asl(ASL0)
|
||||
special(SPC_CALC)
|
||||
interest(1)
|
||||
menu(histogramCMD)
|
||||
}
|
||||
field(ULIM,DBF_DOUBLE) {
|
||||
prompt("Upper Signal Limit")
|
||||
promptgroup("30 - Action")
|
||||
special(SPC_RESET)
|
||||
interest(1)
|
||||
prop(YES)
|
||||
}
|
||||
field(LLIM,DBF_DOUBLE) {
|
||||
prompt("Lower Signal Limit ")
|
||||
promptgroup("30 - Action")
|
||||
special(SPC_RESET)
|
||||
interest(1)
|
||||
prop(YES)
|
||||
}
|
||||
field(WDTH,DBF_DOUBLE) {
|
||||
prompt("Element Width")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(SGNL,DBF_DOUBLE) {
|
||||
prompt("Signal Value")
|
||||
special(SPC_MOD)
|
||||
}
|
||||
field(PREC,DBF_SHORT) {
|
||||
prompt("Display Precision")
|
||||
promptgroup("80 - Display")
|
||||
interest(1)
|
||||
prop(YES)
|
||||
}
|
||||
field(SVL,DBF_INLINK) {
|
||||
prompt("Signal Value Location")
|
||||
promptgroup("40 - Input")
|
||||
interest(1)
|
||||
}
|
||||
field(BPTR,DBF_NOACCESS) {
|
||||
prompt("Buffer Pointer")
|
||||
special(SPC_NOMOD)
|
||||
interest(4)
|
||||
extra("epicsUInt32 *bptr")
|
||||
}
|
||||
field(WDOG,DBF_NOACCESS) {
|
||||
prompt("Watchdog callback")
|
||||
special(SPC_NOMOD)
|
||||
interest(4)
|
||||
extra("void * wdog")
|
||||
}
|
||||
field(MDEL,DBF_SHORT) {
|
||||
prompt("Monitor Count Deadband")
|
||||
promptgroup("80 - Display")
|
||||
interest(1)
|
||||
}
|
||||
field(MCNT,DBF_SHORT) {
|
||||
prompt("Counts Since Monitor")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(SDEL,DBF_DOUBLE) {
|
||||
prompt("Monitor Seconds Dband")
|
||||
promptgroup("80 - Display")
|
||||
special(SPC_RESET)
|
||||
interest(1)
|
||||
}
|
||||
field(SIOL,DBF_INLINK) {
|
||||
prompt("Simulation Input Link")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(1)
|
||||
}
|
||||
field(SVAL,DBF_DOUBLE) {
|
||||
prompt("Simulation Value")
|
||||
}
|
||||
field(SIML,DBF_INLINK) {
|
||||
prompt("Simulation Mode Link")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(1)
|
||||
}
|
||||
field(SIMM,DBF_MENU) {
|
||||
prompt("Simulation Mode")
|
||||
special(SPC_MOD)
|
||||
interest(1)
|
||||
menu(menuYesNo)
|
||||
}
|
||||
field(SIMS,DBF_MENU) {
|
||||
prompt("Simulation Mode Severity")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(2)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(OLDSIMM,DBF_MENU) {
|
||||
prompt("Prev. Simulation Mode")
|
||||
special(SPC_NOMOD)
|
||||
interest(4)
|
||||
menu(menuSimm)
|
||||
}
|
||||
field(SSCN,DBF_MENU) {
|
||||
prompt("Sim. Mode Scan")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(1)
|
||||
menu(menuScan)
|
||||
initial("65535")
|
||||
}
|
||||
field(SDLY,DBF_DOUBLE) {
|
||||
prompt("Sim. Mode Async Delay")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(2)
|
||||
initial("-1.0")
|
||||
}
|
||||
%#include "callback.h"
|
||||
field(SIMPVT,DBF_NOACCESS) {
|
||||
prompt("Sim. Mode Private")
|
||||
special(SPC_NOMOD)
|
||||
interest(4)
|
||||
extra("epicsCallback *simpvt")
|
||||
}
|
||||
field(HOPR,DBF_ULONG) {
|
||||
prompt("High Operating Range")
|
||||
promptgroup("80 - Display")
|
||||
interest(1)
|
||||
prop(YES)
|
||||
}
|
||||
field(LOPR,DBF_ULONG) {
|
||||
prompt("Low Operating Range")
|
||||
promptgroup("80 - Display")
|
||||
interest(1)
|
||||
prop(YES)
|
||||
}
|
||||
}
|
||||
|
||||
variable(histogramSDELprecision, int)
|
||||
445
modules/database/src/std/rec/histogramRecord.dbd.pod
Normal file
445
modules/database/src/std/rec/histogramRecord.dbd.pod
Normal file
@@ -0,0 +1,445 @@
|
||||
#*************************************************************************
|
||||
# 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 is distributed subject to a Software License Agreement found
|
||||
# in file LICENSE that is included with this distribution.
|
||||
#*************************************************************************
|
||||
|
||||
=title Histogram Record (histogram)
|
||||
|
||||
The histogram record is used to store frequency counts of a signal into an array
|
||||
of arbitrary length. The user can configure the range of the signal value that
|
||||
the array will store. Anything outside this range will be ignored.
|
||||
|
||||
=head2 Parameter Fields
|
||||
|
||||
The record-specific fields are described below.
|
||||
|
||||
=recordtype histogram
|
||||
|
||||
=cut
|
||||
|
||||
menu(histogramCMD) {
|
||||
choice(histogramCMD_Read,"Read")
|
||||
choice(histogramCMD_Clear,"Clear")
|
||||
choice(histogramCMD_Start,"Start")
|
||||
choice(histogramCMD_Stop,"Stop")
|
||||
}
|
||||
recordtype(histogram) {
|
||||
|
||||
=head3 Read Parameters
|
||||
|
||||
The SVL is the input link where the record reads its value. It can be a
|
||||
constant, a database link, or a channel access link. If SVL is a database or
|
||||
channel access link, then SGNL is read from SVL. If SVL is a constant, then SGNL
|
||||
is initialized with the constant value but can be changed via dbPuts. The C<Soft
|
||||
Channel> device support module can be specified in the DTYP field.
|
||||
|
||||
The ULIM and LLIM fields determine the usable range of signal values. Any value
|
||||
of SGNL below LLIM or above ULIM is outside the range and will not be stored in
|
||||
the array. In the NELM field the user must specify the array size, e.g., the
|
||||
number of array elements. Each element in the NELM field holds the counts for an
|
||||
interval of the range of signal counts, the range specified by ULIM and LLIM.
|
||||
These intervals are determined by dividing the range by NELM:
|
||||
|
||||
(ULIM - LLIM) / NELM.
|
||||
|
||||
=fields SVL, SGNL, DTYP, NELM, ULIM, LLIM
|
||||
|
||||
=head3 Operator Display Parameters
|
||||
|
||||
These parameters are used to present meaningful data to the operator. These
|
||||
fields are used to display the value and other parameters of the histogram
|
||||
either textually or graphically. See L<Fields Common to All Record Types> for
|
||||
more on the record name (NAME) and description (DESC) fields.
|
||||
|
||||
=fields NAME, DESC
|
||||
|
||||
=head3 Alarm Parameters
|
||||
|
||||
The Histogram record has the alarm parameters common to all record types.
|
||||
L<Alarm Fields> lists other fields related to a alarms that are common to all
|
||||
record types.
|
||||
|
||||
=head3 Monitor Parameters
|
||||
|
||||
The MDEL field implements the monitor count deadband. Only when MCNT is greater
|
||||
than the value given to MDEL are monitors triggered, MCNT being the number of
|
||||
counts since the last time the record was processed. If MDEL is -1, everytime
|
||||
the record is processed, a monitor is triggered regardless.
|
||||
|
||||
If SDEL is greater than 0, it causes a callback routine to be called. The number
|
||||
specified in SDEL is the callback routines interval. The callback routine is
|
||||
called every SDEL seconds. The callback routine posts an event if MCNT is
|
||||
greater than 0.
|
||||
|
||||
=fields MDEL, SDEL
|
||||
|
||||
=head3 Run-time and Simulation Mode Parameters
|
||||
|
||||
These parameters are used by the run-time code for processing the histogram.
|
||||
They are not configurable by the user prior to run-time. They represent the
|
||||
current state of the record. Many of them are used to process the histogram more
|
||||
efficiently.
|
||||
|
||||
The BPTR field contains a pointer to the unsigned long array of frequency
|
||||
values. The VAL field references this array as well. However, the BPTR field is
|
||||
not accessible at run-time.
|
||||
|
||||
The MCNT field keeps counts the number of signal counts since the last monitor
|
||||
was invoked.
|
||||
|
||||
The collections controls field (CMD) is a menu field with five choices:
|
||||
|
||||
=menu histogramCMD
|
||||
|
||||
When CMD is C<Read>, the record retrieves its values and adds them to the signal
|
||||
array. This command will first clear the signal counts which have already been
|
||||
read when it is first invoked.
|
||||
|
||||
The C<Clear> command erases the signal counts, setting the elements in the array
|
||||
back to zero. Afterwards, the CMD field is set back to C<Read>.
|
||||
|
||||
The C<Start> command simply causes the record to read signal values into the
|
||||
array. Unlike C<Read>, it doesn't clear the array first.
|
||||
|
||||
The C<Stop> command disables the reading of signal values into the array.
|
||||
|
||||
The C<Setup> command waits until the C<start> or C<read> command has been issued
|
||||
to start counting.
|
||||
|
||||
The CSTA or collections status field implements the CMD field choices by
|
||||
enabling or disabling the reading of values into the histogram array. While
|
||||
FALSE, no signals are added to the array. While TRUE, signals are read and added
|
||||
to the array. The field is initialized to TRUE. The C<Stop> command is the only
|
||||
command that sets CSTA to FALSE. On the other hand, the C<Start> command is the
|
||||
only command that sets it to TRUE. Thus, C<Start> must be invoked after each
|
||||
C<Stop> command in order to enable counting; invoking C<Read> will not enable
|
||||
signal counting after C<Stop> has been invoked.
|
||||
|
||||
A typical use of these fields would be to initialize the CMD field to C<Read>
|
||||
(it is initialized to this command by default), to use the C<Stop> command to
|
||||
disable counting when necessary, after which the C<Start> command can be invoked
|
||||
to re-start the signal count.
|
||||
|
||||
The WDTH field is a private field that holds the signal width of the array
|
||||
elements. For instance, if the LLIM was configured to be 4.0 and ULIM was
|
||||
configured to be 12.0 and the NELM was set to 4, then the WDTH for each array
|
||||
would be 2. Thus, it is (ULIM - LLIM) / NELM.
|
||||
|
||||
=fields BPTR, VAL, MCNT, CMD, CSTA, WDTH
|
||||
|
||||
The following fields are used to operate the histogram record in simulation
|
||||
mode. See L<Fields Common to Many Record Types> for more information on the
|
||||
simulation mode fields.
|
||||
|
||||
=fields SIOL, SVAL, SIML, SIMM, SIMS
|
||||
|
||||
=cut
|
||||
|
||||
include "dbCommon.dbd"
|
||||
field(VAL,DBF_NOACCESS) {
|
||||
prompt("Value")
|
||||
asl(ASL0)
|
||||
special(SPC_DBADDR)
|
||||
extra("void * val")
|
||||
#=type ULONG[]
|
||||
#=read Yes
|
||||
#=write Yes
|
||||
}
|
||||
field(NELM,DBF_USHORT) {
|
||||
prompt("Num of Array Elements")
|
||||
promptgroup("30 - Action")
|
||||
special(SPC_NOMOD)
|
||||
interest(1)
|
||||
initial("1")
|
||||
}
|
||||
field(CSTA,DBF_SHORT) {
|
||||
prompt("Collection Status")
|
||||
special(SPC_NOMOD)
|
||||
interest(1)
|
||||
initial("1")
|
||||
}
|
||||
field(CMD,DBF_MENU) {
|
||||
prompt("Collection Control")
|
||||
asl(ASL0)
|
||||
special(SPC_CALC)
|
||||
interest(1)
|
||||
menu(histogramCMD)
|
||||
}
|
||||
field(ULIM,DBF_DOUBLE) {
|
||||
prompt("Upper Signal Limit")
|
||||
promptgroup("30 - Action")
|
||||
special(SPC_RESET)
|
||||
interest(1)
|
||||
prop(YES)
|
||||
}
|
||||
field(LLIM,DBF_DOUBLE) {
|
||||
prompt("Lower Signal Limit ")
|
||||
promptgroup("30 - Action")
|
||||
special(SPC_RESET)
|
||||
interest(1)
|
||||
prop(YES)
|
||||
}
|
||||
field(WDTH,DBF_DOUBLE) {
|
||||
prompt("Element Width")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(SGNL,DBF_DOUBLE) {
|
||||
prompt("Signal Value")
|
||||
special(SPC_MOD)
|
||||
}
|
||||
field(PREC,DBF_SHORT) {
|
||||
prompt("Display Precision")
|
||||
promptgroup("80 - Display")
|
||||
interest(1)
|
||||
prop(YES)
|
||||
}
|
||||
field(SVL,DBF_INLINK) {
|
||||
prompt("Signal Value Location")
|
||||
promptgroup("40 - Input")
|
||||
interest(1)
|
||||
}
|
||||
field(BPTR,DBF_NOACCESS) {
|
||||
prompt("Buffer Pointer")
|
||||
special(SPC_NOMOD)
|
||||
interest(4)
|
||||
extra("epicsUInt32 *bptr")
|
||||
}
|
||||
field(WDOG,DBF_NOACCESS) {
|
||||
prompt("Watchdog callback")
|
||||
special(SPC_NOMOD)
|
||||
interest(4)
|
||||
extra("void * wdog")
|
||||
}
|
||||
field(MDEL,DBF_SHORT) {
|
||||
prompt("Monitor Count Deadband")
|
||||
promptgroup("80 - Display")
|
||||
interest(1)
|
||||
}
|
||||
field(MCNT,DBF_SHORT) {
|
||||
prompt("Counts Since Monitor")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(SDEL,DBF_DOUBLE) {
|
||||
prompt("Monitor Seconds Dband")
|
||||
promptgroup("80 - Display")
|
||||
special(SPC_RESET)
|
||||
interest(1)
|
||||
}
|
||||
field(SIOL,DBF_INLINK) {
|
||||
prompt("Simulation Input Link")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(1)
|
||||
}
|
||||
field(SVAL,DBF_DOUBLE) {
|
||||
prompt("Simulation Value")
|
||||
}
|
||||
field(SIML,DBF_INLINK) {
|
||||
prompt("Simulation Mode Link")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(1)
|
||||
}
|
||||
field(SIMM,DBF_MENU) {
|
||||
prompt("Simulation Mode")
|
||||
special(SPC_MOD)
|
||||
interest(1)
|
||||
menu(menuYesNo)
|
||||
}
|
||||
field(SIMS,DBF_MENU) {
|
||||
prompt("Simulation Mode Severity")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(2)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(OLDSIMM,DBF_MENU) {
|
||||
prompt("Prev. Simulation Mode")
|
||||
special(SPC_NOMOD)
|
||||
interest(4)
|
||||
menu(menuSimm)
|
||||
}
|
||||
field(SSCN,DBF_MENU) {
|
||||
prompt("Sim. Mode Scan")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(1)
|
||||
menu(menuScan)
|
||||
initial("65535")
|
||||
}
|
||||
field(SDLY,DBF_DOUBLE) {
|
||||
prompt("Sim. Mode Async Delay")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(2)
|
||||
initial("-1.0")
|
||||
}
|
||||
%#include "callback.h"
|
||||
field(SIMPVT,DBF_NOACCESS) {
|
||||
prompt("Sim. Mode Private")
|
||||
special(SPC_NOMOD)
|
||||
interest(4)
|
||||
extra("epicsCallback *simpvt")
|
||||
}
|
||||
field(HOPR,DBF_ULONG) {
|
||||
prompt("High Operating Range")
|
||||
promptgroup("80 - Display")
|
||||
interest(1)
|
||||
prop(YES)
|
||||
}
|
||||
field(LOPR,DBF_ULONG) {
|
||||
prompt("Low Operating Range")
|
||||
promptgroup("80 - Display")
|
||||
interest(1)
|
||||
prop(YES)
|
||||
}
|
||||
|
||||
=head2 Record Support
|
||||
|
||||
=head3 Record Support Routines
|
||||
|
||||
=head4 init_record
|
||||
|
||||
Using NELM, space for the unsigned long array is allocated and the width WDTH of
|
||||
the array is calculated.
|
||||
|
||||
This routine initializes SIMM with the value of SIML if SIML type is CONSTANT
|
||||
link or creates a channel access link if SIML type is PV_LINK. SVAL is likewise
|
||||
initialized if SIOL is CONSTANT or PV_LINK.
|
||||
|
||||
This routine next checks to see that device support and a device support read
|
||||
routine are available. If device support includes C<init_record()>, it is
|
||||
called.
|
||||
|
||||
=head4 process
|
||||
|
||||
See next section.
|
||||
|
||||
=head4 special
|
||||
|
||||
Special is invoked whenever the fields CMD, SGNL, ULIM, or LLIM are changed.
|
||||
|
||||
If SGNL is changed, add_count is called.
|
||||
|
||||
If ULIM or LLIM are changed, WDTH is recalculated and clear_histogram is called.
|
||||
|
||||
If CMD is less or equal to 1, clear_histogram is called and CMD is reset to 0.
|
||||
If CMD is 2, CSTA is set to TRUE and CMD is reset to 0. If CMD is 3, CSTA is set
|
||||
to FALSE and CMD is reset to 0.
|
||||
|
||||
clear_histogram zeros out the histogram array. add_count increments the
|
||||
frequency in the histogram array.
|
||||
|
||||
=head4 cvt_dbaddr
|
||||
|
||||
This is called by dbNameToAddr. It makes the dbAddr structure refer to the
|
||||
actual buffer holding the array.
|
||||
|
||||
=head4 get_array_info
|
||||
|
||||
Obtains values from the array referenced by VAL.
|
||||
|
||||
=head4 put_array_info
|
||||
|
||||
Writes values into the array referenced by VAL.
|
||||
|
||||
=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.
|
||||
|
||||
readValue is called. See L<Input Records> for more information
|
||||
|
||||
=item 3.
|
||||
|
||||
If PACT has been changed to TRUE, the device support read routine has started
|
||||
but has not completed writing the new value. In this case, the processing
|
||||
routine merely returns, leaving PACT TRUE.
|
||||
|
||||
=item 4.
|
||||
|
||||
Add count to histogram array.
|
||||
|
||||
=item 5.
|
||||
|
||||
Check to see if monitors should be invoked. Alarm monitors are invoked if the
|
||||
alarm status or severity has changed. Archive and value change monitors are
|
||||
invoked if MDEL conditions are met. NSEV and NSTA are reset to 0.
|
||||
|
||||
=item 6.
|
||||
|
||||
Scan forward link if necessary, set PACT and INIT to FALSE, and return.
|
||||
|
||||
=back
|
||||
|
||||
=head2 Device Support
|
||||
|
||||
=head3 Fields Of Interest To Device Support
|
||||
|
||||
The device support routines are primarily interested in the following fields:
|
||||
|
||||
=fields PACT, DPVT, UDF, NSEV, NSTA, SVL, SGNL
|
||||
|
||||
=head3 Device Support Routines
|
||||
|
||||
Device support consists of the following routines:
|
||||
|
||||
=head4 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.
|
||||
|
||||
=head4 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.
|
||||
|
||||
=head4 init_record
|
||||
|
||||
init_record(precord)
|
||||
|
||||
This routine is called by the record support C<init_record()> routine. It makes
|
||||
sure that SGNL is a CONSTANT, PV_LINK, DB_LINK, or CA_LINK. It also retrieves a
|
||||
value for SVL from SGNL. If SGNL is none of the above, an error is generated.
|
||||
|
||||
=head4 read_histogram
|
||||
|
||||
read_histogram(*precord)
|
||||
|
||||
This routine is called by the record support routines. It retrieves a value for
|
||||
SVL from SGNL.
|
||||
|
||||
=head3 Device Support For Soft Records
|
||||
|
||||
Only the device support module C<Soft Channel> is currently provided, though
|
||||
other device support modules may be provided at the user's site.
|
||||
|
||||
=head4 Soft Channel
|
||||
|
||||
The C<Soft Channel> device support routine retrieves a value from SGNL. SGNL
|
||||
must be CONSTANT, PV_LINK, DB_LINK, or CA_LINK.
|
||||
|
||||
=cut
|
||||
|
||||
}
|
||||
|
||||
variable(histogramSDELprecision, int)
|
||||
@@ -1,115 +0,0 @@
|
||||
#*************************************************************************
|
||||
# Copyright (c) 2012 UChicago Argonne LLC, as Operator of Argonne
|
||||
# National Laboratory.
|
||||
# EPICS BASE is distributed subject to a Software License Agreement found
|
||||
# in file LICENSE that is included with this distribution.
|
||||
#*************************************************************************
|
||||
|
||||
recordtype(lsi) {
|
||||
include "dbCommon.dbd"
|
||||
%#include "devSup.h"
|
||||
%
|
||||
%/* Declare Device Support Entry Table */
|
||||
%typedef struct lsidset {
|
||||
% long number;
|
||||
% DEVSUPFUN report;
|
||||
% DEVSUPFUN init;
|
||||
% DEVSUPFUN init_record;
|
||||
% DEVSUPFUN get_ioint_info;
|
||||
% DEVSUPFUN read_string;
|
||||
%} lsidset;
|
||||
%
|
||||
field(VAL,DBF_NOACCESS) {
|
||||
prompt("Current Value")
|
||||
asl(ASL0)
|
||||
pp(TRUE)
|
||||
special(SPC_DBADDR)
|
||||
extra("char *val")
|
||||
}
|
||||
field(OVAL,DBF_NOACCESS) {
|
||||
prompt("Old Value")
|
||||
special(SPC_DBADDR)
|
||||
interest(3)
|
||||
extra("char *oval")
|
||||
}
|
||||
field(SIZV,DBF_USHORT) {
|
||||
prompt("Size of buffers")
|
||||
promptgroup("40 - Input")
|
||||
special(SPC_NOMOD)
|
||||
interest(1)
|
||||
initial("41")
|
||||
}
|
||||
field(LEN,DBF_ULONG) {
|
||||
prompt("Length of VAL")
|
||||
special(SPC_NOMOD)
|
||||
}
|
||||
field(OLEN,DBF_ULONG) {
|
||||
prompt("Length of OVAL")
|
||||
special(SPC_NOMOD)
|
||||
}
|
||||
field(INP,DBF_INLINK) {
|
||||
prompt("Input Specification")
|
||||
promptgroup("40 - Input")
|
||||
interest(1)
|
||||
}
|
||||
field(MPST,DBF_MENU) {
|
||||
prompt("Post Value Monitors")
|
||||
promptgroup("80 - Display")
|
||||
interest(1)
|
||||
menu(menuPost)
|
||||
}
|
||||
field(APST,DBF_MENU) {
|
||||
prompt("Post Archive Monitors")
|
||||
promptgroup("80 - Display")
|
||||
interest(1)
|
||||
menu(menuPost)
|
||||
}
|
||||
field(SIML,DBF_INLINK) {
|
||||
prompt("Simulation Mode Link")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(1)
|
||||
}
|
||||
field(SIMM,DBF_MENU) {
|
||||
prompt("Simulation Mode")
|
||||
special(SPC_MOD)
|
||||
interest(1)
|
||||
menu(menuYesNo)
|
||||
}
|
||||
field(SIMS,DBF_MENU) {
|
||||
prompt("Simulation Mode Severity")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(2)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(SIOL,DBF_INLINK) {
|
||||
prompt("Simulation Input Link")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(1)
|
||||
}
|
||||
field(OLDSIMM,DBF_MENU) {
|
||||
prompt("Prev. Simulation Mode")
|
||||
special(SPC_NOMOD)
|
||||
interest(4)
|
||||
menu(menuSimm)
|
||||
}
|
||||
field(SSCN,DBF_MENU) {
|
||||
prompt("Sim. Mode Scan")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(1)
|
||||
menu(menuScan)
|
||||
initial("65535")
|
||||
}
|
||||
field(SDLY,DBF_DOUBLE) {
|
||||
prompt("Sim. Mode Async Delay")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(2)
|
||||
initial("-1.0")
|
||||
}
|
||||
%#include "callback.h"
|
||||
field(SIMPVT,DBF_NOACCESS) {
|
||||
prompt("Sim. Mode Private")
|
||||
special(SPC_NOMOD)
|
||||
interest(4)
|
||||
extra("epicsCallback *simpvt")
|
||||
}
|
||||
}
|
||||
234
modules/database/src/std/rec/lsiRecord.dbd.pod
Normal file
234
modules/database/src/std/rec/lsiRecord.dbd.pod
Normal file
@@ -0,0 +1,234 @@
|
||||
#*************************************************************************
|
||||
# Copyright (c) 2012 UChicago Argonne LLC, as Operator of Argonne
|
||||
# National Laboratory.
|
||||
# EPICS BASE is distributed subject to a Software License Agreement found
|
||||
# in file LICENSE that is included with this distribution.
|
||||
#*************************************************************************
|
||||
|
||||
|
||||
=title Long String Input Record (lsi)
|
||||
|
||||
The long string input record is used to retrieve an arbitrary ASCII string with
|
||||
a maximum length of 65535 characters.
|
||||
|
||||
=head2 Parameter Fields
|
||||
|
||||
The record-specific fields are described below, grouped by functionality.
|
||||
|
||||
=recordtype lsi
|
||||
|
||||
=cut
|
||||
|
||||
recordtype(lsi) {
|
||||
|
||||
=head3 Scan Parameters
|
||||
|
||||
The long string input record has the standard fields for specifying under what
|
||||
circumstances it will be processed. These fields are listed in L<Scan Fields>.
|
||||
In addition, L<Scanning Specification> explains how these fields are used.
|
||||
|
||||
=head3 Input Specification
|
||||
|
||||
The INP field determines where the long string input record obtains its string
|
||||
from. It can be a database or channel access link, or a constant. If constant,
|
||||
the VAL field is initialized with the constant and can be changed via dbPuts.
|
||||
Otherwise, the string is read from the specified location each time the record
|
||||
is processed and placed in the VAL field. The maximum number of characters in
|
||||
VAL is given by SIZV, and cannot be larger than 65535. In addition, the
|
||||
appropriate device support module must be entered into the DTYP field.
|
||||
|
||||
See L<Address Specification> for information on specifying links.
|
||||
|
||||
=fields VAL, OVAL, SIZV, INP, DTYP
|
||||
|
||||
=cut
|
||||
|
||||
include "dbCommon.dbd"
|
||||
%#include "devSup.h"
|
||||
%
|
||||
%/* Declare Device Support Entry Table */
|
||||
%typedef struct lsidset {
|
||||
% long number;
|
||||
% DEVSUPFUN report;
|
||||
% DEVSUPFUN init;
|
||||
% DEVSUPFUN init_record;
|
||||
% DEVSUPFUN get_ioint_info;
|
||||
% DEVSUPFUN read_string;
|
||||
%} lsidset;
|
||||
%
|
||||
field(VAL,DBF_NOACCESS) {
|
||||
prompt("Current Value")
|
||||
asl(ASL0)
|
||||
pp(TRUE)
|
||||
special(SPC_DBADDR)
|
||||
extra("char *val")
|
||||
#=type STRING[SIZV]
|
||||
#=read Yes
|
||||
#=write Yes
|
||||
}
|
||||
field(OVAL,DBF_NOACCESS) {
|
||||
prompt("Old Value")
|
||||
special(SPC_DBADDR)
|
||||
interest(3)
|
||||
extra("char *oval")
|
||||
#=type STRING[SIZV]
|
||||
#=read Yes
|
||||
#=write No
|
||||
}
|
||||
field(SIZV,DBF_USHORT) {
|
||||
prompt("Size of buffers")
|
||||
promptgroup("40 - Input")
|
||||
special(SPC_NOMOD)
|
||||
interest(1)
|
||||
initial("41")
|
||||
}
|
||||
field(LEN,DBF_ULONG) {
|
||||
prompt("Length of VAL")
|
||||
special(SPC_NOMOD)
|
||||
}
|
||||
field(OLEN,DBF_ULONG) {
|
||||
prompt("Length of OVAL")
|
||||
special(SPC_NOMOD)
|
||||
}
|
||||
field(INP,DBF_INLINK) {
|
||||
prompt("Input Specification")
|
||||
promptgroup("40 - Input")
|
||||
interest(1)
|
||||
}
|
||||
|
||||
=head3 Monitor Parameters
|
||||
|
||||
These parameters are used to specify when the monitor post should be sent by the
|
||||
C<monitor()> routine. There are two possible choices:
|
||||
|
||||
APST is used for archiver monitors and MPST for all other type of monitors.
|
||||
|
||||
=fields MPST, APST
|
||||
|
||||
=cut
|
||||
|
||||
field(MPST,DBF_MENU) {
|
||||
prompt("Post Value Monitors")
|
||||
promptgroup("80 - Display")
|
||||
interest(1)
|
||||
menu(menuPost)
|
||||
}
|
||||
field(APST,DBF_MENU) {
|
||||
prompt("Post Archive Monitors")
|
||||
promptgroup("80 - Display")
|
||||
interest(1)
|
||||
menu(menuPost)
|
||||
}
|
||||
|
||||
=head3 Operator Display Parameters
|
||||
|
||||
See L<Fields Common to All Record Types> for more on the record name (NAME) and
|
||||
description (DESC) fields.
|
||||
|
||||
=fields NAME, DESC
|
||||
|
||||
=head3 Alarm Parameters
|
||||
|
||||
The long string input record has the alarm parameters common to all record
|
||||
types. L<Alarm Fields> lists other fields related to a alarms that are common to
|
||||
all record types.
|
||||
|
||||
=head3 Run-time and Simulation Mode Parameters
|
||||
|
||||
The old value field (OVAL) of the long string input record is used to implement
|
||||
value change monitors for VAL. If VAL is not equal to OVAL, then monitors are
|
||||
triggered. LEN contains the length of the string in VAL, OLEN contains the
|
||||
length of the string in OVAL.
|
||||
|
||||
=fields OVAL, LEN, OLEN
|
||||
|
||||
|
||||
The following fields are used to operate the string input in the simulation
|
||||
mode. See L<Simulation Mode> for more information on simulation mode fields.
|
||||
|
||||
=fields SIOL, SIML, SIMM, SIMS
|
||||
|
||||
=cut
|
||||
|
||||
field(SIML,DBF_INLINK) {
|
||||
prompt("Simulation Mode Link")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(1)
|
||||
}
|
||||
field(SIMM,DBF_MENU) {
|
||||
prompt("Simulation Mode")
|
||||
special(SPC_MOD)
|
||||
interest(1)
|
||||
menu(menuYesNo)
|
||||
}
|
||||
field(SIMS,DBF_MENU) {
|
||||
prompt("Simulation Mode Severity")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(2)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(SIOL,DBF_INLINK) {
|
||||
prompt("Simulation Input Link")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(1)
|
||||
}
|
||||
field(OLDSIMM,DBF_MENU) {
|
||||
prompt("Prev. Simulation Mode")
|
||||
special(SPC_NOMOD)
|
||||
interest(4)
|
||||
menu(menuSimm)
|
||||
}
|
||||
field(SSCN,DBF_MENU) {
|
||||
prompt("Sim. Mode Scan")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(1)
|
||||
menu(menuScan)
|
||||
initial("65535")
|
||||
}
|
||||
field(SDLY,DBF_DOUBLE) {
|
||||
prompt("Sim. Mode Async Delay")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(2)
|
||||
initial("-1.0")
|
||||
}
|
||||
%#include "callback.h"
|
||||
field(SIMPVT,DBF_NOACCESS) {
|
||||
prompt("Sim. Mode Private")
|
||||
special(SPC_NOMOD)
|
||||
interest(4)
|
||||
extra("epicsCallback *simpvt")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
=head2 Device Support Interface
|
||||
|
||||
The record requires device support to provide an entry table (dset) which
|
||||
defines the following members:
|
||||
|
||||
typedef struct {
|
||||
long number;
|
||||
long (*report)(int level);
|
||||
long (*init)(int after);
|
||||
long (*init_record)(lsiRecord *prec);
|
||||
long (*get_ioint_info)(int cmd, lsiRecord *prec, IOSCANPVT *piosl);
|
||||
long (*read_string)(lsiRecord *prec);
|
||||
} lsidset;
|
||||
|
||||
The module must set C<number> to at least 5, and provide a pointer to its
|
||||
C<read_string()> routine; the other function pointers may be C<NULL> if their
|
||||
associated functionality is not required for this support layer.
|
||||
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.
|
||||
|
||||
=head2 Device Support for Soft Records
|
||||
|
||||
A device support module for DTYP C<Soft Channel> is provided for retrieving
|
||||
values from other records or other software components.
|
||||
|
||||
Device support for DTYP C<getenv> is provided for retrieving strings from
|
||||
environment variables. C<INST_IO> addressing C<< @<environment variable> >> is
|
||||
used on the C<INP> link field to select the desired environment variable.
|
||||
|
||||
=cut
|
||||
@@ -1,139 +0,0 @@
|
||||
#*************************************************************************
|
||||
# Copyright (c) 2012 UChicago Argonne LLC, as Operator of Argonne
|
||||
# National Laboratory.
|
||||
# EPICS BASE is distributed subject to a Software License Agreement found
|
||||
# in file LICENSE that is included with this distribution.
|
||||
#*************************************************************************
|
||||
|
||||
recordtype(lso) {
|
||||
include "dbCommon.dbd"
|
||||
%#include "devSup.h"
|
||||
%
|
||||
%/* Declare Device Support Entry Table */
|
||||
%typedef struct lsodset {
|
||||
% long number;
|
||||
% DEVSUPFUN report;
|
||||
% DEVSUPFUN init;
|
||||
% DEVSUPFUN init_record;
|
||||
% DEVSUPFUN get_ioint_info;
|
||||
% DEVSUPFUN write_string;
|
||||
%} lsodset;
|
||||
%
|
||||
field(VAL,DBF_NOACCESS) {
|
||||
prompt("Current Value")
|
||||
asl(ASL0)
|
||||
pp(TRUE)
|
||||
special(SPC_DBADDR)
|
||||
extra("char *val")
|
||||
}
|
||||
field(OVAL,DBF_NOACCESS) {
|
||||
prompt("Previous Value")
|
||||
special(SPC_DBADDR)
|
||||
interest(3)
|
||||
extra("char *oval")
|
||||
}
|
||||
field(SIZV,DBF_USHORT) {
|
||||
prompt("Size of buffers")
|
||||
promptgroup("50 - Output")
|
||||
special(SPC_NOMOD)
|
||||
interest(1)
|
||||
initial("41")
|
||||
}
|
||||
field(LEN,DBF_ULONG) {
|
||||
prompt("Length of VAL")
|
||||
special(SPC_NOMOD)
|
||||
}
|
||||
field(OLEN,DBF_ULONG) {
|
||||
prompt("Length of OVAL")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(DOL,DBF_INLINK) {
|
||||
prompt("Desired Output Link")
|
||||
promptgroup("40 - Input")
|
||||
interest(1)
|
||||
}
|
||||
field(IVOA,DBF_MENU) {
|
||||
prompt("INVALID Output Action")
|
||||
promptgroup("50 - Output")
|
||||
interest(2)
|
||||
menu(menuIvoa)
|
||||
}
|
||||
field(IVOV,DBF_STRING) {
|
||||
prompt("INVALID Output Value")
|
||||
promptgroup("50 - Output")
|
||||
interest(2)
|
||||
size(40)
|
||||
}
|
||||
field(OMSL,DBF_MENU) {
|
||||
prompt("Output Mode Select")
|
||||
promptgroup("50 - Output")
|
||||
interest(1)
|
||||
menu(menuOmsl)
|
||||
}
|
||||
field(OUT,DBF_OUTLINK) {
|
||||
prompt("Output Specification")
|
||||
promptgroup("50 - Output")
|
||||
interest(1)
|
||||
}
|
||||
field(MPST,DBF_MENU) {
|
||||
prompt("Post Value Monitors")
|
||||
promptgroup("80 - Display")
|
||||
interest(1)
|
||||
menu(menuPost)
|
||||
}
|
||||
field(APST,DBF_MENU) {
|
||||
prompt("Post Archive Monitors")
|
||||
promptgroup("80 - Display")
|
||||
interest(1)
|
||||
menu(menuPost)
|
||||
}
|
||||
field(SIML,DBF_INLINK) {
|
||||
prompt("Simulation Mode link")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(1)
|
||||
}
|
||||
field(SIMM,DBF_MENU) {
|
||||
prompt("Simulation Mode")
|
||||
special(SPC_MOD)
|
||||
interest(1)
|
||||
menu(menuYesNo)
|
||||
}
|
||||
field(SIMS,DBF_MENU) {
|
||||
prompt("Simulation Mode Severity")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(2)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(SIOL,DBF_OUTLINK) {
|
||||
prompt("Simulation Output Link")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(1)
|
||||
}
|
||||
field(OLDSIMM,DBF_MENU) {
|
||||
prompt("Prev. Simulation Mode")
|
||||
special(SPC_NOMOD)
|
||||
interest(4)
|
||||
menu(menuSimm)
|
||||
}
|
||||
field(SSCN,DBF_MENU) {
|
||||
prompt("Sim. Mode Scan")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(1)
|
||||
menu(menuScan)
|
||||
initial("65535")
|
||||
}
|
||||
field(SDLY,DBF_DOUBLE) {
|
||||
prompt("Sim. Mode Async Delay")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(2)
|
||||
initial("-1.0")
|
||||
}
|
||||
%#include "callback.h"
|
||||
field(SIMPVT,DBF_NOACCESS) {
|
||||
prompt("Sim. Mode Private")
|
||||
special(SPC_NOMOD)
|
||||
interest(4)
|
||||
extra("epicsCallback *simpvt")
|
||||
}
|
||||
}
|
||||
293
modules/database/src/std/rec/lsoRecord.dbd.pod
Normal file
293
modules/database/src/std/rec/lsoRecord.dbd.pod
Normal file
@@ -0,0 +1,293 @@
|
||||
#*************************************************************************
|
||||
# Copyright (c) 2012 UChicago Argonne LLC, as Operator of Argonne
|
||||
# National Laboratory.
|
||||
# EPICS BASE is distributed subject to a Software License Agreement found
|
||||
# in file LICENSE that is included with this distribution.
|
||||
#*************************************************************************
|
||||
|
||||
|
||||
=title Long String Output Record (lso)
|
||||
|
||||
The long string output record is used to write an arbitrary ASCII string with a
|
||||
maximum length of 65535 characters.
|
||||
|
||||
=head2 Parameter Fields
|
||||
|
||||
The record-specific fields are described below, grouped by functionality.
|
||||
|
||||
=recordtype lso
|
||||
|
||||
=cut
|
||||
|
||||
include "menuIvoa.dbd"
|
||||
|
||||
recordtype(lso) {
|
||||
|
||||
=head3 Scan Parameters
|
||||
|
||||
The long string output record has the standard fields for specifying under what
|
||||
circumstances it will be processed. These fields are listed in L<Scan Fields>.
|
||||
In addition, L<Scanning Specification> explains how these fields are used.
|
||||
|
||||
=head3 Desired Output Parameters
|
||||
|
||||
The long string output record must specify from where it gets its desired output
|
||||
string. The first field that determines where the desired output originates is
|
||||
the output mode select (OMSL) field, which can have two possible value:
|
||||
C<closed_loop> or C<supervisory>. If C<supervisory> is specified, DOL is
|
||||
ignored, the current value of VAL is written, and VAL can be changed externally
|
||||
via dbPuts at run-time. If C<closed_loop> is specified, the VAL field's value is
|
||||
obtained from the address specified in the desired output location field (DOL)
|
||||
which can be either a database link or a channel access link.
|
||||
|
||||
The maximum number of characters in VAL is given by SIZV, and cannot be larger
|
||||
than 65535.
|
||||
|
||||
DOL can also be a constant in addition to a link, in which case VAL is
|
||||
initialized to the constant value. Your string constant, however, may be
|
||||
interpreted as a CA link name. If you want to initialize your string output
|
||||
record, it is therefore best to use the VAL field. Note that if DOL is a
|
||||
constant, OMSL cannot be C<closed_loop>.
|
||||
|
||||
See L<Address Specification> for information on specifying links.
|
||||
|
||||
=fields VAL, SIZV, DOL, OMSL
|
||||
|
||||
=head3 Output Specification
|
||||
|
||||
The output link specified in the OUT field specifies where the long string
|
||||
output record is to write its string. The link can be a database or channel
|
||||
access link. If the OUT field is a constant, no output will be written.
|
||||
|
||||
See L<Address Specification> for information on specifying links.
|
||||
|
||||
In addition, the appropriate device support module must be entered into the DTYP
|
||||
field.
|
||||
|
||||
|
||||
=fields OUT, DTYP
|
||||
|
||||
=head3 Monitor Parameters
|
||||
|
||||
These parameters are used to specify when the monitor post should be sent by the
|
||||
C<monitor()> routine. There are two possible choices:
|
||||
|
||||
APST is used for archiver monitors and MPST for all other type of monitors.
|
||||
|
||||
=fields MPST, APST
|
||||
|
||||
|
||||
=head3 Operator Display Parameters
|
||||
|
||||
See L<Fields Common to All Record Types> for more on the record name (NAME) and
|
||||
description (DESC) fields.
|
||||
|
||||
=fields NAME, DESC
|
||||
|
||||
=head3 Alarm Parameters
|
||||
|
||||
The long string input record has the alarm parameters common to all record
|
||||
types. L<Alarm Fields> lists other fields related to a alarms that are common to
|
||||
all record types.
|
||||
|
||||
The IVOA field specifies an action to take when the INVALID alarm is triggered.
|
||||
There are three possible actions:
|
||||
|
||||
=head4 Menu menuIvoa
|
||||
|
||||
=menu menuIvoa
|
||||
|
||||
When C<<< Set output to IVOV >>>, the value contained in the IVOV field is
|
||||
written to the output link during an alarm condition. See
|
||||
L<Invalid Alarm Output Action>
|
||||
for more information on the IVOA and IVOV fields.
|
||||
L<Alarm Fields>
|
||||
lists other fields related to a alarms that are common to all record types.
|
||||
|
||||
=fields IVOA, IVOV
|
||||
|
||||
=cut
|
||||
|
||||
include "dbCommon.dbd"
|
||||
%#include "devSup.h"
|
||||
%
|
||||
%/* Declare Device Support Entry Table */
|
||||
%typedef struct lsodset {
|
||||
% long number;
|
||||
% DEVSUPFUN report;
|
||||
% DEVSUPFUN init;
|
||||
% DEVSUPFUN init_record;
|
||||
% DEVSUPFUN get_ioint_info;
|
||||
% DEVSUPFUN write_string;
|
||||
%} lsodset;
|
||||
%
|
||||
field(VAL,DBF_NOACCESS) {
|
||||
prompt("Current Value")
|
||||
asl(ASL0)
|
||||
pp(TRUE)
|
||||
special(SPC_DBADDR)
|
||||
extra("char *val")
|
||||
}
|
||||
field(OVAL,DBF_NOACCESS) {
|
||||
prompt("Previous Value")
|
||||
special(SPC_DBADDR)
|
||||
interest(3)
|
||||
extra("char *oval")
|
||||
}
|
||||
field(SIZV,DBF_USHORT) {
|
||||
prompt("Size of buffers")
|
||||
promptgroup("50 - Output")
|
||||
special(SPC_NOMOD)
|
||||
interest(1)
|
||||
initial("41")
|
||||
}
|
||||
field(LEN,DBF_ULONG) {
|
||||
prompt("Length of VAL")
|
||||
special(SPC_NOMOD)
|
||||
}
|
||||
field(OLEN,DBF_ULONG) {
|
||||
prompt("Length of OVAL")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(DOL,DBF_INLINK) {
|
||||
prompt("Desired Output Link")
|
||||
promptgroup("40 - Input")
|
||||
interest(1)
|
||||
}
|
||||
field(IVOA,DBF_MENU) {
|
||||
prompt("INVALID Output Action")
|
||||
promptgroup("50 - Output")
|
||||
interest(2)
|
||||
menu(menuIvoa)
|
||||
}
|
||||
field(IVOV,DBF_STRING) {
|
||||
prompt("INVALID Output Value")
|
||||
promptgroup("50 - Output")
|
||||
interest(2)
|
||||
size(40)
|
||||
}
|
||||
field(OMSL,DBF_MENU) {
|
||||
prompt("Output Mode Select")
|
||||
promptgroup("50 - Output")
|
||||
interest(1)
|
||||
menu(menuOmsl)
|
||||
}
|
||||
field(OUT,DBF_OUTLINK) {
|
||||
prompt("Output Specification")
|
||||
promptgroup("50 - Output")
|
||||
interest(1)
|
||||
}
|
||||
field(MPST,DBF_MENU) {
|
||||
prompt("Post Value Monitors")
|
||||
promptgroup("80 - Display")
|
||||
interest(1)
|
||||
menu(menuPost)
|
||||
}
|
||||
field(APST,DBF_MENU) {
|
||||
prompt("Post Archive Monitors")
|
||||
promptgroup("80 - Display")
|
||||
interest(1)
|
||||
menu(menuPost)
|
||||
}
|
||||
|
||||
|
||||
=head3 Run-time and Simulation Mode Parameters
|
||||
|
||||
The old value field (OVAL) of the long string input record is used to implement
|
||||
value change monitors for VAL. If VAL is not equal to OVAL, then monitors are
|
||||
triggered. LEN contains the length of the string in VAL, OLEN contains the
|
||||
length of the string in OVAL.
|
||||
|
||||
=fields OVAL, LEN, OLEN
|
||||
|
||||
The following fields are used to operate the string input in the simulation
|
||||
mode. See L<Simulation Mode> for more information on simulation mode fields.
|
||||
|
||||
=fields SIOL, SIML, SIMM, SIMS
|
||||
|
||||
=cut
|
||||
|
||||
field(SIML,DBF_INLINK) {
|
||||
prompt("Simulation Mode link")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(1)
|
||||
}
|
||||
field(SIMM,DBF_MENU) {
|
||||
prompt("Simulation Mode")
|
||||
special(SPC_MOD)
|
||||
interest(1)
|
||||
menu(menuYesNo)
|
||||
}
|
||||
field(SIMS,DBF_MENU) {
|
||||
prompt("Simulation Mode Severity")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(2)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(SIOL,DBF_OUTLINK) {
|
||||
prompt("Simulation Output Link")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(1)
|
||||
}
|
||||
field(OLDSIMM,DBF_MENU) {
|
||||
prompt("Prev. Simulation Mode")
|
||||
special(SPC_NOMOD)
|
||||
interest(4)
|
||||
menu(menuSimm)
|
||||
}
|
||||
field(SSCN,DBF_MENU) {
|
||||
prompt("Sim. Mode Scan")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(1)
|
||||
menu(menuScan)
|
||||
initial("65535")
|
||||
}
|
||||
field(SDLY,DBF_DOUBLE) {
|
||||
prompt("Sim. Mode Async Delay")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(2)
|
||||
initial("-1.0")
|
||||
}
|
||||
%#include "callback.h"
|
||||
field(SIMPVT,DBF_NOACCESS) {
|
||||
prompt("Sim. Mode Private")
|
||||
special(SPC_NOMOD)
|
||||
interest(4)
|
||||
extra("epicsCallback *simpvt")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
=head2 Device Support Interface
|
||||
|
||||
The record requires device support to provide an entry table (dset) which
|
||||
defines the following members:
|
||||
|
||||
typedef struct {
|
||||
long number;
|
||||
long (*report)(int level);
|
||||
long (*init)(int after);
|
||||
long (*init_record)(lsoRecord *prec);
|
||||
long (*get_ioint_info)(int cmd, lsoRecord *prec, IOSCANPVT *piosl);
|
||||
long (*write_string)(lsoRecord *prec);
|
||||
} lsodset;
|
||||
|
||||
The module must set C<number> to at least 5, and provide a pointer to its
|
||||
C<write_string()> routine; the other function pointers may be C<NULL> if their
|
||||
associated functionality is not required for this support layer.
|
||||
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.
|
||||
|
||||
|
||||
=head2 Device Support for Soft Records
|
||||
|
||||
Device support for DTYP C<Soft Channel> is provided for writing values to other
|
||||
records or other software components.
|
||||
|
||||
Device support for DTYP C<stdio> is provided for writing values to the stdout,
|
||||
stderr, or errlog streams. C<INST_IO> addressing C<@stdout>, C<@stderr> or
|
||||
C<@errlog> is used on the OUT link field to select the desired stream.
|
||||
|
||||
=cut
|
||||
@@ -1,109 +0,0 @@
|
||||
#*************************************************************************
|
||||
# Copyright (c) 2012 UChicago Argonne LLC, as Operator of Argonne
|
||||
# National Laboratory.
|
||||
# EPICS BASE is distributed subject to a Software License Agreement found
|
||||
# in file LICENSE that is included with this distribution.
|
||||
#*************************************************************************
|
||||
|
||||
recordtype(printf) {
|
||||
include "dbCommon.dbd"
|
||||
%#include "devSup.h"
|
||||
%
|
||||
%/* Declare Device Support Entry Table */
|
||||
%typedef struct printfdset {
|
||||
% long number;
|
||||
% DEVSUPFUN report;
|
||||
% DEVSUPFUN init;
|
||||
% DEVSUPFUN init_record;
|
||||
% DEVSUPFUN get_ioint_info;
|
||||
% DEVSUPFUN write_string;
|
||||
%} printfdset;
|
||||
%
|
||||
field(VAL,DBF_NOACCESS) {
|
||||
prompt("Result")
|
||||
asl(ASL0)
|
||||
pp(TRUE)
|
||||
special(SPC_DBADDR)
|
||||
extra("char *val")
|
||||
}
|
||||
field(SIZV,DBF_USHORT) {
|
||||
prompt("Size of VAL buffer")
|
||||
promptgroup("30 - Action")
|
||||
special(SPC_NOMOD)
|
||||
interest(1)
|
||||
initial("41")
|
||||
}
|
||||
field(LEN,DBF_ULONG) {
|
||||
prompt("Length of VAL")
|
||||
special(SPC_NOMOD)
|
||||
}
|
||||
field(OUT,DBF_OUTLINK) {
|
||||
prompt("Output Specification")
|
||||
promptgroup("50 - Output")
|
||||
interest(1)
|
||||
}
|
||||
field(FMT,DBF_STRING) {
|
||||
prompt("Format String")
|
||||
promptgroup("30 - Action")
|
||||
pp(TRUE)
|
||||
size(81)
|
||||
}
|
||||
field(IVLS,DBF_STRING) {
|
||||
prompt("Invalid Link String")
|
||||
promptgroup("30 - Action")
|
||||
size(16)
|
||||
initial("LNK")
|
||||
}
|
||||
field(INP0,DBF_INLINK) {
|
||||
prompt("Input 0")
|
||||
promptgroup("40 - Input")
|
||||
interest(1)
|
||||
}
|
||||
field(INP1,DBF_INLINK) {
|
||||
prompt("Input 1")
|
||||
promptgroup("40 - Input")
|
||||
interest(1)
|
||||
}
|
||||
field(INP2,DBF_INLINK) {
|
||||
prompt("Input 2")
|
||||
promptgroup("40 - Input")
|
||||
interest(1)
|
||||
}
|
||||
field(INP3,DBF_INLINK) {
|
||||
prompt("Input 3")
|
||||
promptgroup("40 - Input")
|
||||
interest(1)
|
||||
}
|
||||
field(INP4,DBF_INLINK) {
|
||||
prompt("Input 4")
|
||||
promptgroup("40 - Input")
|
||||
interest(1)
|
||||
}
|
||||
field(INP5,DBF_INLINK) {
|
||||
prompt("Input 5")
|
||||
promptgroup("40 - Input")
|
||||
interest(1)
|
||||
}
|
||||
field(INP6,DBF_INLINK) {
|
||||
prompt("Input 6")
|
||||
promptgroup("40 - Input")
|
||||
interest(1)
|
||||
}
|
||||
field(INP7,DBF_INLINK) {
|
||||
prompt("Input 7")
|
||||
promptgroup("40 - Input")
|
||||
interest(1)
|
||||
}
|
||||
field(INP8,DBF_INLINK) {
|
||||
prompt("Input 8")
|
||||
promptgroup("40 - Input")
|
||||
interest(1)
|
||||
}
|
||||
field(INP9,DBF_INLINK) {
|
||||
prompt("Input 9")
|
||||
promptgroup("40 - Input")
|
||||
interest(1)
|
||||
}
|
||||
%/* Number of INPx fields defined */
|
||||
%#define PRINTF_NLINKS 10
|
||||
}
|
||||
323
modules/database/src/std/rec/printfRecord.dbd.pod
Normal file
323
modules/database/src/std/rec/printfRecord.dbd.pod
Normal file
@@ -0,0 +1,323 @@
|
||||
#*************************************************************************
|
||||
# Copyright (c) 2012 UChicago Argonne LLC, as Operator of Argonne
|
||||
# National Laboratory.
|
||||
# EPICS BASE is distributed subject to a Software License Agreement found
|
||||
# in file LICENSE that is included with this distribution.
|
||||
#*************************************************************************
|
||||
|
||||
|
||||
=title Printf Record (printf)
|
||||
|
||||
The printf record is used to generate and write a string using a format
|
||||
specification and parameters, analogous to the C C<printf()> function.
|
||||
|
||||
=head2 Parameter Fields
|
||||
|
||||
The record-specific fields are described below, grouped by functionality.
|
||||
|
||||
=recordtype printf
|
||||
|
||||
=cut
|
||||
|
||||
recordtype(printf) {
|
||||
|
||||
=head3 Scan Parameters
|
||||
|
||||
The printf record has the standard fields for specifying under what
|
||||
circumstances it will be processed. These fields are listed in L<Scan Fields>.
|
||||
In addition, L<Scanning Specification> explains how these fields are used.
|
||||
|
||||
=head3 String Generation Parameters
|
||||
|
||||
The printf record must specify the desired output string with embedded format
|
||||
specifiers in the FMT field. Plain characters are copied directly to the output
|
||||
string. A pair of percent characters 'C<%%>' are converted into a single percent
|
||||
character in the output string. A single precent character 'C<%>' introduces a
|
||||
format specifier and is followed by zero or more of the standard C<printf()>
|
||||
format flags and modifiers:
|
||||
|
||||
=over 4
|
||||
|
||||
=item *
|
||||
|
||||
Plus ('C<+>')
|
||||
|
||||
=item *
|
||||
|
||||
Minus ('C<->')
|
||||
|
||||
=item *
|
||||
|
||||
Space ('C< >')
|
||||
|
||||
=item *
|
||||
|
||||
Hash ('C<#>')
|
||||
|
||||
=item *
|
||||
|
||||
Minimum Field Width (decimal digits or 'C<*>')
|
||||
|
||||
=item *
|
||||
|
||||
Precision ('C<.>' followed by decimal digits or 'C<*>')
|
||||
|
||||
=item *
|
||||
|
||||
Length Modifier 'C<hh>' E<ndash> Reads link as DBR_CHAR or DBR_UCHAR
|
||||
|
||||
=item *
|
||||
|
||||
Length Modifier 'C<h>' E<ndash> Reads link as DBR_SHORT or DBR_USHORT for
|
||||
integer conversions, DBR_FLOAT for floating-point conversions.
|
||||
|
||||
=item *
|
||||
|
||||
Length Modifier 'C<l>' E<ndash> Reads link as DBR_LONG or DBR_ULONG for integer
|
||||
conversions, array of DBR_CHAR for string conversion.
|
||||
|
||||
=back
|
||||
|
||||
|
||||
The following character specifies the conversion to perform, see your operating
|
||||
system's C<printf()> documentation for more details. These conversions
|
||||
ultimately call the C<snprintf()> routine for the actual string conversion
|
||||
process, so are subject to the behaviour of that routine.
|
||||
|
||||
=over 4
|
||||
|
||||
=item *
|
||||
|
||||
'C<c>' E<ndash> Convert to a character. Only single byte characters are
|
||||
permitted.
|
||||
|
||||
=item *
|
||||
|
||||
'C<d>' or 'C<i>' E<ndash> Convert to a decimal integer.
|
||||
|
||||
=item *
|
||||
|
||||
'C<o>' E<ndash> Convert to an unsigned octal integer.
|
||||
|
||||
=item *
|
||||
|
||||
'C<u>' E<ndash> Convert to an unsigned decimal integer.
|
||||
|
||||
=item *
|
||||
|
||||
'C<x>' E<ndash> Convert to an unsigned hexadecimal integer, using C<abcdef>.
|
||||
|
||||
=item *
|
||||
|
||||
'C<X>' E<ndash> Convert to an unsigned hexadecimal integer, using C<ABCDEF>.
|
||||
|
||||
=item *
|
||||
|
||||
'C<e>' or 'C<E>' E<ndash> Convert to floating-point in exponent style, reading
|
||||
the link as DBR_DOUBLE or DBR_FLOAT.
|
||||
|
||||
=item *
|
||||
|
||||
'C<f>' or 'C<F>' E<ndash> Convert to floating-point in fixed-point style,
|
||||
reading the link as DBR_DOUBLE or DBR_FLOAT.
|
||||
|
||||
=item *
|
||||
|
||||
'C<g>' or 'C<G>' E<ndash> Convert to floating-point in general style, reading
|
||||
the link as DBR_DOUBLE or DBR_FLOAT.
|
||||
|
||||
=item *
|
||||
|
||||
'C<s>' E<ndash> Insert string, reading the link as DBR_STRING or array of
|
||||
DBR_CHAR.
|
||||
|
||||
=back
|
||||
|
||||
The fields INP0 ... INP9 are input links that provide the parameter values to be
|
||||
formatted into the output. The format specifiers in the FMT string determine
|
||||
which type of the data is requested through the appropriate input link. As with
|
||||
C<printf()> a C<*> character may be used in the format to specify width and/or
|
||||
precision instead of numeric literals, in which case additional input links are
|
||||
used to provide the necessary integer parameter or parameters. See L<Address
|
||||
Specification> for information on specifying links.
|
||||
|
||||
The formatted string is written to the VAL field. The maximum number of
|
||||
characters in VAL is given by SIZV, and cannot be larger than 65535. The LEN
|
||||
field contains the length of the formatted string in the VAL field.
|
||||
|
||||
=fields FMT, INP0, INP1, INP2, INP3, INP4, INP5, INP6, INP7, INP8, INP9, VAL, SIZV, LEN
|
||||
|
||||
|
||||
=head3 Output Specification
|
||||
|
||||
The output link specified in the OUT field specifies where the printf record is
|
||||
to write the contents of its VAL field. The link can be a database or channel
|
||||
access link. If the OUT field is a constant, no output will be written.
|
||||
|
||||
See L<Address Specification> for information on specifying links.
|
||||
|
||||
In addition, the appropriate device support module must be entered into the DTYP
|
||||
field.
|
||||
|
||||
=fields OUT, DTYP
|
||||
|
||||
=head3 Operator Display Parameters
|
||||
|
||||
See L<Fields Common to All Record Types> for more on the record name (NAME) and
|
||||
description (DESC) fields.
|
||||
|
||||
=fields NAME, DESC
|
||||
|
||||
=cut
|
||||
|
||||
include "dbCommon.dbd"
|
||||
%#include "devSup.h"
|
||||
%
|
||||
%/* Declare Device Support Entry Table */
|
||||
%typedef struct printfdset {
|
||||
% long number;
|
||||
% DEVSUPFUN report;
|
||||
% DEVSUPFUN init;
|
||||
% DEVSUPFUN init_record;
|
||||
% DEVSUPFUN get_ioint_info;
|
||||
% DEVSUPFUN write_string;
|
||||
%} printfdset;
|
||||
%
|
||||
field(VAL,DBF_NOACCESS) {
|
||||
prompt("Result")
|
||||
asl(ASL0)
|
||||
pp(TRUE)
|
||||
special(SPC_DBADDR)
|
||||
extra("char *val")
|
||||
#=type STRING[SIZV]
|
||||
#=read Yes
|
||||
#=write Yes
|
||||
}
|
||||
field(SIZV,DBF_USHORT) {
|
||||
prompt("Size of VAL buffer")
|
||||
promptgroup("30 - Action")
|
||||
special(SPC_NOMOD)
|
||||
interest(1)
|
||||
initial("41")
|
||||
}
|
||||
field(LEN,DBF_ULONG) {
|
||||
prompt("Length of VAL")
|
||||
special(SPC_NOMOD)
|
||||
}
|
||||
field(OUT,DBF_OUTLINK) {
|
||||
prompt("Output Specification")
|
||||
promptgroup("50 - Output")
|
||||
interest(1)
|
||||
}
|
||||
field(FMT,DBF_STRING) {
|
||||
prompt("Format String")
|
||||
promptgroup("30 - Action")
|
||||
pp(TRUE)
|
||||
size(81)
|
||||
}
|
||||
|
||||
|
||||
=head3 Alarm Parameters
|
||||
|
||||
The printf record has the alarm parameters common to all record types.
|
||||
L<Alarm Fields> lists other fields related to a alarms that are common to all
|
||||
record types.
|
||||
|
||||
The IVLS field specifies a string which is sent to the OUT link if if input
|
||||
link data are invalid.
|
||||
|
||||
=fields IVLS
|
||||
|
||||
=cut
|
||||
|
||||
field(IVLS,DBF_STRING) {
|
||||
prompt("Invalid Link String")
|
||||
promptgroup("30 - Action")
|
||||
size(16)
|
||||
initial("LNK")
|
||||
}
|
||||
field(INP0,DBF_INLINK) {
|
||||
prompt("Input 0")
|
||||
promptgroup("40 - Input")
|
||||
interest(1)
|
||||
}
|
||||
field(INP1,DBF_INLINK) {
|
||||
prompt("Input 1")
|
||||
promptgroup("40 - Input")
|
||||
interest(1)
|
||||
}
|
||||
field(INP2,DBF_INLINK) {
|
||||
prompt("Input 2")
|
||||
promptgroup("40 - Input")
|
||||
interest(1)
|
||||
}
|
||||
field(INP3,DBF_INLINK) {
|
||||
prompt("Input 3")
|
||||
promptgroup("40 - Input")
|
||||
interest(1)
|
||||
}
|
||||
field(INP4,DBF_INLINK) {
|
||||
prompt("Input 4")
|
||||
promptgroup("40 - Input")
|
||||
interest(1)
|
||||
}
|
||||
field(INP5,DBF_INLINK) {
|
||||
prompt("Input 5")
|
||||
promptgroup("40 - Input")
|
||||
interest(1)
|
||||
}
|
||||
field(INP6,DBF_INLINK) {
|
||||
prompt("Input 6")
|
||||
promptgroup("40 - Input")
|
||||
interest(1)
|
||||
}
|
||||
field(INP7,DBF_INLINK) {
|
||||
prompt("Input 7")
|
||||
promptgroup("40 - Input")
|
||||
interest(1)
|
||||
}
|
||||
field(INP8,DBF_INLINK) {
|
||||
prompt("Input 8")
|
||||
promptgroup("40 - Input")
|
||||
interest(1)
|
||||
}
|
||||
field(INP9,DBF_INLINK) {
|
||||
prompt("Input 9")
|
||||
promptgroup("40 - Input")
|
||||
interest(1)
|
||||
}
|
||||
%/* Number of INPx fields defined */
|
||||
%#define PRINTF_NLINKS 10
|
||||
}
|
||||
|
||||
|
||||
=head2 Device Support Interface
|
||||
|
||||
The record requires device support to provide an entry table (dset) which
|
||||
defines the following members:
|
||||
|
||||
typedef struct {
|
||||
long number;
|
||||
long (*report)(int level);
|
||||
long (*init)(int after);
|
||||
long (*init_record)(printfRecord *prec);
|
||||
long (*get_ioint_info)(int cmd, printfRecord *prec, IOSCANPVT *piosl);
|
||||
long (*write_string)(printfRecord *prec);
|
||||
} printfdset;
|
||||
|
||||
The module must set C<number> to at least 5, and provide a pointer to its
|
||||
C<write_string()> routine; the other function pointers may be C<NULL> if their
|
||||
associated functionality is not required for this support layer.
|
||||
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.
|
||||
|
||||
=head2 Device Support for Soft Records
|
||||
|
||||
A soft device support module Soft Channel is provided for writing values to
|
||||
other records or other software components.
|
||||
|
||||
Device support for DTYP C<stdio> is provided for writing values to the stdout,
|
||||
stderr, or errlog streams. C<INST_IO> addressing C<@stdout>, C<@stderr> or
|
||||
C<@errlog> is used on the OUT link field to select the desired stream.
|
||||
|
||||
=cut
|
||||
@@ -48,7 +48,7 @@ The string input record has the standard fields for specifying under what
|
||||
circumstances it will be processed. These fields are listed in L<Scan Fields>.
|
||||
In addition, L<Scanning Specification> explains how these fields are used.
|
||||
|
||||
=head3 Read Parameters
|
||||
=head3 Input Specification
|
||||
|
||||
The INP field determines where the string input record gets its string. It can
|
||||
be a database or channel access link, or a constant. If constant, the VAL field
|
||||
@@ -118,7 +118,6 @@ monitors for VAL. If VAL is not equal to OVAL, then monitors are triggered.
|
||||
|
||||
=fields OVAL
|
||||
|
||||
|
||||
The following fields are used to operate the string input in the simulation
|
||||
mode. See L<Simulation Mode> for more information on simulation mode fields.
|
||||
|
||||
@@ -277,15 +276,48 @@ routines are primarily interested in the following fields:
|
||||
|
||||
=fields PACT, DPVT, UDF, VAL, INP
|
||||
|
||||
=head3 Device Support Routines (devSiSoft.c)
|
||||
=head3 Device Support Routines
|
||||
|
||||
Device support consists of the following routines:
|
||||
|
||||
=head4 report
|
||||
|
||||
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.
|
||||
|
||||
=head4 init
|
||||
|
||||
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.
|
||||
|
||||
=head4 init_record
|
||||
|
||||
long init_record(stringinRecord *prec)
|
||||
long init_record(dbCommon *prec)
|
||||
|
||||
This routine is optional. If provided, it is called by the record support
|
||||
C<init_record()> routine.
|
||||
|
||||
=head4 get_ioint_info
|
||||
|
||||
long get_ioint_info(int cmd, dbCommon *precord, IOSCANPVT *ppvt)
|
||||
|
||||
This routine is called by the ioEventScan system each time the record is added
|
||||
or deleted from an I/O event scan list. C<cmd> has the value (0,1) if the
|
||||
record is being (added to, deleted from) an I/O event list. It must be
|
||||
provided for any device type that can use the ioEvent scanner.
|
||||
|
||||
=head4 read_stringin
|
||||
|
||||
long read_stringin(stringinRecord *prec)
|
||||
@@ -302,17 +334,11 @@ This routine must provide a new input value. It returns the following values:
|
||||
|
||||
=head3 Device Support for Soft Records
|
||||
|
||||
The C<<< Soft Channel >>> module places a value directly in VAL.
|
||||
The C<<< Soft Channel >>> module reads a value directly into VAL.
|
||||
|
||||
If the INP link type is constant, the double constant, if non-zero, is converted
|
||||
to a string and stored into VAL by C<init_record()>, and UDF is set to FALSE. If
|
||||
the INP link type is PV_LINK, then dbCaAddInlink is called by C<init_record()>.
|
||||
|
||||
read_stringin calls recGblGetLinkValue to read the current value of VAL. See
|
||||
L<Soft Input>.
|
||||
|
||||
If the return status of recGblGetLinkValue is zero, then read_stringin sets UDF
|
||||
to FALSE. The status of recGblGetLinkValue is returned.
|
||||
Device support for DTYP C<getenv> is provided for retrieving strings from environment variables.
|
||||
C<INST_IO> addressing C!!@<environment variable> !!is used on the C<INP> link field to select the
|
||||
desired environment variable.
|
||||
|
||||
=cut
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ explains how these fields are used.
|
||||
|
||||
The string output record must specify from where it gets its desired output
|
||||
string. The first field that determines where the desired output originates is
|
||||
the output mode select (OSML) field, which can have two possible value: C<<<
|
||||
the output mode select (OMSL) field, which can have two possible value: C<<<
|
||||
closed_loop >>> or C<<< supervisory >>>. If C<<< supervisory >>> is specified,
|
||||
DOL is ignored, the current value of VAL is written, and the VAL can be changed
|
||||
externally via dbPuts at run-time. If C<<< closed_loop >>> is specified, the VAL
|
||||
@@ -87,7 +87,7 @@ for information on specifying links.
|
||||
menu(menuOmsl)
|
||||
}
|
||||
|
||||
=head3 Write Parameters
|
||||
=head3 Output Specification
|
||||
|
||||
The output link specified in the OUT field specifies where the string output
|
||||
record is to write its string. The link can be a database or channel access
|
||||
@@ -353,7 +353,47 @@ primarily interested in the following fields:
|
||||
|
||||
=fields PACT, DPVT, NSEV, NSTA, VAL, OUT
|
||||
|
||||
=head3 Device Support Routines (devSoSoft.c)
|
||||
=head3 Device Support Routines
|
||||
|
||||
Device support consists of the following routines:
|
||||
|
||||
=head4 report
|
||||
|
||||
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.
|
||||
|
||||
=head4 init
|
||||
|
||||
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.
|
||||
|
||||
=head4 init_record
|
||||
|
||||
long init_record(dbCommon *prec)
|
||||
|
||||
This routine is optional. If provided, it is called by the record support
|
||||
C<init_record()> routine.
|
||||
|
||||
=head4 get_ioint_info
|
||||
|
||||
long get_ioint_info(int cmd, dbCommon *precord, IOSCANPVT *ppvt)
|
||||
|
||||
This routine is called by the ioEventScan system each time the record is added
|
||||
or deleted from an I/O event scan list. C<cmd> has the value (0,1) if the
|
||||
record is being (added to, deleted from) an I/O event list. It must be
|
||||
provided for any device type that can use the ioEvent scanner.
|
||||
|
||||
=head4 write_stringout
|
||||
|
||||
@@ -373,11 +413,9 @@ This routine must output a new value. It returns the following values:
|
||||
|
||||
The C<<< Soft Channel >>> device support module writes the current value of VAL.
|
||||
|
||||
If the OUT link type is PV_LINK, then dbCaAddInlink is called by
|
||||
C<init_record()>.
|
||||
|
||||
write_so calls recGblPutLinkValue to write the current value of VAL. See
|
||||
L<Soft Output>.
|
||||
Device support for DTYP C<stdio> is provided for writing values to the stdout,
|
||||
stderr, or errlog streams. C<INST_IO> addressing C<@stdout>, C<@stderr> or
|
||||
C<@errlog> is used on the OUT link field to select the desired stream.
|
||||
|
||||
=cut
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ L<Address Specification>
|
||||
for information on specifying links.
|
||||
|
||||
In addition, the DTYP field must specify a device support module. Currently, the
|
||||
only device support module is C<<< Soft Channel >>>.
|
||||
only device support module is C<Soft Channel>.
|
||||
|
||||
=fields INP, DTYP
|
||||
|
||||
@@ -59,13 +59,13 @@ These parameters determine the number of array elements (the array length) and
|
||||
the data type of those elements. The Field Type of Value (FTVL) field determines
|
||||
the data type of the array.
|
||||
|
||||
The user specifies the maximum number of elements allowed in the subarray in the
|
||||
MALM field. Generally, the number should be equal to the number of elements of
|
||||
the Waveform array (found in the Waveform's NELM field). The MALM field is used
|
||||
to allocate memory. The subArray's Number of Elements (NELM) field is where the
|
||||
user specifies the actual number of elements that the subArray will contain. It
|
||||
should of course be no greater than MALM; if it is, the record processing
|
||||
routine sets it equal to MALM.
|
||||
The user specifies the maximum number of elements that can be read into the
|
||||
subarray in the MALM field. This number should normally be equal to the number
|
||||
of elements of the Waveform array (found in the Waveform's NELM field). The MALM
|
||||
field is used to allocate memory. The subArray's Number of Elements (NELM) field
|
||||
is where the user specifies the actual number of elements that the subArray will
|
||||
extract. It should of course be no greater than MALM; if it is, the record
|
||||
processing routine sets it equal to MALM.
|
||||
|
||||
The INDX field determines the offset of the subArray record's array in relation
|
||||
to the Waveform's. For instance, if INDX is 2, then the subArray will read NELM
|
||||
@@ -83,15 +83,15 @@ display the value and other parameters of the subarray record either textually
|
||||
or graphically.
|
||||
|
||||
EGU is a string of up to 16 characters describing the engineering units (if any)
|
||||
of the values which the subArray holds. It is retrieved by the C<<< get_units
|
||||
>>> record support routine.
|
||||
of the values which the subArray holds. It is retrieved by the C<get_units()>
|
||||
record support routine.
|
||||
|
||||
The HOPR and LOPR fields set the upper and lower display limits for the
|
||||
sub-array elements. Both the C<<< get_graphic_double >>> and C<<<
|
||||
get_control_double >>> record support routines retrieve these fields.
|
||||
sub-array elements. Both the C<get_graphic_double()> and C<get_control_double()>
|
||||
record support routines retrieve these fields.
|
||||
|
||||
The PREC field determines the floating point precision with which to display
|
||||
VAL. It is used whenever the C<<< get_precision >>> record support routine is
|
||||
VAL. It is used whenever the C<get_precision()> record support routine is
|
||||
called.
|
||||
|
||||
See L<Fields Common to All Record Types>
|
||||
@@ -110,9 +110,9 @@ record types.
|
||||
These fields are not configurable by the user. They are used for the record's
|
||||
internal processing or to represent the current state of the record.
|
||||
|
||||
The NORD field holds a counter of the number of elements read into the array. It
|
||||
can be less than NELM even after the array is full if NELM exceeds the number of
|
||||
existing elements in the referenced array, i.e., the Waveform's array.
|
||||
The NORD field holds the number of elements that were actually read into the
|
||||
array. It will be less than NELM whenever the sum of the NELM and INDX fields
|
||||
exceeds the number of existing elements found in the source array.
|
||||
|
||||
BPTR contains a pointer to the record's array.
|
||||
|
||||
@@ -150,14 +150,14 @@ See L<Record Processing>.
|
||||
|
||||
long (*cvt_dbaddr)(struct dbAddr *paddr)
|
||||
|
||||
This is called by dbNameToAddr. It makes the dbAddr structure refer to the
|
||||
This is called by C<dbNameToAddr()>. It makes the dbAddr structure refer to the
|
||||
actual buffer holding the result.
|
||||
|
||||
=head4 get_array_info
|
||||
|
||||
long (*get_array_info)(struct dbAddr *paddr, long *no_elements, long *offset)
|
||||
|
||||
Retrieves NELM.
|
||||
Retrieves NORD.
|
||||
|
||||
=head4 put_array_info
|
||||
|
||||
@@ -171,14 +171,14 @@ Sets NORD.
|
||||
|
||||
For the elements in the array, this routine routines HOPR and LOPR. For the INDX
|
||||
field, this routine returns MALM - 1 and 0. For NELM, it returns MALM and 1. For
|
||||
other fields, it calls C<<< recGblGetGraphicDouble() >>>.
|
||||
other fields, it calls C<recGblGetGraphicDouble()>.
|
||||
|
||||
=head4 get_control_double
|
||||
|
||||
long (*get_control_double)(struct dbAddr *paddr, struct dbr_ctrlDouble *p)
|
||||
|
||||
For array elements, this routine retrieves HOPR and LOPR. Otherwise, C<<<
|
||||
recGblGetControlDouble() >>> is called.
|
||||
For array elements, this routine retrieves HOPR and LOPR. Otherwise,
|
||||
C<recGblGetControlDouble()> is called.
|
||||
|
||||
=head4 get_units
|
||||
|
||||
@@ -212,13 +212,13 @@ INDX is greater than or equal to MALM it is set to MALM-1.
|
||||
|
||||
=item 3.
|
||||
|
||||
Call device support read routine. This routine is expected to place the desired
|
||||
sub-array at the beginning of the buffer and set NORD to the number of elements
|
||||
of the sub-array that were read.
|
||||
Call the device support's C<read_sa()> routine. This routine is expected to
|
||||
place the desired sub-array at the beginning of the buffer and set NORD to the
|
||||
number of elements of the sub-array that were read.
|
||||
|
||||
=item 4.
|
||||
|
||||
If PACT has been changed to TRUE, the device support read routine has started
|
||||
If PACT has been changed to TRUE, the device support read operation has started
|
||||
but has not completed writing the new value. In this case, the processing
|
||||
routine merely returns, leaving PACT TRUE. Otherwise, process sets PACT TRUE at
|
||||
this time. This asynchronous processing logic is not currently used but has been
|
||||
@@ -305,12 +305,11 @@ sub-array were acquired.
|
||||
|
||||
=head3 Device Support For Soft Records
|
||||
|
||||
Only the device support module C<<< Soft Channel >>> is currently provided. The
|
||||
INP link type must be either DB_LINK or CA_LINK.
|
||||
Only the device support module C<Soft Channel> is currently provided.
|
||||
|
||||
=head4 Soft Channel
|
||||
|
||||
INP is expected to point to a waveform record.
|
||||
INP is expected to point to an array field of a waveform record or similar.
|
||||
|
||||
=cut
|
||||
|
||||
|
||||
@@ -303,7 +303,9 @@ interested in the following fields:
|
||||
|
||||
Device support consists of the following routines:
|
||||
|
||||
=head4 long report(int level)
|
||||
=head4 report
|
||||
|
||||
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.
|
||||
@@ -313,7 +315,9 @@ information at higher levels, or to select different types of information with
|
||||
different levels.
|
||||
Level zero should print no more than a small summary.
|
||||
|
||||
=head4 long init(int after)
|
||||
=head4 init
|
||||
|
||||
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
|
||||
@@ -323,14 +327,14 @@ with C<after> set to 1.
|
||||
|
||||
=head4 init_record
|
||||
|
||||
init_record(precord)
|
||||
long init_record(dbCommon *precord)
|
||||
|
||||
This routine is optional. If provided, it is called by the record support
|
||||
C<init_record()> routine.
|
||||
|
||||
=head4 get_ioint_info
|
||||
|
||||
get_ioint_info(int cmd,struct dbCommon *precord,IOSCANPVT *ppvt)
|
||||
long get_ioint_info(int cmd, dbCommon *precord, IOSCANPVT *ppvt)
|
||||
|
||||
This routine is called by the ioEventScan system each time the record is added
|
||||
or deleted from an I/O event scan list. cmd has the value (0,1) if the
|
||||
@@ -339,7 +343,7 @@ provided for any device type that can use the ioEvent scanner.
|
||||
|
||||
=head4 read_wf
|
||||
|
||||
read_wf(precord)
|
||||
long read_wf(waveformRecord *prec)
|
||||
|
||||
This routine must provide a new input value. It returns the following values:
|
||||
|
||||
@@ -361,38 +365,11 @@ The C<<< Soft Channel >>> device support module is provided to read values from
|
||||
other records and store them in arrays. If INP is a constant link, then read_wf
|
||||
does nothing. In this case, the record can be used to hold arrays written via
|
||||
dbPuts. If INP is a database or channel access link, the new array value is read
|
||||
from the link. NORD is set.
|
||||
from the link. NORD is set to the number of items in the array.
|
||||
|
||||
This module places a value directly in VAL.
|
||||
|
||||
If the INP link type is constant, then NORD is set to zero. If the INP link type
|
||||
is PV_LINK, then dbCaAddInlink is called by C<init_record()>.
|
||||
|
||||
read_wf calls recGblGetLinkValue which performs the following steps:
|
||||
|
||||
=over
|
||||
|
||||
=item *
|
||||
|
||||
If the INP link type is CONSTANT recGblGetLinkValue does nothing.
|
||||
|
||||
=item *
|
||||
|
||||
If the INP link type is DB_LINK, then dbGetLink is called to obtain a new input
|
||||
value. If dbGetLink returns an error, a LINK_ALARM with a severity of
|
||||
INVALID_ALARM is raised.
|
||||
|
||||
=item *
|
||||
|
||||
If the INP link type is CA_LINK, then dbCaGetLink is called to obtain a new
|
||||
input value. If dbCaGetLink returns an error, a LINK_ALARM with a severity of
|
||||
INVALID_ALARM is raised.
|
||||
|
||||
=item *
|
||||
|
||||
NORD is set to the number of values returned and read_wf returns.
|
||||
|
||||
=back
|
||||
If the INP link type is constant, then NORD is set to zero.
|
||||
|
||||
=cut
|
||||
|
||||
|
||||
Reference in New Issue
Block a user