Table of Contents Previous Chapter Chapter 18: longin - Long Input

Chapter 18: longin - Long Input

1. Introduction

The normal use for the longin record type is to input an integer value of up to 32 bits. Soft device modules are provided to obtain input via database or channel access links or via dbPutField or dbPutLink requests.

2. Field Summary

--------------------------------------------------------------
Field  Type       DCT  Initial  Access  Modify  Rec Proc   PP   
                                                Monitor         
--------------------------------------------------------------
VAL    LONG       No   0        Yes     Yes     Yes        Yes  
INP    INLINK     Yes  0        No      No      N/A        No   
EGU    STRING     Yes  Null     Yes     Yes     No         No   
HOPR   LONG       Yes  0        Yes     Yes     No         No   
LOPR   LONG       Yes  0        Yes     Yes     No         No   
HIHI   LONG       Yes  0        Yes     Yes     No         Yes  
LOLO   LONG       Yes  0        Yes     Yes     No         Yes  
HIGH   LONG       Yes  0        Yes     Yes     No         Yes  
LOW    LONG       Yes  0        Yes     Yes     No         Yes  
HHSV   GBLCHOICE  Yes  0        Yes     Yes     No         Yes  
LLSV   GBLCHOICE  Yes  0        Yes     Yes     No         Yes  
HSV    GBLCHOICE  Yes  0        Yes     Yes     No         Yes  
LSV    GBLCHOICE  Yes  0        Yes     Yes     No         Yes  
HYST   LONG       Yes  0        Yes     Yes     No         No   
ADEL   LONG       Yes  0        Yes     Yes     No         No   
MDEL   LONG       Yes  0        Yes     Yes     No         No   
LALM   LONG       No   0        Yes     No      No         No   
ALST   LONG       No   0        Yes     No      No         No   
MLST   LONG       No   0        Yes     No      No         No   
SIOL   INLINK     Yes  0        No      No      N/A        No   
SVAL   LONG       No   0        Yes     Yes     No         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 the value resulting form record processing. If INP    
                            is a constant, then VAL is initialized to the INP value but   
                            it can be changed dynamically via dbPutField or               
                            dbPutLink.                                                    
INP   Input Link            This field is used by the device support routines to obtain   
                            input. For soft records, it can be a constant, a database     
                            link, or a channel access link.                               
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                                                                               
HIHI  Hihi Alarm Limit      These fields specify the alarm limits and severities.         
HIGH  High Alarm Limit                                                                    
LOW   Low Alarm Limit                                                                     
LOLO  Lolo Alarm Limit                                                                    
HHSV  Severity for a Hihi                                                                 
      Alarm                                                                               
HSV   Severity for a High                                                                 
      Alarm                                                                               
LSV   Severity for a Low                                                                  
      Alarm                                                                               
LLSV  Severity for a Lolo                                                                 
      Alarm                                                                               
HYST  Alarm Deadband        These parameters specify hysteresis factors for triggering    
                            monitor callbacks, i.e. callbacks specified by calls to       
                            caAddEvent or dbAddEvent. A monitor will not be               
                            triggered until VAL changes by more than the specified        
                            amount.                                                       
ADEL  Archive Deadband                                                                    
MDEL  Monitor, i.e. value                                                                 
      change, Deadband                                                                    
LALM  Last Alarmed          Value when last monitors for alarm/archiver/value             
      Value                 changes were triggered.  These fields are used to             
                            implement the hysteresis factors for monitor callbacks.       
ALST  Archive Last  Value                                                                 
MLST  Monitor Last  Value                                                                 
SIMM  Simulation Mode       Simulation mode process variables.  Refer to Chapter 3,       
                            Section "Simulation Mode" on page 11 for more                 
                            information.                                                  
SIML  Simulation Mode                                                                     
      Location                                                                            
SVAL  Simulation Value                                                                    
SIOL  Simulation Value                                                                    
      Location                                                                            
SIMS  Simulation Mode                                                                     
      Alarm Severity                                                                      
----------------------------------------------------------------------------------------

4. Record Support Routines

init_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. SVAL 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 VAL.

get_units

Retrieves EGU.

get_graphic_double

Sets the upper display and lower display limits for a field. If the field is VAL, HIHI, HIGH, LOW, or LOLO, 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, HIHI, HIGH, LOW, or LOLO, 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_alarm_double

Sets the following values:

  upper_alarm_limit = HIHI
  upper_warning_limit = HIGH
  lower_warning_limit = LOW
  lower_alarm_limit = LOLO

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. readValue is called. See Chapter 3, Section "Simulation Mode" on page 11 for details.
  3. If PACT has been changed to TRUE, the device support read routine has started but has not completed reading a new input value. In this case, the processing routine merely returns, leaving PACT TRUE.
  4. Check alarms. This routine checks to see if the new VAL causes the alarm status and severity to change. If so, NSEV, NSTA and LALM are set. It also honors the alarm hysteresis factor (HYST). Thus the value must change by more than HYST before the alarm status and severity is lowered.
  5. Check to see if monitors should be invoked.
  6. Scan forward link if necessary, set PACT FALSE, and return.

6. Device Support

Fields Of Interest To Device Support

Each long input record must have an associated set of device support routines. The primary responsibility of the device support routines is to obtain a new input value whenever read_longin 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                                                                    
UDF   VAL Undefined                                                                     
NSEV  New Alarm Severity                                                                
NSTA  New Alarm Status                                                                  
VAL   Value Field         This field is set by device support routines.                 
INP   Input Link          This field is used by the device support routines to locate   
                          its input.                                                    
--------------------------------------------------------------------------------------

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_longin

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

7. Device Support For Soft Records

This module places a value directly in VAL.

If the INP link type is constant, then the constant value is stored into VAL by init_record, and UDF is set to FALSE. If the INP link type is PV_LINK, then dbCaAddInlink is called by init_record.

read_longin calls recGblGetLinkValue to read the current value of VAL. See Chapter 3, Section "Soft Input" on page 10 for details.

If the return status of recGblGetLinkValue is zero then read_longin sets UDF to FALSE. read_longin returns the status of recGblGetLinkValue.

 
Table of Contents Next Chapter