Difference between revisions of "RRM 3-14 Common"

From EPICSWIKI
 
(Fixed IVOA selections.)
 
(One intermediate revision by one other user not shown)
Line 49: Line 49:


==== Simulation Mode ====
==== Simulation Mode ====
An input record can be switched into simulation mode of operation by setting the value of SIMM to YES or RAW. 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 will be read from SIOL instead of INP:
            -- (SIMM = NO?) INP (if supported and directed by device support, -> RVAL -- convert -> VAL), (else -> VAL)
          /
SIML -> SIMM
          \
          -- (SIMM = YES?) SIOL -> SVAL -> VAL
            \
              -- (SIMM = RAW?) SIOL -> SVAL -> RVAL -- convert -> VAL


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 when the record is processed.
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 when the record is processed.
Line 59: Line 68:
* If SIMM is NO, then call the device support read routine, set status to its return code, and return.
* 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 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.
* If SIMM is RAW, then call recGblGetLinkValue to read the input value from SIOL into SVAL. If success, then set RVAL to SVAL and UDF to FALSE and set status to 0 (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, NO or RAW, a SOFT alarm with a severity of INVALID is raised, and return status is set to -1.


=== Output Records ===
=== Output Records ===
Line 81: Line 91:
<TD>SIOL<TD>Simulation Value Location<TD>This field can be a constant, a database link, or a channel 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.<TR>
<TD>SIOL<TD>Simulation Value Location<TD>This field can be a constant, a database link, or a channel 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.<TR>
<TD>SIMS<TD>Simulation Mode Alarm Severity<TD>When this record is in simulation mode, it will be put into alarm with this severity and a status of SIMM_ALARM.<TR>
<TD>SIMS<TD>Simulation Mode Alarm Severity<TD>When this record is in simulation mode, it will be put into alarm with this severity and a status of SIMM_ALARM.<TR>
<TD>IVOA<TD>Invalid Alarm Output Action<TD>Whenever the record is put into INVALID alarm severity IVOA specifies an action. IVOA can be one of the following actions: Continue normally, Don't drive outputs, Set output equal to IVOV<TR>
<TD>IVOA<TD>Invalid Alarm Output Action<TD>Whenever the record is put into INVALID alarm severity IVOA specifies an action. IVOA can be one of the following actions: "Continue normally", "Don't drive outputs", or "Set output to IVOV"<TR>
<TD>IVOV<TD>Invalid Alarm Output Value, In Engineering Units<TD>When new severity has been set to INVALID alarm and IVOA is "Set output equal to IVOV",  then, VAL is set to IVOV and converted to RVAL before device support is called.
<TD>IVOV<TD>Invalid Alarm Output Value, In Engineering Units<TD>When new severity has been set to INVALID alarm and IVOA is "Set output to IVOV",  then, VAL is set to IVOV and converted to RVAL before device support is called.
</TABLE>
</TABLE>


Line 104: Line 114:


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. However, the output values are never converted.
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. However, the output values are never converted.
            -- (SIMM = FALSE?) INP -> RVAL --(maybe convert) -> VAL
          /
SIML -> SIMM
          \
            -- (SIMM = TRUE?) SIOL -> SVAL --(never convert) -> RVAL
Also, while the record is in simulation mode, there will be no calls to device support during record processing.
Also, while the record is in simulation mode, there will be no calls to device support during record processing.


Line 128: Line 131:
* If new severity is less than INVALID, then call writeValue:
* If new severity is less than INVALID, then call writeValue:
* Else do the following:
* Else do the following:
** If IVOA is CONTINUE, then call writeValue.
** If IVOA is "Continue normally" then call writeValue.
** If IVOA is NO_OUTPUT, then do not write output.
** If IVOA is "Don't drive outputs" 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 is "Set output to 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.
** If IVOA not one of the above, an error message is generated.
----
EPICS Record Reference Manual - 19 MAY 1998

Latest revision as of 23:57, 4 March 2015

EPICS Record Reference Manual


Fields Common to Many Record Types

Introduction

This chapter describes input and output fields that are common to multiple record types. These fields have the same meaning whenever they are used.

Input Records

Common Fields

NameSummaryDescription
INPInput LinkThis 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.
DTYPDevice TypeDTYP specifies the name of the device support module that will input values. Each record type has its own set of device support routines. If a record type does not have any associated device support, DTYP is meaningless.
RVALRaw ValueWhenever possible this field contains the raw data value exactly as it is obtained from the hardware or from the associated device driver and before it undergoes any conversions. The Soft Channel device support module reads values directly into VAL, bypassing this field.
VALValueThis is the record's final value, after any needed conversions have been performed.
SIMMSimulation ModeThis 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.
SIMLSimulation Mode LocationThis field can be a constant, a database link, or a channel 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.
SVALSimulation ValueThis 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.
SIOLSimulation Value LocationThis field can be a constant, a database link, or a channel 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.
SIMSSimulation Mode Alarm SeverityWhen this record is in simulation mode, it will be put into 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.

Soft Input

In almost all cases, two special device support modules are provided: Soft Channel and Raw Soft Channel. Both allow INP to be a constant, a database link, or a channel access link. The Soft Channel device support module reads input directly into the VAL field and specifies that no conversion of any type should be performed. Thus, it 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 Channel support module reads input into RVAL and asks that any specified conversions 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 returned by 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.

Simulation Mode

An input record can be switched into simulation mode of operation by setting the value of SIMM to YES or RAW. 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 will be read from SIOL instead of INP:

           -- (SIMM = NO?) INP (if supported and directed by device support, -> RVAL -- convert -> VAL), (else -> VAL)
         /

SIML -> SIMM

         \
          -- (SIMM = YES?) SIOL -> SVAL -> VAL
           \
             -- (SIMM = RAW?) SIOL -> SVAL -> RVAL -- convert -> VAL

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 when the record is processed.

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 RAW, then call recGblGetLinkValue to read the input value from SIOL into SVAL. If success, then set RVAL to SVAL and UDF to FALSE and set status to 0 (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, NO or RAW, a SOFT alarm with a severity of INVALID is raised, and return status is set to -1.

Output Records

Common Fields

NameSummaryDescription
OUTOutput LinkThis 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.
DTYPDevice TypeDTYP specifies the name of the device support module that will receive values. Each record type has its own set of device support routines. If a record type does not have any associated device support, DTYP is meaningless.
VALValueThis is the desired value before any conversions to raw output have been performed.
OVALOutput ValueOVAL 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.
RVALRaw ValueWhenever possible this is the actual value sent to the hardware itself or to the associated device driver.
RBVRead Back ValueWhenever possible this is the actual read back value obtained from the hardware itself or from the associated device driver.
DOLDesired Output Location (an Input Link)DOL can be a constant, a database link, or a channel access link. There is no device support associated with DOL. If DOL is a database or channel access link and OMSL is closed_loop, then VAL is obtained from DOL.
OMSLOutput Mode SelectThis 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.
OIFOutput Full or Incremental (analog output record only)This field, which is only used when input is obtained from DOL, determines if the value obtained from DOL is an increment to add to the current VAL or is the actual VAL desired.
SIMMSimulation ModeThis 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.
SIMLSimulation Mode LocationThis field can be a constant, a database link, or a channel 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.
SIOLSimulation Value LocationThis field can be a constant, a database link, or a channel 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.
SIMSSimulation Mode Alarm SeverityWhen this record is in simulation mode, it will be put into alarm with this severity and a status of SIMM_ALARM.
IVOAInvalid Alarm Output ActionWhenever the record is put into INVALID alarm severity IVOA specifies an action. IVOA can be one of the following actions: "Continue normally", "Don't drive outputs", or "Set output to IVOV"
IVOVInvalid Alarm Output Value, In Engineering UnitsWhen new severity has been set to INVALID alarm and IVOA is "Set output to IVOV", then, VAL is set to IVOV and converted to RVAL before device support is called.

Soft Output

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 Channel 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.

Simulation Mode

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. However, the output values are never converted. 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.

Invalid Alarm Output Action

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 normally" then call writeValue.
    • If IVOA is "Don't drive outputs" then do not write output.
    • If IVOA is "Set output to 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.