NB: This manual refers to a very old version of EPICS, see the EPICS Wiki for updated record reference documentation.

[Next] [Previous] [Top] [Contents] [Index]

EPICS Record Reference Manual

Chapter 39: Waveform

1. Introduction


The waveform record type is used to interface waveform digitizers. The record stores its data in arrays. The array can contain any of the supported data types. The waveform's fields fall into the following categories:

scan parameters

read parameters

operator display parameters

run-time parameters

2. Scan Parameters


The waveform record has the standard fields for specifying under what circumstances the record will be processed. These fields are listed in Scan Fields, Chapter 2, 2. In addition, Scanning Specification, Chapter 1, 1, explains how these fields are used. Note that I/O event scanning is only supported for those card types that interrupt.

3. Read Parameters


These fields are configurable by the user to specify how and from where the record reads its data. How the INP field is configured determines where the waveform gets its input. It can be a hardware address, a channel access or database link, or a constant. Only in records that use soft device support can the INP field be a channel access link, a database link, or a constant. Otherwise, the INP field must be a hardware address. See Address Specification, Chapter 1, 2, for information on the format of hardware addresses and database links.

The DTYP field must contain the name of the appropriate device support module. The user can see a list of the device support modules currently supported at the user's local site by using the dbst utility (R3.13).

The values retrieved from the input link are placed in an array referenced by VAL. (If the INP link is a constant, elements can be placed in the array via dbPuts.) NELM specifies the number of elements that the array will hold, while FTVL specifies the data type of the elements.

The RARM field causes the device to re-arm when this field is set to 1.
FieldSummaryTypeDCTInitialAccessModifyRec Proc MonitorPP
INPInput Link INLINKYes0NoNoN/ANo
NELMNumber of Elements in array ULONGYes1YesNoNoNo
FTVL Field Type of ValueGBLCHOICEYes0YesNoNoNo
RARM RearmSHORTYes0YesYesNoYes

4. Operator Display Parameters


These parameters are used to present meaningful data to the operator. They display the value and other parameters of the waveform either textually or graphically.

EGU is a string of up to 16 characters describing the units that the waveform measures. It is retrieved by the get_units record support routine.

The HOPR and LOPR fields set the upper and lower display limits for array elements referenced by the VAL field. 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 the array values. It is used whenever the get_precision record support routine is called.

See Chapter 2, Fields Common to All Record Types, for more on the record name (NAME) and description (DESC) fields.
FieldSummaryTypeDCTInitialAccessModifyRec Proc MonitorPP
EGUEngineering UnitsSTRING [16]YesnullYesYesNoNo
HOPRHigh Operating RangeFLOATYes0YesYesNoNo
LOPRLow Operating RangeFLOATYes0YesYesNoNo
PRECDisplay PrecisionSHORTYes0YesYesNoNo
NAMERecord NameSTRING [29]Yes0YesNoNoNo
DESCDescriptionSTRING [29]YesNullYesYesNoNo

5. Alarm Parameters


The waveform record has the alarm parameters common to all record types. Alarm Fields, Chapter 2, 3, lists other fields related to a alarms that are common to all record types.

6. Run-time Parameters


These parameters are used by the run-time code for processing the waveform. They are not configured using a configuration tool. Only the VAL field is modifiable at run-time.

VAL references the array where the waveform stores its data. The BPTR field holds the address of the array.

The NORD field holds a counter of the number of elements that have been read into the array. It is reset to 0 when the device is rearmed. The BUSY field indicates if the device is armed but has not yet been digitized.
FieldSummaryTypeDCTInitialAccessModifyRec Proc MonitorPP
VAL Value FieldSee FTVLNo0YesYesYesYes
BPTRBuffer Pointer NOACCESSNo0NoNoNoNo
NORD Number of Elements Read ULONGNo0YesNoNoNo
BUSYBusySHORTNo0YesNoNoNo

The following fields are used to operate the waveform in the simulation mode. See Simulation Mode, Chapter 3, 2.4, for more information on the simulation mode fields.
FieldSummaryTypeDCTInitialAccessModifyRec Proc MonitorPP
SIOLSimulation Value LocationINLINKYes0NoNoN/ANo
SIMLSimulation Mode LocationINLINKYes0NoNoN/ANo
SIMMSimulation ModeGBLCHOICENo0YesYesNoNo
SIMSSimulation Mode Alarm SeverityGBLCHOICEYes0YesYesNoNo

