The sseq (string sequence) record

Contents:

  1. Introduction
  2. Scan Parameters
  3. Desired Output Parameters
  4. Output/Wait Parameters
  5. Selection Algorithm Parameters
  6. Delay Parameters
  7. Operator Display Parameters
  8. Alarm Parameters
  9. Record Support Routines

1. Introduction


The sseq (String Sequence) record is derived from the seq (Sequence) record, and has all of its capabilities. In addition, it can link from either string or numeric fields to either string or numeric fields, and it can wait for processing that any of its output links triggers to complete. The record can execute a sequence of up to ten sets of delay/get-value/put-value/wait-for-completion operations. All steps and sequences are optional; with default field values, the record does nothing at all. The sseq record also implements several selection algorithms that allow a dtabase programmer or runtime user to specify which sets of delay/get/put/wait to execute. The record has no associated device support.

2. Scan Parameters


Like all other EPICS records, the sequence record has the standard set of fields (SCAN, PINI, FLNK, etc) for specifying under what circumstances it will be processed, and what record, if any, should process immediately afterward. See the EPICS Record Reference Manual for more information.

3. Desired Output Parameters


These fields hold the values the record is to write to other records, or determine from where those values are to be read.

The sequence record can fetch 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 or links to other EPICS PVs. If a Desired Output Link is a constant, the corresponding value field for that link is initialized to the constant value. Otherwise, if the Desired Output Link is a link, a value is fetched from the link each time the record is processed. See the EPICS Record Reference Manual for information on how to specify database links.

The values fetched from the Desired Output Links are stored in the corresponding Desired Output fields (DO1-DOA and STR1-STRA). These fields can also be initialized to a constant value, and they can be changed at run time. But note that the value of DOn and STRn will be overwritten if DOLn is a valid link (i.e., if DOLn contains the name of a PV to which the sseq record is able to make a channel-access connection).

Many EPICS records that have a DOL link field also have an OMSL (Output Mode Select) field, which determines whether or not the DOL field is used. Like the seq record, the sseq record has no such field. Its DOLn links are used if they contain text that could be a PV name, and value fields are overwritten if that use succeeds.

Field Summary Type DCT Initial Access Modify Rec Proc Monitor PP
DOL1...DOLA Desired Output Links 1-10 INLINK Yes 0 Yes Yes N/A No
DO1...D0A Desired Output Values 1-10 DOUBLE No 0 Yes Yes No No
STR1...STRA Desired Output Strings 1-10 STRING No 0 Yes Yes No No

4. Output/Wait Parameters


When the sseq record is processed, desired output values (DOn or STRn) are written to the corresponding output links (LNKn). These output links should either be blank (in which case no writing will occur), or contain the name of an EPICS PV; they cannot be device addresses. There are ten output links. Only those that contain valid PV names are used. If a link field contains a PV name to which a CA connection cannot be made, the rest of the record currently continues to operate as though the unconnected link field were blank. (This is probably not a good practice, and it is not guaranteed to persist as the record is improved.)

EPICS links can cause processing of the linked-to (i.e., target) record to occur. Whether or not processing actually does occur depends on both the specification of the link, and the properties of the target record. This is well documented in the EPICS Application Developer's Guide, but since some details of link behavior are essential prerequisites for an understanding of the sseq record's WAITn fields, the (EPICS 3.14) behavior of the output links, LNKn, is summarized here:

There are three possibilities:

PP
If LNKn has the attribute "PP" (e.g., "targetRecord.field PP NMS"), then the link will attempt to cause targetRecord to process. The attempt will succeed, however, only if the target record is "Passive" (e.g., targetRecord.SCAN has the value Passive). In other words, "PP" means "process if passive".
CA
If LNKn has the attribute "CA" (e.g., "targetRecord.field CA NMS"), then targetRecord will process only if field has been designated by targetRecord's record-support code as a "Process Passive" field. You can tell if a field is "Process Passive" either by looking at the record's .dbd file, or by writing to it from any Channel Access client; if the record processes when the field is question is written to via Channel Access, then the field is Process Passive, and a CA link to that field from the sseq record will also cause the record to process.
NPP
If LNKn has the attribute "NPP", then targetRecord will not process as a result of LNKn.

The sseq record is permitted to demand a completion callback from EPICS only if the LNK field it's processing has the attribute "CA". A "PP" link is not permitted to make this demand. If LNKn does have the "CA" attribute, and WAITn has the value "Wait", then the sseq record will demand a completion callback. In this case, it will wait after firing LNKn for the callback, before moving on to the next group of DLY/DOL/LNK fields. If LNKn has any other attribute, WAITn is irrelevant and its value will be ignored.

