RRM 3-14 Pulse Delay
pulseDelay
The normal use for the pulseDelay record type is to generate pulses to be written to a device.
Parameter Fields
The fields fall into the following categories:
- scan parameters
- trigger parameters
- pulse parameters
- output parameters
- operator display parameters
- run-time parameters
Scan Parameters
The pulse delay 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. Note that I/O event scanning is only supported for those card types that interrupt.
Trigger Parameters
These fields determine the source for the pulse triggers. Since the pulse delay record is a kind of output record, these fields resemble the desired output parameters of, for example, the analog output record.
The trigger type (TTYP) field determines whether the pulse trigger comes from an external or internal source. Or, differently put, from a hardware source or from a soft trigger source. When TTYP is set to Hardware
, the HTS field becomes the trigger source for the record. The hard device support sets the HTS. When hardware is chosen, the OUT output link must specify a hardware address, and the DTYP field must specify the appropriate device support module.
When software is specified in the TTYP field, the record uses the SGV field to generate pulses. The SGV field generates a pulse when its value is Active
, and generates no pulse when Inactive
. It's value can be manipulated by dbPuts at run-time, or else a value for STV can be retrieved from the soft trigger location (STL) field, an input link which must be a database link if STV is used.
The GATE field can either enable or disable the generation of pulses. When GATE is 0, no pulses are triggered. When GATE is 1, pulses are triggered according to the record's configuration. A value for GATE can be read from the GLNK field, an input link which can be a constant, database link, or a channel access link. When a constant, GATE is initialized to the constant value. Otherwise, a value for GATE is fetched from the location specified in GLNK each time the record is processed.
The CEDG, CTYP, ECS, and ECR field may not have significance for all device support modules. For the modules they apply to, they control the timing of pulses. The CEDG field determines whether clock timing occurs on the rising edge or falling edge of a signal. It has two choices: Rising Edge
or Falling Edge
. The CTYP field determines whether the timing is controlled externally or internally and has two choices: Internal
and External
. The ECS and ECR fields have significance only if CTYP specifies External
.
Field | Summary | Type | DCT | Initial | Access | Modify | Rec Proc Monitor | PP |
---|---|---|---|---|---|---|---|---|
TTYP | Trigger Type (hardware/Software) | RECCHOICE | Yes | 0 | Yes | Yes | No | No |
HTS | Hardware Trigger | ENUM | Yes | 0 | Yes | Yes | No | Yes |
STL | Soft Trigger Location (input link) | INLINK | Yes | 0 | No | No | N/A | No |
STV | Soft Trigger Value | RECCHOICE | Yes | 0 | Yes | Yes | No | Yes |
GATE | Gate for enable/disable of Pulse Generation | RECCHOICE | Yes | 1 | Yes | Yes | No | Yes |
GLNK | Gate Location | INLINK | Yes | 0 | Yes | No | N/A | No |
CTYP | Clock Type | RECCHOICE | Yes | 0 | Yes | Yes | No | No |
CEDG | Clock Signal Edge | RECCHOICE | Yes | 0 | Yes | Yes | No | No |
ECS | External Clock Source | SHORT | Yes | 0 | Yes | Yes | No | No |
ECR | External Clock Rate, in Hz | DOUBLE | Yes | 0 | Yes | Yes | No | No |
Pulse Parameters
These fields determine the characteristics of the pulse that is generated by the record. The pulse delay (DLY) field is the most important of these fields. In it, the user specifies the time delay, from the trigger edge until the generation of the pulse. In the time units (UNIT) field, the user specifies the units of time that the delay should be in. The UNIT field can specify Seconds
, Milliseconds
, Microseconds
, Nanoseconds
, or Picoseconds
.
The user specifies the time duration of the pulse in the pulse width (WIDE) field, which also uses the UNIT field for its time units.
Field | Summary | Type | DCT | Initial | Access | Modify | Rec Proc Monitor | PP |
---|---|---|---|---|---|---|---|---|
UNIT | Time units | RECCHOICE | Yes | 0 | Yes | Yes | No | No |
DLY | Pulse Delay, in UNITS of time | DOUBLE | Yes | 0 | Yes | Yes | Yes | Yes |
WIDE | Pulse Width, in UNITS of time | DOUBLE | Yes | 0 | Yes | Yes | Yes | Yes |
Operator Display Parameters
These parameters are used to display the delay value (DLY)and other parameters of the pulse delay either textually or graphically.
The HOPR and LOPR fields set the upper and lower display limits for the VAL, DLY, ODLY, WIDE, and OWID fields. Both the get_graphic_double
and get_control_double
record support routines retrieve these fields.
The PREC field determines the floating point precision with which to display DLY only. It is used whenever the get_precision
record support routine is called.
See Fields Common to All Record Types for more on the record name (NAME) and description (DESC) fields.
Field | Summary | Type | DCT | Initial | Access | Modify | Rec Proc Monitor | PP |
---|---|---|---|---|---|---|---|---|
HOPR | High Operating Range | FLOAT | Yes | 0 | Yes | Yes | No | No |
LOPR | Low Operating Range | FLOAT | Yes | 0 | Yes | Yes | No | No |
PREC | Display Precision | SHORT | Yes | 0 | Yes | Yes | No | No |
NAME | Record Name | STRING [29] | Yes | 0 | Yes | No | No | |
DESC | Description | STRING [29] | Yes | Null | Yes | Yes | No | No |
Alarm Parameters
The pulse delay 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.
Run-time Parameters
These fields are used by the record for processing and to implement monitors for some of the pulse fields.
The old delay (ODLY) and old width (OWID) fields are used to implement monitors for the DLY and WIDE fields, respectively. If, for instance, the current value of the DLY field differs from the value held in ODLY, monitors are triggered for the DLY field.
The PFLD indicates which of the following fields have changes since the record was last processed: DLY, WIDE, STV, GATE, or HTS. Some devices use PFLD so that adjustments can be made when any of these fields are changed.
The VAl field indicates whether a pulse has been generated since the last time the record was processed. It is ACTIVE
if YES, INACTIVE
if NO.
Field | Summary | Type | DCT | Initial | Access | Modify | Rec Proc Monitor | PP |
---|---|---|---|---|---|---|---|---|
ODLY | Old Delay | DOUBLE | No | 0 | Yes | No | No | No |
OWID | Old Width | DOUBLE | No | 0 | Yes | No | No | No |
PFLD | Processing Field | USHORT | No | 0 | Yes | No | No | No |
VAL | Value | RECCHOICE | No | 0 | Yes | Yes | Yes | No |
LLOW | Low Logic Level | RECCHOICE | Yes | 0 | Yes | Yes | No | No |
Record Support
Record Support Routines
init_record
This routine first checks that device support is available. Device support is then checked to see if write_pd is defined.
Next this routine initializes STV with the value of STL if STL type is CONSTANT link or creates a channel access link if STL type is PV_LINK.
GATE is likewise initialized if GLNK is CONSTANT or PV_LINK.
If device support includes init_record, it is called.
process
See next section.
special
Sets the PFLD field to indicate if write to DLY, STV, GATE or HTS field caused processing of the record.
get_value
Fills in the values of struct valueDes so that they refer to VAL.
get_precision
Retrieves PREC.
get_graphic_double
Sets the upper display and lower display limits for a field. If the field is VAL, DLY, ODLY, WIDE or OWID the limits are set to HOPR and LOPR, else if the field has upper and lower limits defined they will be used, else the upper and lower maximum values for the field type will be used.
get_control_double
Sets the upper control and the lower control limits for a field. If the field is VAL, DLY, ODLY, WIDE or OWID the limits are set to HOPR and LOPR, else if the field has upper and lower limits defined they will be used, else the upper and lower maximum values for the field type will be used.
Record Processing
Routine process implements the following algorithm:
- Check to see that the appropriate device support module exists. If it doesn't, an error message is issued and processing is terminated with the PACT field still set to TRUE. This ensures that processes will no longer be called for this record. Thus error storms will not occur.
- The values for STV and GATE are then fetched.
- Call write_pd routine.
- PFLD is reset to zero.
- If device support set PACT to TRUE, then return.
- Set UDF to FALSE.
- Check to see if monitors should be invoked.
- Alarm monitors are invoked if the alarm status or severity has changed.
- Archive and value change monitors on DLY and WIDE are invoked if values have changed.
- NSEV and NSTA are reset to 0.
- Scan forward link if necessary, set PACT FALSE, and return.
Device Support
Fields Of Interest To Device Support
Each record must have an associated set of device support routines. The primary responsibility of the device support routines is to issue commands to the output device. The device support routines are primarily interested in the following fields:
Name | Summary | Description |
---|---|---|
OUT | Output Link | This field is used by the device support routines to locate its output. |
WIDE | Pulse Width | Device support must use WIDE for pulse width |
DLY | Pulse Delay | Device support must use DLY for the delay after trigger edge until beginning of pulse. |
LLOW | Low Logic Level | Device support must use to determine logic low level. |
UNIT | Time Units | All values that refer to time measure will be in this time unit. |
VAL | Value | This field will contain a 1 if a trigger occurred since the last time the record was processed if the device supports it. |
PFLD | Processing Field | This field is used by some devices to indicate if the record was scanned to adjust certain fields such as delay or trigger source. If the device has a destructive read, then changes to these types of fields could write to the device instead of a read and a write. |
TTYP | Trigger Type | This field is used by the device support routines to force triggering on leading or falling edge of signal if the specified device supports it. |
HTS | Hardware Trigger Source | This field will be used to set the hardware trigger source if the device supports it. |
STV | Soft Trigger Source | This field will be used for software to trigger an output delayed pulse if the device supports it. |
CEDG | Clock Signal Edge | This field is used by the device support routines to force clock timing on leading or falling edge of signal. |
CTYP | Clock Type | If CTYP is external, device support is responsible for using ECR for the clock rate and if CTYP is internal, ECS is the clock source. |
ECS | External Clock Source | |
ECR | External Clock Rate |
Device Support Routines
Device support consists of the following routines:
report
report()
This routine is optional. If provided, it prints a report of all device modules.
init
init()
This routine is called once during IOC initialization.
init_record
init_record(precord)
This routine is optional. If provided, it is called by the record support init_record routine.
get_ioint_info
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.
write_pd
write_pd(precord)
This routine issues commands to the output device.
EPICS Record Reference Manual - 19 MAY 1998