RRM 3-14 Sequence

From EPICSWIKI
Revision as of 18:44, 18 April 2008 by KazimierzGofron (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

EPICS Record Reference Manual


seq - Sequence

The Sequence record is used to trigger the processing of up to ten other records and send values to those records. It is similar to the fanout record, except that it will fetch an input value and write an output value instead of simply processing a collection of forward links. It can also specify one of several selection algorithms that determine which values to write. It has no associated device support.

Parameter Fields

The fields fall into the following categories:

  • scan parameters
  • desired output parameters
  • output parameters
  • selection algorithm parameters
  • delay parameters
  • operator display parameters
  • run-time parameters

Scan Parameters

The sequence record has the standard fields for specifying under what circumstances it will be processed. These fields are listed in Scan Fields. In addition, Scanning Specification explains how these fields are used.

Desired Output Parameters

These fields determine where the record retrieves the values it is to write to other records. All of these values are not necessarily used, depending on the selection algorithm.

The sequence record can retrieve up to 10 values from 10 locations. The user specifies the locations in the Desired Output Link fields (DOL1-DOLA), which can be either constants, database links, or channel access links. If a Desired Output Link is a constant, the corresponding value field for that link is initialized to the constant value and cannot be changed via dbputs. Otherwise, if the Desired Output Link is a database or channel access link, a value is fetched from the link each time the record is processed (provided that the output link is part of the record's selection algorithm). See Address Specification for information on how to specify database links.

The value fetched from the Desired Output Links are stored in the corresponding Desired Output Value fields (DO1-DOA). These fields can be initialized to a constant value, but they cannot be changed via dbPuts.


FieldSummaryTypeDCTInitialAccessModifyRec Proc MonitorPP
DOL1Desired Output Link 1INLINKYes0NoNoN/ANo
DOL2Desired Output Link 2INLINKYes0NoNoN/ANo
DOL3Desired Output Link 3INLINKYes0NoNoN/ANo
DOL4Desired Output Link 4INLINKYes0NoNoN/ANo
DOL5Desired Output Link 5INLINKYes0NoNoN/ANo
DOL6Desired Output Link 6INLINKYes0NoNoN/ANo
DOL7Desired Output Link 71INLINKYes0NoNoN/ANo
DOL8Desired Output Link 8INLINKYes0NoNoN/ANo
DOL9Desired Output Link 9INLINKYes0NoNoN/ANo
DOLADesired Output Link 10INLINKYes0NoNoN/ANo
DO1Desired Output Value, Link 1DOUBLENo0YesYesNoNo
DO2Desired Output Value, Link 2DOUBLENo0YesYesNoNo
DO3Desired Output Value, Link 3DOUBLENo0YesYesNoNo
DO4Desired Output Value, Link 4DOUBLENo0YesYesNoNo
DO5Desired Output Value, Link 5DOUBLENo0YesYesNoNo
DO6Desired Output Value, Link 6DOUBLENo0YesYesNoNo
DO7Desired Output Value, Link 7DOUBLENo0YesYesNoNo
DO8Desired Output Value, Link 8DOUBLENo0YesYesNoNo
DO9Desired Output Value, Link 9DOUBLENo0YesYesNoNo
DOADesired Output Value, Link 10 DOUBLENo0YesYesNoNo


Output Parameters

When the record is processed, the desired output values are retrieved for the links in the record's selection algorithm and are written to the corresponding output link (LNK1-LNKA). These output links can be database links or channel access links; they cannot be device addresses. There are ten output links, one for each desired output link. Only those that are defined are used.


FieldSummaryTypeDCTInitialAccessModifyRec Proc MonitorPP
LNK1Output link 1OUTLINKYes0NoNoN/ANo
LNK2Output link 2OUTLINKYes0NoNoN/ANo
LNK3Output link 3OUTLINKYes0NoNoN/ANo
LNK4Output link 4OUTLINKYes0NoNoN/ANo
LNK5Output link 5OUTLINKYes0NoNoN/ANo
LNK6Output link 6OUTLINKYes0NoNoN/ANo
LNK7Output link 7OUTLINKYes0NoNoN/ANo
LNK8Output link 8OUTLINKYes0NoNoN/ANo
LNK9Output link 9OUTLINKYes0NoNoN/ANo
LNKAOutput link 1OUTLINKYes0NoNoN/ANo


Selection Algorithm Parameters

When the sequence record is processed, it uses a selection algorithm similar to that of the selection record to decide which links to process.The select mechanism field (SELM) has four algorithms to choose from: All, Specified or Mask.

The All algorithm causes the record to process each input and output link each time the record is processed, in order from 1 to 10. So when SELM is All, the desired output value from DOL1 will fetched and sent to LNK1, then the desired output value from DOL2 will be fetched and sent to the location in LNK2, and so on until the last input and output link DOA and LNKA. (Note that undefined links are not used.) If DOLx is a constant, the current value field is simply used and the desired output link is ignored. The SELN field is not used when All is the algorithm.

When the Specified algorithm is chosen, each time the record is processed it gets the integer value in the Link Selection (SELN) field and uses that as the index of the link to process. For instance, if SELN is 4, the desired output value from DO4 will be retrieved and sent to LNK4. If DOLx is a constant, DOx is simply used without the value being fetched from the input link.

When Mask is chosen, the record uses the individual bits of the SELN field to determine the links to process. When bit 0 of SELN is set, the value from DO1 will be written to the location in LNK1; when bit 1 is set, the valud from DO2 will be written to the location in LNK2 etc. Thus for example if SELN is 3, the record will retrieve the values from DO1 and DO2 and write them to the locations in LNK1 and LNK2, respectively. If SELN is 63, DO1...DO6 will be written to LNK1...LNK6.


FieldSummaryTypeDCTInitialAccessModifyRec Proc MonitorPP
SELMSelect MechanismRECCHOICEYes0YesYesNoNo
SELN Link Selection USHORTNo1YesYesNoNo
SELLLink Selection Location INLINKYes0NoNoN/ANo


Delay Parameters

The delay parameters consist of 10 fields, one for each I/O link discussed above. These fields can be configured to cause the record to delay processing the link. For instance, if the user gives the DLY1 field a value of 3.0, each time the record is processed at run-time, the record will delay processing the DOL1, DOV1, and LNK1 fields for three seconds. That is, the desired output value will not be fetched and written to the output link until three seconds have lapsed.


FieldSummaryTypeDCTInitialAccessModifyRec Proc MonitorPP
DLY1Delay timeDOUBLEYes0YesYesNoNo
DLY2Delay timeDOUBLEYes0YesYesNoNo
DLY3Delay timeDOUBLEYes0YesYesNoNo
DLY4Delay timeDOUBLEYes0YesYesNoNo
DLY5Delay timeDOUBLEYes0YesYesNoNo
DLY6Delay timeDOUBLEYes0YesYesNoNo
DLY7Delay timeDOUBLEYes0YesYesNoNo
DLY8Delay timeDOUBLEYes0YesYesNoNo
DLY9Delay timeDOUBLEYes0YesYesNoNo
DLYADelay timeDOUBLEYes0YesYesNoNo


Operator Display Parameters

These parameters are used to present meaningful data to the operator. The Precision field (PREC) determines the decimal precision for the VAL field when it is displayed. It is used when the get_precision record routine is called.

See Fields Common to All Record Types for more on the record name (NAME) and description (DESC) fields.


FieldSummaryTypeDCTInitialAccessModifyRec Proc MonitorPP
PREC Display Precision SHORTYes0YesYesNoNo
NAMERecord NameSTRING [29]Yes0YesNoNoNo
DESCDescriptionSTRING [29]YesNullYesYesNoNo


Alarm Parameters

The sequence record has the alarm parameters common to all record types. Alarm Fields lists other fields related to a alarms that are common to all record types.


Record Support

Record Processing

Routine process implements the following algorithm:

  1. First, PACT is set to TRUE, and the link selection is fetched. Depending on the selection mechanism, the link selection output links are processed in order from LNK1 to LNKA. When LNKn is processed, the corresponding DLYn value is used to generate a delay via watchdog timer.
  2. After DLYn seconds have expired, the input value is fetched from DOn (if DOLn is constant) or DOLn (if DOLn is a database link or channel access link) and written to LNKn.
  3. When all links are completed, an asynchronous completion call back to dbProcess is made (see the Application Developer's Guide for more information on asynchronous processing.)
  4. Then UDF is set to FALSE.
  5. Monitors are checked.
  6. The forward link is scanned, PACT is set FALSE, and the process routine returns.

For the delay mechanism to operate properly, the record is processed asynchronously. The only time the record will not be processed asynchronously is when there are no non-NULL output links selected (i.e. when it has nothing to do.) The processing of the links is done via callback tasks at the priority set in the PRIO field in dbCommon (see the Application Developer's Guide for more information on call




EPICS Record Reference Manual - 19 MAY 1998