If LNKn has the attribute "CA", and WAITn has the value "Wait", but targetRecord.field is not a Process-Passive field, then targetRecord will not process as a result of LNKn, but the sseq record will immediately receive a completion callback anyway, and will therefore not wait for targetRecord to process.

Finally, if the sseq record successfully waits for targetRecord to finish processing, it is still possible for other records to process as an indirect result of LNKn, and the sseq record cannot wait for this indirectly caused processing to finish unless the database developer has arranged for the indirectly caused processing to be traceable by EPICS. For example, a channel access client may have a monitor on the field the sseq record writes to, and may do something when that field's value changes. EPICS cannot trace this processing without special help from a database developer. This issue is covered in depth in the documentation of the sscan record, which also relies on EPICS execution tracing to determine when processing it has caused finishes. (See "Completion Reporting" in the Powerpoint presentation "Scans.ppt" in the synApps sscan module's documentation directory.)

Field Summary Type DCT Initial Access Modify Rec Proc Monitor PP
LNK1...LNKA Output links 1-10 OUTLINK Yes blank Yes Yes N/A No
WAIT1...WAITA Waits 1-10 MENU ("NoWait"/"Wait") Yes "NoWait" Yes Yes N/A No
These fields determine whether the sseq record waits for completion of any processing started by a LNK field before processing the next set of DLY/DOL/LNK fields. If WAITn has the value "Wait", then the record will attempt to execute LNKn in such a way that it will be able to wait for all processing started by the link to finish.

5. Selection Algorithm Parameters


When the sseq record is processed, it uses a selection algorithm similar to that of the sel (selection) record to decide which links to process. The select mechanism field (SELM) provides three algorithms to choose from: All, Specified or Mask.
All
All link groups are processed, in order from 1 to 10. Thus, if DOL1 or LNK1 is connected, record will wait for DLY1 seconds, fetch the desired output value from DOL1 (if DOL1 contains a PV name), place it in DO1 and STR1, and send it LNK1 (if LNK1 contains a PV name), optionally waiting for completion. Then the record will move on to process DLY2, DOL2, DO2, STR2, LNK2, WAIT2, and so on until the last input and output link DOA and LNKA. The SELN field is not used when SELM = All.
Specified
Each time the record is processed it will get the integer value in the Link Selection (SELN) field and uses that as the index of the link group to process. For instance, if SELN is 4, the desired output value from DO4 will be fetched and sent to LNK4. If DOLn is a constant, DOn is simply used without the value being fetched from the input link.
Mask
Each time the record is processed, the record uses the integer value from the SELN field as a bit mask to determine which link groups to process. For example, if SELN is 1, then the value from DO1 will be written to the location in LNK1. If SELN is 3, the record will fetch 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.
Field Summary Type DCT Initial Access Modify Rec Proc Monitor PP
SELM Select Mechanism RECCHOICE Yes 0 Yes Yes No No
SELN Link Selection USHORT No 1 Yes Yes No No
SELL Link Selection Location INLINK Yes 0 No No N/A No

6. Delay Parameters


The delay parameters consist of 10 fields, one for each I/O link discussed above. These fields cause the record to delay processing before fetching data from the associated input link, or writing to the associated output link. For example, 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 for three seconds before fetching data from the DOL1 link. If neither an input or an output link exist, the associated delay will be ignored.

Delays are implemented with a time granularity of the system clock, which typically has a frequency of 60 Hz. When a delay value is specified, the record rounds it to the nearest multiple of the system clock period, and writes it back to the DLYn field.
Field Summary Type DCT Initial Access Modify Rec Proc Monitor PP
DLY1 Delay time DOUBLE Yes 0 Yes Yes No No
DLY2 Delay time DOUBLE Yes 0 Yes Yes No No
... ... ... ... ... ... ... ... ...
DLYA Delay time DOUBLE Yes 0 Yes Yes No No

7. 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 the EPICS Record Reference Manual for more on the record name (NAME) and description (DESC) fields.
Field Summary Type DCT Initial Access Modify Rec Proc Monitor PP
PREC Display Precision SHORT Yes 0 Yes Yes No No
NAME Record Name STRING [29] Yes 0 Yes No No No
DESC Description STRING [29] Yes Null Yes Yes No No

8. Alarm Parameters


The sequence record has the alarm parameters common to all record types. See the EPICS Record Reference Manual for details.

9. Record Support Routines


The only record support routine is process.

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.