7. Record Support Routines


init_record

Using NELM and FTVL space for the array is allocated. The array address is stored in the record.

This routine initializes SIMM with the value of SIML if SIML type is CONSTANT link or creates a channel access link if SIML type is PV_LINK. VAL is likewise initialized if SIOL is CONSTANT or PV_LINK.

This routine next checks to see that device support is available and a device support read routine is defined. If either does not exist, an error message is issued and processing is terminated

If device support includes init_record, it is called.

process

See next section.

get_value

Fills in the values of struct valueDes so that they refer to the array.

cvt_dbaddr

This is called by dbNameToAddr. It makes the dbAddr structure refer to the actual buffer holding the result.

get_array_info

Obtains values from the array referenced by VAL.

put_array_info

Writes values into the array referenced by VAL.

get_units

Retrieves EGU.

get_prec

Retrieves PREC if field is VAL field. Otherwise, calls recGblGetPrec().

get_graphic_double

Sets the upper display and lower display limits for a field. If the field is VAL 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 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_graphic_double

Sets the following values:

upper_disp_limit = HOPR

lower_disp_limit = LOPR

get_control_double

Sets the following values

upper_ctrl_limit = HOPR

lower_ctrl_limit = LOPR

8. Record Processing


Routine process implements the following algorithm:

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

2. Call device support read routine.

3. If PACT has been changed to TRUE, the device support read routine has started but has not completed writing the new value. In this case, the processing routine merely returns, leaving PACT TRUE.

4. Check to see if monitors should be invoked.

5. Scan forward link if necessary, set PACT FALSE, and return.

9. Device Support


9.1. Fields Of Interest To Device Support

Each waveform record must have an associated set of device support routines. The primary responsibility of the device support routines is to obtain a new array value whenever read_wf is called. The device support routines are primarily interested in the following fields:
Name Summary Description
PACT Processing ActiveSee Chapter 2, Fields Common to All Record Types for an explanation of these fields.
DPVT Device Private
NSEV New Alarm Severity
NSTA New Alarm Status
INP Input LinkThis field is used by the device support routines to locate its input.
RATE Sampling Rate Some device support modules may find this useful.
PTSS Pre-trigger SamplesSome device support modules may find this useful.
NELM Number Of Elements In Array 
FTVL Field Type Of ValueThis is DBF_STRING, ... , DBF_ENUM. The device support routine should check that this is correctly defined.
RARM RearmWhen set to 1, the device will be rearmed. The device support routine should reset it to 0 when done.
BPTRHolds Address of Array  
NORD Number of Elements ReadDevice support must set this value when it completes.
BUSYIs device busy? 

9.2. Device Support Routines

Device support consists of the following routines:

report

 report(FILE fp, paddr)
Not currently used.

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.

read_wf

  read_wf(precord)
This routine must provide a new input value. It returns the following values:

0: Success.

Other: Error.

9.3. Device Support For Soft Records

The Soft Channel device support module is provided to read values from other records and store them in arrays. If INP is a constant link, then read_wf does nothing. In this case, the record can be used to hold arrays written via dbPuts. If INP is a database or channel access link, the new array value is read from the link. NORD is set.

This module places a value directly in VAL.

If the INP link type is constant, then NORD is set to zero. If the INP link type is PV_LINK, then dbCaAddInlink is called by init_record.

read_wf calls recGblGetLinkValue which performs the following steps:

If the INP link type is CONSTANT recGblGetLinkValue does nothing.

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.

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_ALARM is raised.

NORD is set to the number of values returned and read_wf returns.

1. - Introduction
2. - Scan Parameters
3. - Read Parameters
4. - Operator Display Parameters
5. - Alarm Parameters
6. - Run-time Parameters
7. - Record Support Routines
init_record
process
get_value
cvt_dbaddr
get_array_info
put_array_info
get_units
get_prec
get_graphic_double
get_control_double
get_graphic_double
get_control_double
8. - Record Processing
9. - Device Support
9.1. - Fields Of Interest To Device Support
9.2. - Device Support Routines
report
init
init_record
get_ioint_info
read_wf
9.3. - Device Support For Soft Records

EPICS Record Reference Manual - 19 MAY 1998
[Next] [Previous] [Top] [Contents] [Index]

Generated with Harlequin WebMaker