Table of Contents Previous Chapter Chapter 3: Fields Common to Many Record Types
This chapter describes input and output fields that are common to multiple record types. These fields have the same meaning whenever they are used.
Common Fields
--------------------------------------------------------------------------------------
Name Summary Description
--------------------------------------------------------------------------------------
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.
DTYP Device Type DTYP specifies the name of the device support module
that will input values. Each record type has its own set of
device support routines which are specified in
devSup.ascii. If a record type does not have any
associated device support, DTYP is meaningless.
RVAL Raw Value Whenever possible this field contains the raw data value
exactly as it is obtained from the hardware or from the
associated device driver.
VAL Value This is the record's final value, after any needed
conversions have been performed.
SIMM Simulation Mode This field has either the value YES or NO. By setting this
field to YES, the record can be switched into simulation
mode of operation. While in simulation mode, input will
be obtained from SIOL instead of INP.
SIML Simulation Mode This field can be a constant, a database link, or a channel
Location access link. If SIML is a database or channel access link,
then SIMM is read from SIML. If SIML is a constant link
then SIMM is initialized with the constant value but can be
changed via dbPuts.
SVAL Simulation Value This is the record's input value, in engineering units,
when the record is switched into simulation mode, i.e.
when SIMM is set to YES.
SIOL Simulation Value This field can be a constant, a database link, or a channel
Location access link. If SIOL is a database or channel access link,
then SVAL is read from SIOL. If SIOL is a constant link
then SVAL is initialized with the constant value but can be
changed via dbPuts.
SIMS Simulation Mode When this record is in simulation mode, it will be put into
Alarm Severity alarm with this severity and a status of SIMM.
--------------------------------------------------------------------------------------
Device Input
A device input routine normally returns one of the following values to its associated record support routine:
- 0: Success and convert. The input value is in RVAL. The record support module is expected to compute VAL from RVAL.
- 2: Success, but don't convert. The device support module can specify this value if it does not want any conversions. It might do this for two reasons:
- A hardware error is detected (in this case, it should also raise an alarm condition).
- The device support routine reads values directly into the VAL field and then sets UDF to FALSE.
In almost all cases, two special device support modules are provided: Soft and Raw Soft. Both allow INP to be a constant, a database link, or a channel access link. The Soft support module reads input directly into the VAL field and specifies that no conversion of any type should be performed. Thus Soft support allows the record to hold values corresponding to the C data type of the VAL field. Note that for soft input, RVAL is not used. The Raw Soft support module reads input into RVAL and asks that normal conversion to VAL be performed.
The device support read routine normally calls recGblGetLinkValue which performs the following steps:
- If the INP link type is CONSTANT recGblGetLinkValue does nothing and returns with a status of zero.
- 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. RecGblGetLinkValue returns the status of dbGetLink.
- 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 is raised. RecGblGetLinkValue returns the status of dbCaGetLink.
If the return status of recGblGetLinkValue is zero and the INP link type is not CONSTANT, then UDF is set to FALSE. The device support read routine normally returns the status of recGblGetLinkValue.
A record can be switched into simulation mode of operation by setting the value of SIMM to YES. During simulation, the record will be put into alarm with a severity of SIMS and a status of SIMM_ALARM. While in simulation mode, input values, in engineering units, will be obtained from SIOL instead of INP. Also, while the record is in simulation mode, there will be no raw value conversion and no calls to device support during record processing.
Normally input records contain a private readValue routine which performs the following steps:
- If PACT is TRUE, the device support read routine is called, status is set to its return code, and readValue returns.
- Call recGblGetLinkValue to get a new value for SIMM if SIML is a DB_LINK or a CA_LINK.
- Check value of SIMM.
- If SIMM is NO, then call the device support read routine, set status to its return code, and return.
- If SIMM is YES, then call recGblGetLinkValue to read the input value from SIOL into SVAL. If success, then set VAL to SVAL and UDF to FALSE and set status to 2 (don't convert) if input record supports conversion. If SIMS is greater than zero, set alarm status to SIMM and severity to SIMS. Set status to the return code from recGblGetLinkValue and return.
- IF SIMM is not YES or NO, a SOFT alarm with a severity of INVALID is raised, and return status is set to -1.
Common Fields
---------------------------------------------------------------------------------------
Name Summary Description
---------------------------------------------------------------------------------------
OUT Output Link This field is used by the device support routines to decide
where to send output. For soft records, it can be a
constant, a database link, or a channel access link. If the
link is a constant, the result is no output.
DTYP Device Type DTYP specifies the device support module that will
receive values.
VAL Value This is the desired value before any conversions to raw
output have been performed.
OVAL Output Value OVAL is used to decide when to invoke monitors. Archive
and value change monitors are invoked if OVAL is not
equal to VAL. If a record type needs to make
adjustments, OVAL is used to enforce the maximum rate
of change limit before converting the desired value to a
raw value.
RVAL Raw Value Whenever possible this is the actual value sent to the
hardware itself or to the associated device driver.
RBV Read Back Value Whenever possible this is the actual read back value
obtained from the hardware itself or from the associated
device driver.
DOL Desired Output DOL can be a constant, a database link, or a channel access
Location (an Input link. There is no device support associated with DOL. If
Link) DOL is a database or channel access link and OMSL is
CLOSED_LOOP, then VAL is obtained from DOL.
OMSL Output Mode Select This field has either the value SUPERVISORY or
CLOSED_LOOP. DOL is used to determine VAL only if
OMSL has the value CLOSED_LOOP. By setting this field
the record can be switched between supervisory and
closed loop mode of operation. While in closed loop
mode, the VAL field cannot be set via dbPuts.
OIF Output Full or This field, which is only used when input is obtained from
Incremental (ao DOL, determines if the value obtained from DOL is an
record only) increment to add to the current VAL or is the actual VAL
desired.
SIMM Simulation Mode This field has either the value YES or NO. By setting this
field to YES, the record can be switched into simulation
mode of operation. While in simulation mode, output will
be written to SIOL instead of OUT.
SIML Simulation Mode This field can be a constant, a database link, or a channel
Location access link. If SIML is a database or channel access link,
then SIMM is read from SIML. If SIML is a constant link
then SIMM is initialized with the constant value but can be
changed via dbPuts.
SIOL Simulation Value This field can be a constant, a database link, or a channel
Location access link. If SIOL is a database or channel access link,
then the output value is written to SIOL. If this link is a
constant, the result is no output.
SIMS Simulation Mode When this record is in simulation mode, it will be put into
Alarm Severity alarm with this severity and a status of SIMM_ALARM.
IVOA Invalid Alarm Whenever the record is put into INVALID alarm severity
Output Action IVOA specifies an action. IVOA can be one of the
following actions.
Continue normally
Don't drive outputs
Set output equal to IVOV
IVOV Invalid Alarm When new severity has been set to INVALID alarm and
Output Value, In IVOA is "Set output equal to IVOV", then, VAL is set to
Engineering Units IVOV and converted to RVAL before device support is
called.
---------------------------------------------------------------------------------------
Normally two soft output device support modules are provided Soft and Raw Soft. Both allow the output link OUT to be a constant, a database link, or a channel access link. It is normally meaningless to use constant output links. The Soft support module writes output from the value associated with OVAL or VAL (if OVAL does not exist). The Raw Soft support module writes the value associated with the RVAL field after conversion has been performed.
The device support write routine normally calls recGblPutLinkValue which performs the following steps:
- If the OUT link type is CONSTANT recGblPutLinkValue does nothing and returns with a status of zero.
- If the OUT link type is DB_LINK, then dbPutLink is called to write the current value. If dbPutLink returns an error, a LINK_ALARM with a severity of INVALID_ALARM is raised. RecGblPutLinkValue returns the status of dbPutLink.
- If the OUT link type is CA_LINK, then dbCaPutLink is called to write the current value. If dbCaPutLink returns an error, a LINK_ALARM with a severity of INVALID_ALARM is raised. RecGblPutLinkValue returns the status of dbCaPutLink.
The device support write routine normally returns the status of recGblPutLinkValue.
Output Mode Select
The fields DOL and OMSL are used to allow the output record to be part of a closed loop control algorithm. OMSL is meaningful only if DOL refers to a database or channel access link. It can have the values SUPERVISORY or CLOSED_LOOP. If the mode is SUPERVISORY, then nothing is done to VAL. If the mode is CLOSED_LOOP and the record type does not contain an OIF field, then each time the record is processed, VAL is set equal to the value obtained from the location referenced by DOL. If the mode is CLOSED_LOOP in record types with an OIF field and OIF is Full, VAL is set equal to the value obtained from the location referenced by DOL; if OIF is Incremental VAL is incremented by the value obtained from DOL.
An output record can be switched into simulation mode of operation by setting the value of SIMM to YES. During simulation, the record will be put into alarm with a severity of SIMS and a status of SIMM_ALARM. While in simulation mode, output values, in engineering units, will be written to SIOL instead of OUT. Also, while the record is in simulation mode, there will be no calls to device support during record processing.
Normally output records contain a private writeValue routine which performs the following steps:
- If PACT is TRUE, the device support write routine is called, status is set to its return code, and readValue returns.
- Call recGblGetLinkValue to get a new value for SIMM if SIML is a DB_LINK or a CA_LINK.
- Check value of SIMM.
- If SIMM is NO, then call the device support write routine, set status to its return code, and return.
- If SIMM is YES, then call recGblPutLinkValue to write the output value from VAL or OVAL to SIOL. Set alarm status to SIMM and severity to SIMS, if SIMS is greater than zero. Set status to the return code from recGblPutLinkValue and return.
- If SIMM not one of the above, a SOFT alarm with a severity of INVALID is raised, and return status is set to -1.
Whenever an output record is put into INVALID alarm severity, IVOA specifies an action to take. The record support process routine for each output record contains code which performs the following steps.
- If new severity is less than INVALID, then call writeValue:
- Else do the following:
- If IVOA is CONTINUE, then call writeValue.
- If IVOA is NO_OUTPUT, then do not write output.
- If IVOA is OUTPUT_IVOV, then set VAL to IVOV, call convert if necessary, and then call writeValue.
- If IVOA not one of the above, an error message is generated.
Table of Contents Next Chapter