Table of Contents
Previous Chapter Two soft device support modules are provided. One reads values directly into VAL. The other reads values into RVAL, which is then converted just like raw values obtained from hardware device support modules. If soft device support with a constant INP link is chosen, then the VAL field can be modified via dbPuts.
--------------------------------------------------------------
Field Type DCT Initial Access Modify Rec Proc PP
Monitor
--------------------------------------------------------------
VAL DOUBLE No 0 Yes Yes Yes Yes
INP INLINK Yes 0 No No N/A No
PREC SHORT Yes 0 Yes Yes No No
LINR CVTCHOICE Yes 0 Yes Yes No Yes
EGUF FLOAT Yes 0 Yes Yes No Yes
EGUL FLOAT Yes 0 Yes Yes No Yes
EGU STRING Yes null Yes Yes No No
HOPR FLOAT Yes 0 Yes Yes No No
LOPR FLOAT Yes 0 Yes Yes No No
AOFF FLOAT Yes 0 Yes Yes No Yes
ASLO FLOAT Yes 1 Yes Yes No Yes
SMOO FLOAT Yes 0 Yes Yes No No
HIHI FLOAT Yes 0 Yes Yes No Yes
LOLO FLOAT Yes 0 Yes Yes No Yes
HIGH FLOAT Yes 0 Yes Yes No Yes
LOW FLOAT Yes 0 Yes Yes No Yes
HHSV GBLCHOICE Yes 0 Yes Yes No Yes
LLSV GBLCHOICE Yes 0 Yes Yes No Yes
HSV GBLCHOICE Yes 0 Yes Yes No Yes
LSV GBLCHOICE Yes 0 Yes Yes No Yes
HYST DOUBLE Yes 0 Yes Yes No No
ADEL DOUBLE Yes 0 Yes Yes No No
MDEL DOUBLE Yes 0 Yes Yes No No
ROFF LONG No 0 Yes Yes No Yes
ESLO DOUBLE No 1 Yes No No No
LALM DOUBLE No 0 Yes No No No
ALST DOUBLE No 0 Yes No No No
MLST DOUBLE No 0 Yes No No No
PBRK NOACCESS No 4 No No No
INIT SHORT No 0 Yes No No No
LBRK SHORT No 0 Yes No No No
RVAL LONG No 0 Yes Yes Yes Yes
ORAW LONG No 0 Yes No No No
SIOL INLINK Yes 0 No No N/A No
SVAL DOUBLE No 0 Yes Yes No No
SIML INLINK Yes 0 No No N/A No
SIMM GBLCHOICE No 0 Yes Yes No No
SIMS GBLCHOICE Yes 0 Yes Yes No No
--------------------------------------------------------------
-----------------------------------------------------------------------------------------
Name Summary Description
-----------------------------------------------------------------------------------------
VAL Value Field Unless INP is a constant link and the device support
module specifies no conversion, this is the value resulting
from the record being processed. If INP is a constant, then
VAL is initialized to the INP value but can be changed
dynamically via dbPutField or dbPutLink.
INP Input Link This field is used by the device support routines to obtain
input. For soft analog records it can be a constant, a
database link, or a channel access link.
PREC Display Precision Precision with which to display VAL and OVAL. This field
is used by record support to supply a value when
get_precision is called.
LINR Conversion Type No conversion, linear and breakpoint table conversion are
supported.
EGUF Engineering Units These fields are used to perform linear conversions. It is
Full the responsibility of the device support routines to use
EGUF and EGUL to compute ESLO and ROFF. EGUF and
EGUL must be set by the user to the engineering units
corresponding to the high and low ADC limits. For
example if the ADC has a range of -10 to +10 Volts, then
EGUF must be the engineering units value corresponding
to 10 volts and EGUL to -10 volts. If a linear conversion is
specified, recAi uses ESLO, ROFF, and EGUL to convert
the raw value to engineering units according to the
formula:
VAL = (RVAL + ROFF)*ESLO + EGUL
EGUL Engineering Units
Low
ROFF Raw Value Offset
ESLO Slope for Linear
Conversions
EGU Engineering Units An ASCII string of up to 16 characters describing the
engineering units. This field is used by record support to
supply a units description string when get_units is
called.
HOPR High Operating These fields determine the upper and lower display limits
Range for graphics displays and the upper and lower control
limits for control displays. The fields are used by record
support to honor calls to get_graphic_double or
get_control_double.
LOPR Low Operating
Range
AOFF Adjustment Offset These fields are adjustment parameters for the raw input
values. They are applied to the raw data value returned by
the device support routine before any other conversions
are performed.
ASLO Adjustment Slope
SMOO Smoothing Factor The converted data value is subjected to the following
algorithm:
val = newvalue * (1 - smoo) + oldvalue * smoo
SMOO should have a value between 0 and 1, with 0
meaning no smoothing and 1 meaning ultimate smoothing
(in fact, the data value will never change).
HIHI Hihi Alarm Limit These fields specify the alarm limits and severities.
HIGH High Alarm Limit
LOW Low Alarm Limit
LOLO Lolo Alarm Limit
HHSV Hihi Alarm Severity
HSV High Alarm Severity
LSV Low Alarm Severity
LLSV Lolo Alarm Severity
HYST Alarm Deadband These parameters specify hysteresis factors for triggering
monitors by a call to db_post_event or monitor
callbacks, i.e. callbacks specified by calls to
caAddEvent or dbAddEvent. A monitor will not be
triggered until VAL changes by more than the specified
amount.
ADEL Archive Deadband
MDEL Monitor, i.e. value
change, Deadband
LALM Last Alarm Monitor These fields are used to implement the hysteresis factors
Trigger Value for monitor callbacks.
ALST Last Archiver
Monitor Trigger
Value
MLST Last Value Change
Monitor Trigger
Value
INIT Initialize This field is used by record support to perform
initialization for LBRK and for smoothing.
LBRK Last Breakpoint Index of last breakpoint interval. LBRK is used to perform
conversions via breakpoint tables.
PBRK Address of PBRK is used to perform conversions via breakpoint
Breakpoint Table tables.
RVAL Raw Value RVAL is the raw data value obtained by the device support
routine. Unless the device support routine returns value
requests that no conversion should be performed, the
record support routine converts this value to engineering
units.
ORAW Old Raw Value ORAW is used to decide if monitors should be triggered for
RVAL at the same time monitors are triggered for changes
in VAL.
SIMM Simulation Mode Simulation mode process variables. Refer to Chapter 3
Section "Simulation Mode" on page 11 for more
information.
SIML Simulation Mode
Location
SVAL Simulation Value
SIOL Simulation Value
Location
SIMS Simulation Mode
Alarm Severity
-----------------------------------------------------------------------------------------
This routine next checks to see that device support is available and a device support read_ai routine is defined. If either does not exist, an error message is issued and processing is terminated.
INIT is then set to TRUE.
If device support includes init_record, it is called.
If the device support routine special_linconv exists, it is called.
INIT is set TRUE. This causes PBRK, LBRK, and smoothing to be reinitialized.
upper_alarm_limit = HIHI upper_warning_limit = HIGH lower_warning_limit = LOW lower_alarm_limit = LOLO
val = val* ASLO + AOFF
If the conversion algorithm is linear, the raw value is converted via the equation:
val = val * ESLO + EGUL
If the conversion is via a breakpoint table, the new value is obtained.
if SMOO equal to 0. or INIT is True, VAL = val
else VAL = val * (1 - SMOO) + Previous_value * SMOO
Since VAL is now defined, the last step is to set UDF to FALSE.
---------------------------------------------------------------------------------------------
Name Summary Description
---------------------------------------------------------------------------------------------
PACT Processing Active See Chapter 2 Section "Database Common: Field
Descriptions" on page 4 for descriptions.
DPVT Device Private
UDF VAL Undefined
NSEV New Alarm Severity
NSTA New Alarm Status
VAL Value This field is used by device support only if it obtains a
value already converted to engineering units. See RVAL
below.
INP Input Link This field is used by the device support routines to locate
its input.
EGUF Engineering Units Full These fields are used to calculate ESLO. Note that these
fields correspond to the high and low hardware limits.
EGUL Engineering Unit Low
ESLO Slope These fields are used for linear conversions from raw to
engineering units. The device support routines must
calculate these fields unless they obtain values already in
engineering units.
ROFF Raw Offset
RVAL Raw Value It is the responsibility of the device support routine to give
this field a value. If the device support routine obtains a
value already in engineering units, it should place the
value in VAL and return a value of 2.
---------------------------------------------------------------------------------------------
report (FILE fp, paddr)Not currently used.
init()This routine is called once during IOC initialization.
init_record (precord)This routine is optional. If provided, it is called by the record support init_record routine.
get_ioint_info (int cmd,struct 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.
read_ai(precord)This routine must provide a new input value. Asynchronous device support routines will return with PACT set to TRUE. If PACT is TRUE, the process routine will just return and not continue processing. When the asynchronous routine completes, it can call process which will again call read_ai. Because PACT is still TRUE read_ai knows that this is a request to retrieve the data obtained by the previous call. When finished, read_ai should set PACT to FALSE and return one the following values:
special_linconv(precord,after)This routine is called whenever any of the fields LINR, EGUF, EGUL or ROFF is modified.
If the INP link type is constant, then the constant value is stored into VAL by init_record, and UDF is set to FALSE. If the INP link type is PV_LINK, then dbCaAddInlink is called by init_record.
read_ai calls recGblGetLinkValue to read the current value of VAL. See Chapter 3 Section "Soft Input" on page 10 for details.
If the return status of recGblGetLinkValue is zero, then read_ai sets UDF to FALSE. The status of recGblGetLinkValue is returned.
If soft support is chosen, the following fields become meaningless: LINR, EGUF, EGUL, ESLO, ROFF, AOFF, ASLO, and SMOO. The read_ai routine always returns a value of 2 which means don't convert.
If raw soft support is chosen, the fields EGUF and EGUL become meaningless. ESLO and ROFF always have their default values of 1 and 0.