Table of Contents Previous Chapter Chapter 40: Waveform

Chapter 40: Waveform

1. Introduction

The waveform record type stores arrays as data. The array can contain any of the supported data types.

2. Field Summary

--------------------------------------------------------------
Field  Type       DCT  Initial  Access  Modify  Rec Proc   PP   
                                                Monitor         
--------------------------------------------------------------
VAL    See FTVL   No   0        Yes     Yes     Yes        Yes  
RARM   SHORT      Yes  0        Yes     Yes     No         Yes  
PREC   SHORT      Yes  0        Yes     Yes     No         No   
INP    INLINK     Yes  0        No      No      N/A        No   
EGU    STRING     Yes  Null     Yes     Yes     No         No   
HOPR   FLOAT      Yes  0        Yes     Yes     No         No   
LOPR   FLOAT      Yes  0        Yes     Yes     No         No   
NELM   ULONG      Yes  1        Yes     No      No         No   
FTVL   GBLCHOICE  Yes  0        Yes     No      No         No   
BPTR   NOACCESS   No   0        No      No                 No   
NORD   ULONG      No   0        Yes     No      No         No   
BUSY   SHORT      No   0        Yes     No      No         No   
SIOL   INLINK     Yes  0        No      No      N/A        No   
SIML   INLINK     Yes  0        No      No      N/A        No   
SIMM   GBLCHOICE  No   0        Yes     Yes     No         No   
SIMS   GBLCHOICE  Yes  0        Yes     Yes     No         No   
--------------------------------------------------------------

3. Field Descriptions

---------------------------------------------------------------------------------------
Name  Summary              Description                                                   
---------------------------------------------------------------------------------------
VAL   Value Field          This is used to reference the array.                          
RARM  Rearm                When set to 1, the device will be rearmed.                    
PREC  Display Precision    Precision with which to display VAL.  This field is used by   
                           record support to supply a value when get_precision           
                           is called.                                                    
INP   Input Link           This field is used by the device support routines to obtain   
                           input.                                                        
EGU   Engineering Units    ASCII string describing Engineering units.  This field is     
                           used by record support to supply a units description string   
                           when get_units is called.                                     
HOPR  High Operating       These fields determine the upper and lower display limits     
      Range                for graphics displays and the upper and lower control         
                           limits for control displays. The fields are used by record    
                           support to honor calls to get_graphic_double or               
                           get_control_double.                                           
LOPR  Low Operating                                                                      
      Range                                                                              
NELM  Number of                                                                          
      Elements, in array                                                                 
FTVL  Field Type of Value  This is DBF_STRING, ... , DBF_ENUM.                           
BPTR  Buffer Pointer       Holds address of array.                                       
NORD  Number of                                                                          
      Elements Read                                                                      
BUSY  Busy                 Is device busy?                                               
SIMM  Simulation Mode      Simulation mode process variables.  Refer to Chapter 3,       
                           Section "Simulation Mode" on page 13 for more                 
                           information.                                                  
SIML  Simulation Mode                                                                    
      Location                                                                           
SIOL  Simulation Value                                                                   
      Location                                                                           
SIMS  Simulation Mode                                                                    
      Alarm Severity                                                                     
---------------------------------------------------------------------------------------

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

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

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

6. Device Support

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 Active    See Chapter 2, Section "Database Common: Field                
                           Descriptions" on page 4 for descriptions.                     
DPVT  Device Private                                                                     
NSEV  New Alarm Severity                                                                 
NSTA  New Alarm Status                                                                   
INP   Input Link           This field is used by the device support routines to locate   
                           its input.                                                    
RATE  Sampling Rate        Some device support modules may find this useful.             
PTSS  Pretrigger Samples   Some device support modules may find this useful.             
NELM  Number Of                                                                          
      Elements In Array                                                                  
FTVL  Field Type Of Value   This is DBF_STRING, ... , DBF_ENUM. The device               
                           support routine should check that this is correctly defined.  
RARM  Rearm                When set to 1, the device will be rearmed. The device         
                           support routine should reset it to 0 when done.               
BPTR  Holds Address Of                                                                   
      Array                                                                              
NORD  Number Of            Device support must set this value when it completes.         
      Elements Read                                                                      
BUSY  Is device busy?                                                                    
---------------------------------------------------------------------------------------

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:

7. Device Support For Soft Records

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:

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