EPICS Record Reference Manual
Soft device modules are provided to obtain input via database or channel
access links or via dbPutField or dbPutLink requests. Two soft device
support modules are provided--Soft Channel
and Raw
Soft Channel
. The first allows VAL to be an arbitrary unsigned
short integer. The second reads the value into RVAL just like normal
hardware modules.
The binary input's fields fall into the following categories:
dbst
utility (R3.13).
For records that specify the Soft Channel
or Raw Soft
Channel
device support routines, the INP field can be a channel
or database access link, or a constant. If a constant, VAL can be
changed directly by dbPuts. See Address
Specification, Chapter 1, 2, for information on the format of
database and channel access addresses. Also, see Section
9.3, Device Support for Soft Records, in this chapter for
more information on soft device support.
If the record gets its value from hardware or uses the Raw Soft
Channel
device support, the device support routines place the
value into the RVAL field which is then converted using the process
described in the next section.
Field | Summary | Type | DCT | Initial | Access | Modify | Rec Proc Monitor | PP |
---|---|---|---|---|---|---|---|---|
INP | Input Link | INLINK | Yes | 0 | No | No | N/A | No |
DTYP | Device Type | DEVCHOICE | Yes | 0 | Yes | No | No | |
ZNAM | Zero Name | STRING [20] | Yes | Null | Yes | Yes | No | Yes |
ONAM | One Name | STRING [20] | Yes | Null | Yes | Yes | No | Yes |
RVAL | Raw Value | ULONG | No | 0 | Yes | Yes | Yes | Yes |
VAL | Value Field | ENUM | No | 0 | Yes | Yes | Yes | Yes |
Soft
Channel
device support is used. The value can also be fetched as
one of the strings specified in the ZNAM or ONAM fields. The ZNAM field
has the string that corresponds to the 0 state, so when the value is
fetched as this string, put_enum_str
will return a 0 will.
The ONAM field holds the string that corresponds to the 1 state, so when
the value is fetched as this string, put_enum_str
returns a
1.
ZNAM | ASCII string defining state zero |
ONAM | ASCII string defining state one |
get_enum_str
record support routine can retrieve the
state string corresponding to VAL's state. So if the value is 1, get_enum_str
will return the string in the ONAM field; and if 0, get_enum_str
will return the ZNAM string.See Chapter 2, 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 |
---|---|---|---|---|---|---|---|---|
ZNAM | Zero Name | STRING [20] | Yes | Null | Yes | Yes | No | Yes |
ONAM | One Name | STRING [20] | Yes | Null | Yes | Yes | No | Yes |
NAME | Record Name | STRING [29] | Yes | 0 | Yes | No | No | No |
DESC | Description | STRING [29] | Yes | Null | Yes | Yes | No | No |
The user can choose the severity for each state in the ZSV and OSV. The possible values for these fields are NO ALARM, MINOR, and MAJOR. The ZSV holds the severity for the zero state; OSV, for the one state. COSV causes an alarm whenever the state changes between 0 and 1 and the severity is configured as MINOR or MAJOR.
See Alarm Specification, Chapter 1, 4, for a complete explanation of discrete alarm states. Alarm Fields, Chapter 2, 3, 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 |
---|---|---|---|---|---|---|---|---|
ZSV | Zero Severity | GBLCHOICE | Yes | 0 | Yes | Yes | No | Yes |
OSV | One Severity | GBLCHOICE | Yes | 0 | Yes | Yes | No | Yes |
COSV | Change of State Severity | GBLCHOICE | Yes | 0 | Yes | Yes | No | Yes |
ORAW is used to determine if monitors should be triggered for RVAL at the same time they are triggered for VAL.
MASK is given a value by the device support routines. This value is used to manipulate the record's value, but is only the concern of the hardware device support routines.
The LALM field holds the value of the last occurrence of the change of state alarm. It is used to implement the change of state alarm, and thus only has meaning if COSV is MINOR or MAJOR.
The MLST is used by the process
record support routine to
determine if archive and value change monitors are invoked. They are if
MLST is not equal to VAL.
Field | Summary | Type | DCT | Initial | Access | Modify | Rec Proc Monitor | PP |
---|---|---|---|---|---|---|---|---|
ORAW | Old Raw Value | ULONG | No | 0 | Yes | No | No | No |
MASK | Hardware mask | ULONG | No | compute | Yes | No | No | No |
LALM | Last Alarmed value | USHORT | No | 0 | Yes | No | No | No |
MLST | Last Monitored Value | USHORT | No | 0 | Yes | No | No | No |
The following fields are used to operate the binary input in the simulation mode. See Chapter 3, 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 | DOUBLE | 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 |
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.
status=read_bi PACT = TRUE TIME = tslocaltime if status is 0, then set VAL=(0,1) if RVAL is (0, not 0) and UDF = False if status is 2, set status = 0
The primary responsibility of the device support routines is to obtain a new raw input value whenever read_bi is called. The device support routines are primarily interested in the following fields:
Name | Summary | Description |
---|---|---|
PACT | Processing Active | See Chapter 2, 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 a device support routines only if it doesn't want record support to set it. |
INP | Input Link | This field is used by the device support routines to locate its input. |
RVAL | Raw Value | It is the responsibility of the device support routine to give this field a value. |
MASK | Hardware mask. | The device support routine must give this field a value if it needs to use it. |
report(FILE fp, paddr)Not currently used.
init()This routine is called once during IOC initialization.
init_record(precord)This routine is optional. If provided, it is called by the record support init_record routine.
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_bi(precord)This routine must provide a new input value. It returns the following values:
If the INP link type is constant, then the constant value is stored into VAL by init_record, and UDF is set to FALSE. VAL can be changed via dbPut requests. If the INP link type is PV_LINK, then dbCaAddInlink is called by init_record.
read_bi calls recGblGetLinkValue to read the current value of VAL. See Soft Input, Chapter 3, 2.3, for details.
If the return status of recGblGetLinkValue is zero, then read_bi sets UDF to FALSE. The status of recGblGetLinkValue is returned.
read_bi returns a value of 0. Thus the record processing routine will force VAL to be 0 or 1.
Generated with Harlequin WebMaker