RRM 3-14 Long Input
longin - Long Input
The normal use for the long input record or "longin" record is to retrieve a long integer value of up to 32 bits. Device support routines are provided to support direct interfaces to hardware. In addition, the Soft Channel
device module is provided to obtain input via database or channel access links or via dbPutField or dbPutLink requests.
Parameter Fields
The fields in this record fall into the following categories:
- scan parameters
- read parameters
- operator display parameters
- alarm parameters
- run-time and simulation mode parameters
Scan Parameters
The long input record has the standard fields for specifying under what circumstances the record 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.
Read Parameters
The device support routines use the INP field to obtain the record's input. For records that obtain their input from devices, the INP field must contain the address of the I/O card, and the DTYP field must specify the proper device support module. Be aware that the address format differs according to the I/O bus used. You can see a list of the device support modules currently supported at the user's local site by using the dbst
utility in R3.13.
For soft records, the INP can be a constant, a database link, or a channel access link. The value is read directly into VAL. The Soft Channel
device support module is available for longin records. See Address Specification for information on the format of hardware addresses and a database links.
Field | Summary | Type | DCT | Initial | Access | Modify | Rec Proc Monitor | PP |
---|---|---|---|---|---|---|---|---|
VAL | Value Field | LONG | No | 0 | Yes | Yes | Yes | Yes |
INP | Input Link | INLINK | Yes | 0 | No | No | N/A | No |
DTYP | Device Type | DEVCHOICE | Yes | 0 | Yes | No | No |
Operator Display Parameters
These parameters are used to present meaningful data to the operator. These fields are used to display the value and other parameters of the long input either textually or graphically.
EGU is a string of up to 16 characters describing the units that the long input measures. It is retrieved by the get_units
record support routine.
The HOPR and LOPR fields set the upper and lower display limits for the VAL, HIHI, HIGH, LOW, and LOLO fields. Both the get_graphic_double
and get_control_double
record support routines retrieve these fields.
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 |
---|---|---|---|---|---|---|---|---|
EGU | Engineering Units | STRING [16] | Yes | null | Yes | Yes | No | No |
HOPR | High Operating Range | LONG | Yes | 0 | Yes | Yes | No | No |
LOPR | Low Operating Range | LONG | 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 |
Alarm Parameters
The possible alarm conditions for long inputs are the SCAN, READ, and limit alarms. The SCAN and READ alarms are called by the record or device support routines.
The limit alarms are configured by the user in the HIHI, LOLO, HIGH, and LOW fields using numerical values. For each of these fields, there is a corresponding severity field which can be either NO_ALARM, MINOR, or MAJOR. The HYST field can be used to specify a deadband around each limit. See Alarm Specification for a complete explanation of alarms and these fields. Alarm Fields lists other fields related to a alarms that are common to all record types.
Field | Summary | Type | DCT | Initial | Access | Modify | Rec Proc Monitor | PP |
---|---|---|---|---|---|---|---|---|
HIHI | Hihi Alarm Limit | LONG | Yes | 0 | Yes | Yes | No | Yes |
HIGH | High Alarm Limit | LONG | Yes | 0 | Yes | Yes | No | Yes |
LOW | Low Alarm Limit | LONG | Yes | 0 | Yes | Yes | No | Yes |
LOLO | Lolo Alarm Limit | LONG | Yes | 0 | Yes | Yes | No | Yes |
HHSV | Hihi Alarm Severity | GBLCHOICE | Yes | 0 | Yes | Yes | No | Yes |
HSV | High Alarm Severity | GBLCHOICE | Yes | 0 | Yes | Yes | No | Yes |
LSV | Low Alarm Severity | GBLCHOICE | Yes | 0 | Yes | Yes | No | Yes |
LLSV | Lolo Alarm Severity | GBLCHOICE | Yes | 0 | Yes | Yes | No | Yes |
HYST | Alarm Deadband | LONG | Yes | 0 | Yes | Yes | No | No |
Monitor Parameters
These parameters are used to determine when to send monitors placed on the value field. The monitors are sent when the value field exceeds the last monitored field (see the next section) by the appropriate deadband. If these fields have a value of zero, everytime the value changes, a monitor will be triggered; if they have a value of -1, everytime the record is scanned, monitors are triggered. The ADEL field is used by archive monitors and the MDEL field for all other types of monitors. See Monitor Specification for a complete explanation of monitors.
Field | Summary | Type | DCT | Initial | Access | Modify | Rec Proc Monitor | PP |
---|---|---|---|---|---|---|---|---|
ADEL | Archive Deadband | LONG | Yes | 0 | Yes | Yes | No | No |
MDEL | Monitor, i.e. value change, Deadband | LONG | Yes | 0 | Yes | Yes | No | No |
Run-time and Simulation Mode Parameters
The LALM, MLST, and ALST fields are used to implement the hysteresis factors for monitor callbacks. Only if the difference between these fields and the corresponding value field is greater than the appropriate delta (MDEL, ADEL, HYST)--only then are monitors triggered. For instance, only if the difference between VAL and MLST is greater than MDEL are the monitors triggered for VAL.
Field | Summary | Type | DCT | Initial | Access | Modify | Rec Proc Monitor | PP |
---|---|---|---|---|---|---|---|---|
LALM | Last Alarm Monitor Trigger Value | LONG | No | 0 | Yes | No | No | No |
ALST | Last Archiver Monitor Trigger Value | LONG | No | 0 | Yes | No | No | No |
MLST | Last Value Change Monitor Trigger Value | LONG | No | 0 | Yes | No | No | No |
The following fields are used to operate the long input in the simulation mode. See Fields Common to Many Record Types for more information on these fields.
Field | Summary | Type | DCT | Initial | Access | Modify | Rec Proc Monitor | PP |
---|---|---|---|---|---|---|---|---|
SIOL | Simulation Value Location | INLINK | Yes | 0 | No | No | N/A | No |
SVAL | Simulation Value | LONG | No | 0 | Yes | Yes | No | No |
SIML | Simulation Mode Location | INLINK | Yes | 0 | No | No | N/A | No |
SIMM | Simulation Mode | GBLCHOICE | No | 0 | Yes | Yes | No | No |
SIMS | Simulation Mode Alarm Severity | GBLCHOICE | Yes | 0 | Yes | Yes | No | No |
Record Support
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
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.
- readValue is called. See Input Records for more information.
- 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.
- 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.
- 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 are invoked if ADEL and MDEL conditions are met.
- 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 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 Fields Common to All Record Types for an explanation of these fields. |
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:
- 0: Success. A new value is placed in VAL.
- Other: Error.
Device Support For Soft Records
The Soft Channel
device support 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 Soft Input for more information
If the return status of recGblGetLinkValue
is zero then read_longin sets UDF to FALSE. read_longin returns the status of recGblGetLinkValue
.
EPICS Record Reference Manual - 19 MAY 1998