Difference between revisions of "RRM 3-14 Multi-Bit Binary Input"

From EPICSWIKI
 
(Fix SHFT table row)
 
(7 intermediate revisions by 5 users not shown)
Line 5: Line 5:




The normal use for the multi-bit binary input record is to read multiple bit inputs from hardware. The binary value represents a state from a range of up to 16 states. The multi-bit input record interfaces with devices that use more than one bit.
The normal use for the multi-bit binary input record is to read contiguous, multiple bit inputs from hardware. The binary value represents a state from a range of up to 16 states. The multi-bit input record interfaces with devices that use more than one bit.


Most device support modules obtain values from hardware and place the value in RVAL. For these device support modules record processing uses RVAL to determine the current state (VAL is given a value between 0 and 15). Device support modules may optionally read a value directly into VAL.
Most device support modules obtain values from hardware and place the value in RVAL. For these device support modules record processing uses RVAL to determine the current state (VAL is given a value between 0 and 15). Device support modules may optionally read a value directly into VAL.
Line 24: Line 24:
=== Scan parameters ===
=== Scan parameters ===


The multi-bit binary input record has the standard fields for specifying under what circumstances it will be processed. These fields are listed in [[RRM 3-13 dbCommon#Scan Fields|Scan Fields]]. In addition, [[RRM 3-13 Concepts#Scanning Specification|Scanning Specification]] explains how these fields are used. Note that I/O event scanning is only supported for those card types that interrupt.
The multi-bit binary input record has the standard fields for specifying under what circumstances it will be processed. These fields are listed in [[RRM 3-14 dbCommon#Scan Fields|Scan Fields]]. In addition, [[RRM 3-14 Concepts#Scanning Specification|Scanning Specification]] explains how these fields are used. Note that I/O event scanning is only supported for those card types that interrupt.




=== Read and Convert Parameters ===
=== Read and Convert Parameters ===


The device support routines obtain the record's input from the device or link specified in the INP field. 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. See [[RRM 3-13 Concepts#Address Specification|Address Specification]] for information on the format of hardware addresses. You can see a list of the device support modules currently supported at the user's local site by using the <CODE>dbst</CODE> utility in R3.13.
The device support routines obtain the record's input from the device or link specified in the INP field. 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. See [[RRM 3-14 Concepts#Address Specification|Address Specification]] for information on the format of hardware addresses. You can see a list of the device support modules currently supported at the user's local site by using the <CODE>dbst</CODE> utility in R3.13.


Two soft device support modules can be specified in DTYP--<CODE>Soft Channel</CODE> and <CODE>Raw Soft Channel</CODE>. <CODE>Raw Soft Channel</CODE> reads the value into RVAL, upon which the normal conversion process is undergone. <CODE>Soft Channel</CODE> reads any unsigned integer directly into VAL. For a soft mbbi record, the INP field can be a constant, a database, or a channel access link. If INP is a constant, then the VAL is initialized to the constant value but can be changed at run-time via dbPutField or dbPutLink. See [[RRM 3-13 Concepts#Address Specification|Address Specification]] for information on the format of database addresses.
Two soft device support modules can be specified in DTYP--<CODE>Soft Channel</CODE> and <CODE>Raw Soft Channel</CODE>. <CODE>Raw Soft Channel</CODE> reads the value into RVAL, upon which the normal conversion process is undergone. <CODE>Soft Channel</CODE> reads any unsigned integer directly into VAL. For a soft mbbi record, the INP field can be a constant, a database, or a channel access link. If INP is a constant, then the VAL is initialized to the constant value but can be changed at run-time via dbPutField or dbPutLink. See [[RRM 3-14 Concepts#Address Specification|Address Specification]] for information on the format of database addresses.
 
MASK is used by the raw soft channel read routine, and by typical device support read routines, to select only the desired bits when reading the hardware register.  It is initialized to ((1 << NOBT) - 1) by record initialization.  The user can configure the NOBT field, but the device support routines may set it, in which case the value given to it by the user is simply overridden.  The device support routines may also override MASK or shift it left by SHFT bits.  If MASK is non-zero, only the bits specified by MASK will appear in RVAL.


Unless the device support routine specifies no conversion, RVAL is used to determine VAL as follows:
Unless the device support routine specifies no conversion, RVAL is used to determine VAL as follows:
Line 47: Line 49:
<TH>Field<TH>Summary<TH>Type<TH>DCT<TH>Initial<TH>Access<TH>Modify<TH>Rec Proc Monitor<TH>PP<TR>
<TH>Field<TH>Summary<TH>Type<TH>DCT<TH>Initial<TH>Access<TH>Modify<TH>Rec Proc Monitor<TH>PP<TR>
<TD>VAL<TD>Value Field<TD>ENUM<TD>No<TD>0<TD>Yes<TD>Yes<TD>Yes<TD>Yes<TR>
<TD>VAL<TD>Value Field<TD>ENUM<TD>No<TD>0<TD>Yes<TD>Yes<TD>Yes<TD>Yes<TR>
<TD>INP<TD>Input Link<TD>INLINK<TD>Yes<TD>0<TD>No<TD>No<TD>N/A<TD>No<TR>
<TD>INP<TD>Input Link<TD>INLINK<TD>Yes<TD>0<TD>Yes<TD>Yes<TD>No<TD>No<TR>
<TD>MASK<TD>Mask<TD>ULONG<TD>No<TD>0<TD>Yes<TD>No<TD>No<TD>No<TR>
<TD>NOBT<TD>Number of Bits<TD>SHORT<TD>Yes<TD>0<TD>Yes<TD>No<TD>No<TD>No<TR>
<TD>RVAL<TD>Raw Data Value<TD>ULONG<TD>No<TD>0<TD>Yes<TD>Yes<TD>Yes<TD>Yes<TR>
<TD>RVAL<TD>Raw Data Value<TD>ULONG<TD>No<TD>0<TD>Yes<TD>Yes<TD>Yes<TD>Yes<TR>
<TD>SHFT<TD>Shift<TD>USHORT<TD>No<TD>0<TD>Yes<TD>No<TD>No<TD>No<TR>
<TD>SHFT<TD>Shift<TD>USHORT<TD>Yes<TD>0<TD>Yes<TD>Yes<TD>No<TD>No<TR>
<TD>ZRVL<TD>Zero Value<TD>ULONG<TD>Yes<TD>0<TD>Yes<TD>Yes<TD>No<TD>Yes<TR>
<TD>ZRVL<TD>Zero Value<TD>ULONG<TD>Yes<TD>0<TD>Yes<TD>Yes<TD>No<TD>Yes<TR>
<TD>ONVL<TD>One value<TD>ULONG<TD>Yes<TD>0<TD>Yes<TD>Yes<TD>No<TD>Yes<TR>
<TD>ONVL<TD>One value<TD>ULONG<TD>Yes<TD>0<TD>Yes<TD>Yes<TD>No<TD>Yes<TR>
Line 89: Line 93:
These parameters are used to present meaningful data to the operator. They display the value and other parameters of the mbbi record either textually or graphically. The ZRST-FFST fields contain strings describing one of the possible states of the record. The <CODE>get_enum_str</CODE> and <CODE>get_enum_strs</CODE> record routines retrieve these strings for the operator. <CODE>Get_enum_str</CODE> gets the string corresponding to the value set in VAL, and <CODE>get_enum_strs</CODE> retrieves all the strings.
These parameters are used to present meaningful data to the operator. They display the value and other parameters of the mbbi record either textually or graphically. The ZRST-FFST fields contain strings describing one of the possible states of the record. The <CODE>get_enum_str</CODE> and <CODE>get_enum_strs</CODE> record routines retrieve these strings for the operator. <CODE>Get_enum_str</CODE> gets the string corresponding to the value set in VAL, and <CODE>get_enum_strs</CODE> retrieves all the strings.


See [[RRM 3-13 dbCommon#Fields Common to All Record Types|Fields Common to All Record Types]] for more on the record name (NAME) and description (DESC) fields.
See [[RRM 3-14 dbCommon#Fields Common to All Record Types|Fields Common to All Record Types]] for more on the record name (NAME) and description (DESC) fields.




Line 95: Line 99:
<TH>Field<TH>Summary<TH>Type<TH>DCT<TH>Initial<TH>Access<TH>Modify<TH>Rec Proc Monitor<TH>PP<TR>
<TH>Field<TH>Summary<TH>Type<TH>DCT<TH>Initial<TH>Access<TH>Modify<TH>Rec Proc Monitor<TH>PP<TR>
<TD>ZRST,...,FFST<TD>Zero String, One String, ...<TD>STRING [16]<TD>Yes<TD>Null<TD>Yes<TD>Yes<TD>No<TD>Yes<TR>
<TD>ZRST,...,FFST<TD>Zero String, One String, ...<TD>STRING [16]<TD>Yes<TD>Null<TD>Yes<TD>Yes<TD>No<TD>Yes<TR>
<TD>HOPR<TD>High Operating Range<TD>FLOAT<TD>Yes<TD>0<TD>Yes<TD>Yes<TD>No<TD>No<TR>
<TD>NAME<TD>Record Name<TD>STRING [29]<TD>Yes<TD>0<TD>Yes<TD>No<TD>No<TD>&nbsp;<TR>
<TD>NAME<TD>Record Name<TD>STRING [29]<TD>Yes<TD>0<TD>Yes<TD>No<TD>No<TD>&nbsp;<TR>
<TD>DESC<TD>Description<TD>STRING [29]<TD>Yes<TD>Null<TD>Yes<TD>Yes<TD>No<TD>No
<TD>DESC<TD>Description<TD>STRING [29]<TD>Yes<TD>Null<TD>Yes<TD>Yes<TD>No<TD>No
</TABLE>
</TABLE>


=== Alarm Parameters ===
=== Alarm Parameters ===


The possible alarm conditions for multi-bit binary inputs are the SCAN, READ, and state alarms. The state alarms are configured in the below severity fields. These fields have the usual possible values for severity fields: NO ALARM, MINOR, and MAJOR.
The possible alarm conditions for multi-bit binary inputs are the SCAN, READ, and state alarms. The state alarms are configured in the below severity fields. These fields have the usual possible values for severity fields: NO_ALARM, MINOR, and MAJOR.


The unknown state severity (UNSV) field, if set to MINOR or MAJOR, triggers an alarm when the record support routine cannot find a matching value in the state value fields for <CODE>rval</CODE>.
The unknown state severity (UNSV) field, if set to MINOR or MAJOR, triggers an alarm when the record support routine cannot find a matching value in the state value fields for <CODE>rval</CODE>.
Line 109: Line 111:
The change of state severity (COSV) field triggers an alarm when any change of state occurs, if set to MAJOR or MINOR.
The change of state severity (COSV) field triggers an alarm when any change of state occurs, if set to MAJOR or MINOR.


The other fields, when set to MAJOR or MINOR, trigger an alarm when VAL equals the corresponding state. See the See [[RRM 3-13 Concepts#Alarm Specification|Alarm Specification]] for a complete explanation of discrete alarms and these fields. [[RRM 3-13 dbCommon#Alarm Fields|Alarm Fields]] lists other fields related to a alarms that are common to all record types.  
The other fields, when set to MAJOR or MINOR, trigger an alarm when VAL equals the corresponding state. See the See [[RRM 3-14 Concepts#Alarm Specification|Alarm Specification]] for a complete explanation of discrete alarms and these fields. [[RRM 3-14 dbCommon#Alarm Fields|Alarm Fields]] lists other fields related to a alarms that are common to all record types.  




<TABLE BORDER="1">
<TABLE BORDER="1">
<TH>Field<TH>Summary<TH>Type<TH>DCT<TH>Initial<TH>Access<TH>Modify<TH>Rec Proc Monitor<TH>PP<TR>
<TH>Field<TH>Summary<TH>Type<TH>DCT<TH>Initial<TH>Access<TH>Modify<TH>Rec Proc Monitor<TH>PP<TR>
<TD>UNSV<TD>Unknown State Severity<TD>[[RRM 3-13 Menu Choices|GBLCHOICE]]<TD>Yes<TD>0<TD>Yes<TD>Yes<TD>No<TD>Yes<TR>
<TD>UNSV<TD>Unknown State Severity<TD>[[RRM 3-14 Menu Choices|GBLCHOICE]]<TD>Yes<TD>0<TD>Yes<TD>Yes<TD>No<TD>Yes<TR>
<TD>COSV<TD>Change of State Severity<TD>[[RRM 3-13 Menu Choices|GBLCHOICE]]<TD>Yes<TD>0<TD>Yes<TD>Yes<TD>No<TD>Yes<TR>
<TD>COSV<TD>Change of State Severity<TD>[[RRM 3-14 Menu Choices|GBLCHOICE]]<TD>Yes<TD>0<TD>Yes<TD>Yes<TD>No<TD>Yes<TR>
<TD>ZRSV<TD>0 State Severity<TD>[[RRM 3-13 Menu Choices|GBLCHOICE]]<TD>Yes<TD>0<TD>Yes<TD>Yes<TD>No<TD>Yes<TR>
<TD>ZRSV<TD>0 State Severity<TD>[[RRM 3-14 Menu Choices|GBLCHOICE]]<TD>Yes<TD>0<TD>Yes<TD>Yes<TD>No<TD>Yes<TR>
<TD>ONSV<TD>1 State Severity<TD>[[RRM 3-13 Menu Choices|GBLCHOICE]]<TD>Yes<TD>0<TD>Yes<TD>Yes<TD>No<TD>Yes<TR>
<TD>ONSV<TD>1 State Severity<TD>[[RRM 3-14 Menu Choices|GBLCHOICE]]<TD>Yes<TD>0<TD>Yes<TD>Yes<TD>No<TD>Yes<TR>
<TD>TWSV<TD>2 State Severity<TD>[[RRM 3-13 Menu Choices|GBLCHOICE]]<TD>Yes<TD>0<TD>Yes<TD>Yes<TD>No<TD>Yes<TR>
<TD>TWSV<TD>2 State Severity<TD>[[RRM 3-14 Menu Choices|GBLCHOICE]]<TD>Yes<TD>0<TD>Yes<TD>Yes<TD>No<TD>Yes<TR>
<TD>THSV<TD>3 State Severity<TD>[[RRM 3-13 Menu Choices|GBLCHOICE]]<TD>Yes<TD>0<TD>Yes<TD>Yes<TD>No<TD>Yes<TR>
<TD>THSV<TD>3 State Severity<TD>[[RRM 3-14 Menu Choices|GBLCHOICE]]<TD>Yes<TD>0<TD>Yes<TD>Yes<TD>No<TD>Yes<TR>
<TD>FRSV<TD>4 State Severity<TD>[[RRM 3-13 Menu Choices|GBLCHOICE]]<TD>Yes<TD>0<TD>Yes<TD>Yes<TD>No<TD>Yes<TR>
<TD>FRSV<TD>4 State Severity<TD>[[RRM 3-14 Menu Choices|GBLCHOICE]]<TD>Yes<TD>0<TD>Yes<TD>Yes<TD>No<TD>Yes<TR>
<TD>FVSV<TD>5 State Severity<TD>[[RRM 3-13 Menu Choices|GBLCHOICE]]<TD>Yes<TD>0<TD>Yes<TD>Yes<TD>No<TD>Yes<TR>
<TD>FVSV<TD>5 State Severity<TD>[[RRM 3-14 Menu Choices|GBLCHOICE]]<TD>Yes<TD>0<TD>Yes<TD>Yes<TD>No<TD>Yes<TR>
<TD>SXSV<TD>6 State Severity<TD>[[RRM 3-13 Menu Choices|GBLCHOICE]]<TD>Yes<TD>0<TD>Yes<TD>Yes<TD>No<TD>Yes<TR>
<TD>SXSV<TD>6 State Severity<TD>[[RRM 3-14 Menu Choices|GBLCHOICE]]<TD>Yes<TD>0<TD>Yes<TD>Yes<TD>No<TD>Yes<TR>
<TD>SVSV<TD>7 State Severity<TD>[[RRM 3-13 Menu Choices|GBLCHOICE]]<TD>Yes<TD>0<TD>Yes<TD>Yes<TD>No<TD>Yes<TR>
<TD>SVSV<TD>7 State Severity<TD>[[RRM 3-14 Menu Choices|GBLCHOICE]]<TD>Yes<TD>0<TD>Yes<TD>Yes<TD>No<TD>Yes<TR>
<TD>EISV<TD>8 State Severity<TD>[[RRM 3-13 Menu Choices|GBLCHOICE]]<TD>Yes<TD>0<TD>Yes<TD>Yes<TD>No<TD>Yes<TR>
<TD>EISV<TD>8 State Severity<TD>[[RRM 3-14 Menu Choices|GBLCHOICE]]<TD>Yes<TD>0<TD>Yes<TD>Yes<TD>No<TD>Yes<TR>
<TD>NISV<TD>9 State Severity<TD>[[RRM 3-13 Menu Choices|GBLCHOICE]]<TD>Yes<TD>0<TD>Yes<TD>Yes<TD>No<TD>Yes<TR>
<TD>NISV<TD>9 State Severity<TD>[[RRM 3-14 Menu Choices|GBLCHOICE]]<TD>Yes<TD>0<TD>Yes<TD>Yes<TD>No<TD>Yes<TR>
<TD>TESV<TD>10 State Severity<TD>[[RRM 3-13 Menu Choices|GBLCHOICE]]<TD>Yes<TD>0<TD>Yes<TD>Yes<TD>No<TD>Yes<TR>
<TD>TESV<TD>10 State Severity<TD>[[RRM 3-14 Menu Choices|GBLCHOICE]]<TD>Yes<TD>0<TD>Yes<TD>Yes<TD>No<TD>Yes<TR>
<TD>ELSV<TD>11 State Severity<TD>[[RRM 3-13 Menu Choices|GBLCHOICE]]<TD>Yes<TD>0<TD>Yes<TD>Yes<TD>No<TD>Yes<TR>
<TD>ELSV<TD>11 State Severity<TD>[[RRM 3-14 Menu Choices|GBLCHOICE]]<TD>Yes<TD>0<TD>Yes<TD>Yes<TD>No<TD>Yes<TR>
<TD>TVSV<TD>12 State Severity<TD>[[RRM 3-13 Menu Choices|GBLCHOICE]]<TD>Yes<TD>0<TD>Yes<TD>Yes<TD>No<TD>Yes<TR>
<TD>TVSV<TD>12 State Severity<TD>[[RRM 3-14 Menu Choices|GBLCHOICE]]<TD>Yes<TD>0<TD>Yes<TD>Yes<TD>No<TD>Yes<TR>
<TD>TTSV<TD>13 State Severity<TD>[[RRM 3-13 Menu Choices|GBLCHOICE]]<TD>Yes<TD>0<TD>Yes<TD>Yes<TD>No<TD>Yes<TR>
<TD>TTSV<TD>13 State Severity<TD>[[RRM 3-14 Menu Choices|GBLCHOICE]]<TD>Yes<TD>0<TD>Yes<TD>Yes<TD>No<TD>Yes<TR>
<TD>FTSV<TD>14 State Severity<TD>[[RRM 3-13 Menu Choices|GBLCHOICE]]<TD>Yes<TD>0<TD>Yes<TD>Yes<TD>No<TD>Yes<TR>
<TD>FTSV<TD>14 State Severity<TD>[[RRM 3-14 Menu Choices|GBLCHOICE]]<TD>Yes<TD>0<TD>Yes<TD>Yes<TD>No<TD>Yes<TR>
<TD>FFSV<TD>15 State Severity<TD>[[RRM 3-13 Menu Choices|GBLCHOICE]]<TD>Yes<TD>0<TD>Yes<TD>Yes<TD>No<TD>Yes
<TD>FFSV<TD>15 State Severity<TD>[[RRM 3-14 Menu Choices|GBLCHOICE]]<TD>Yes<TD>0<TD>Yes<TD>Yes<TD>No<TD>Yes
</TABLE>
</TABLE>


 
=== Run-time Parameters ===
=== Run-time and Simulation Mode Parameters ===


These parameters are used by the run-time code for processing the multi-bit binary input.
These parameters are used by the run-time code for processing the multi-bit binary input.


MASK is used by device support routine to read the hardware register. It is shifted left NOBT bits by the record processing routine. The user can configure the NOBT field, but the device support routines may set it, in which case the value given to it by the user is simply overridden.
ORAW is used by record processing to hold the prior RVAL for use in determining when to post a monitor event for the RVAL field.


The LALM field implements the change of state alarm severity by holding the value of VAL when the previous change of state alarm was issued.
The LALM field implements the change of state alarm severity by holding the value of VAL when the previous change of state alarm was issued.
Line 150: Line 151:
<TABLE BORDER="1">
<TABLE BORDER="1">
<TH>Field<TH>Summary<TH>Type<TH>DCT<TH>Initial<TH>Access<TH>Modify<TH>Rec Proc Monitor<TH>PP<TR>
<TH>Field<TH>Summary<TH>Type<TH>DCT<TH>Initial<TH>Access<TH>Modify<TH>Rec Proc Monitor<TH>PP<TR>
<TD>SHFT<TD>Shift<TD>USHORT<TD>No<TD>0<TD>Yes<TD>No<TD>No<TD>No<TR>
<TD>ORAW<TD>Old Raw Data<TD>ULONG<TD>No<TD>0<TD>Yes<TD>No<TD>No<TD>No<TR>
<TD>ORAW<TD>Old Raw Data<TD>ULONG<TD>No<TD>0<TD>Yes<TD>No<TD>No<TD>No<TR>
<TD>NOBT<TD>Number of Bits<TD>SHORT<TD>Yes<TD>0<TD>Yes<TD>No<TD>No<TD>No<TR>
<TD>MASK<TD>Mask<TD>ULONG<TD>No<TD>0<TD>Yes<TD>No<TD>No<TD>No<TR>
<TD>LALM<TD>Last Alarmed<TD>USHORT<TD>No<TD>0<TD>Yes<TD>No<TD>No<TD>No<TR>
<TD>LALM<TD>Last Alarmed<TD>USHORT<TD>No<TD>0<TD>Yes<TD>No<TD>No<TD>No<TR>
<TD>MLST<TD>Monitor Last<TD>USHORT<TD>No<TD>0<TD>Yes<TD>No<TD>No<TD>No<TR>
<TD>MLST<TD>Monitor Last<TD>USHORT<TD>No<TD>0<TD>Yes<TD>No<TD>No<TD>No<TR>
Line 159: Line 157:
</TABLE>
</TABLE>


The following fields are used to operate the mbbi record in the simulation mode. See [[RRM 3-13 Common#Fields Common to Many Record Types|Fields Common to Many Record Types]] for more information on these fields.
=== Simulation Mode Parameters ===
 
The following fields are used to operate the mbbi record in the simulation mode. See [[RRM 3-14 Common#Fields Common to Many Record Types|Fields Common to Many Record Types]] for more information on these fields.




<TABLE BORDER="1">
<TABLE BORDER="1">
<TH>Field<TH>Summary<TH>Type<TH>DCT<TH>Initial<TH>Access<TH>Modify<TH>Rec Proc Monitor<TH>PP<TR>
<TH>Field<TH>Summary<TH>Type<TH>DCT<TH>Initial<TH>Access<TH>Modify<TH>Rec Proc Monitor<TH>PP<TR>
<TD>SIOL<TD>Simulation Value Location<TD>INLINK<TD>Yes<TD>0<TD>No<TD>No<TD>N/A<TD>No<TR>
<TD>SIOL<TD>Simulation Value Location<TD>INLINK<TD>Yes<TD>0<TD>Yes<TD>Yes<TD>No<TD>No<TR>
<TD>SVAL<TD>Simulation Value<TD>DOUBLE<TD>No<TD>0<TD>Yes<TD>Yes<TD>No<TD>No<TR>
<TD>SVAL<TD>Simulation Value<TD>DOUBLE<TD>No<TD>0<TD>Yes<TD>Yes<TD>No<TD>No<TR>
<TD>SIML<TD>Simulation Mode Location<TD>INLINK<TD>Yes<TD>0<TD>No<TD>No<TD>N/A<TD>No<TR>
<TD>SIML<TD>Simulation Mode Location<TD>INLINK<TD>Yes<TD>0<TD>Yes<TD>Yes<TD>No<TD>No<TR>
<TD>SIMM<TD>Simulation Mode<TD>[[RRM 3-13 Menu Choices|GBLCHOICE]]<TD>No<TD>0<TD>Yes<TD>Yes<TD>No<TD>No<TR>
<TD>SIMM<TD>Simulation Mode<TD>[[RRM 3-14 Menu Choices|GBLCHOICE]]<TD>No<TD>0<TD>Yes<TD>Yes<TD>No<TD>No<TR>
<TD>SIMS<TD>Simulation Mode Alarm Severity<TD>[[RRM 3-13 Menu Choices|GBLCHOICE]]<TD>Yes<TD>0<TD>Yes<TD>Yes<TD>No<TD>No
<TD>SIMS<TD>Simulation Mode Alarm Severity<TD>[[RRM 3-14 Menu Choices|GBLCHOICE]]<TD>Yes<TD>0<TD>Yes<TD>Yes<TD>No<TD>No
</TABLE>
</TABLE>


Line 218: Line 218:


# 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.
# 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 [[RRM 3-13 Common#Input Records|Input Records]] for more information.
# readValue is called. See [[RRM 3-14 Common#Input Records|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.
# 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.
# Convert:
# Convert:
Line 257: Line 257:
<TABLE BORDER="1">
<TABLE BORDER="1">
<TH>Name<TH>Summary<TH>Description<TR>
<TH>Name<TH>Summary<TH>Description<TR>
<TD>PACT<TD>Processing Active<TD rowspan=5>See [[RRM 3-13 dbCommon#Fields Common to All Record Types|Fields Common to All Record Types]] for an explanation of these fields.<TR>
<TD>PACT<TD>Processing Active<TD rowspan=5>See [[RRM 3-14 dbCommon#Fields Common to All Record Types|Fields Common to All Record Types]] for an explanation of these fields.<TR>
<TD>DPVT<TD>Device Private<TR>
<TD>DPVT<TD>Device Private<TR>
<TD>UDF<TD>VAL Undefined<TR>
<TD>UDF<TD>VAL Undefined<TR>
Line 320: Line 320:
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.
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_mbbi calls recGblGetLinkValue to read the current value of VAL. See [[RRM 3-13 Common#Soft Input|Soft Input]].
read_mbbi calls recGblGetLinkValue to read the current value of VAL. See [[RRM 3-14 Common#Soft Input|Soft Input]].


If the return status of recGblGetLinkValue is zero, then read_mbbi sets UDF to FALSE. The status of recGblGetLinkValue is returned.
If the return status of recGblGetLinkValue is zero, then read_mbbi sets UDF to FALSE. The status of recGblGetLinkValue is returned.

Latest revision as of 22:51, 27 February 2017

EPICS Record Reference Manual


mbbi -- Multi-Bit Binary Input

The normal use for the multi-bit binary input record is to read contiguous, multiple bit inputs from hardware. The binary value represents a state from a range of up to 16 states. The multi-bit input record interfaces with devices that use more than one bit.

Most device support modules obtain values from hardware and place the value in RVAL. For these device support modules record processing uses RVAL to determine the current state (VAL is given a value between 0 and 15). Device support modules may optionally read a value directly into VAL.

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 allows VAL to be an arbitrary unsigned short integer. Raw Soft Channel reads the value into RVAL just like normal device support modules.

Parameter Fields

The multi-bit binary input fields fall into the following categories:

  • scan parameters
  • read and convert parameters
  • operator display parameters
  • alarm parameters
  • run-time and simulation mode parameters


Scan parameters

The multi-bit binary input record has the standard fields for specifying under what circumstances it 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 and Convert Parameters

The device support routines obtain the record's input from the device or link specified in the INP field. 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. See Address Specification for information on the format of hardware addresses. 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.

Two soft device support modules can be specified in DTYP--Soft Channel and Raw Soft Channel. Raw Soft Channel reads the value into RVAL, upon which the normal conversion process is undergone. Soft Channel reads any unsigned integer directly into VAL. For a soft mbbi record, the INP field can be a constant, a database, or a channel access link. If INP is a constant, then the VAL is initialized to the constant value but can be changed at run-time via dbPutField or dbPutLink. See Address Specification for information on the format of database addresses.

MASK is used by the raw soft channel read routine, and by typical device support read routines, to select only the desired bits when reading the hardware register. It is initialized to ((1 << NOBT) - 1) by record initialization. The user can configure the NOBT field, but the device support routines may set it, in which case the value given to it by the user is simply overridden. The device support routines may also override MASK or shift it left by SHFT bits. If MASK is non-zero, only the bits specified by MASK will appear in RVAL.

Unless the device support routine specifies no conversion, RVAL is used to determine VAL as follows:

  1. RVAL is assigned to a temporary variable -- rval = RVAL
  2. rval is shifted right SHFT number of bits.
  3. A match is sought between rval and one of the state value fields, ZRVL-FFVL.

Each of the fields, ZRVL-FFVL, represents one of the possible sixteen states (not all sixteen have to be used).

Alternatively, the input value can be read as a string, in which case, a match is sought with one of the strings specified in the ZRST-FFST fields. Then RVAL is set equal to the corresponding value for that string, and the conversion process occurs.


FieldSummaryTypeDCTInitialAccessModifyRec Proc MonitorPP
VALValue FieldENUMNo0YesYesYesYes
INPInput LinkINLINKYes0YesYesNoNo
MASKMaskULONGNo0YesNoNoNo
NOBTNumber of BitsSHORTYes0YesNoNoNo
RVALRaw Data ValueULONGNo0YesYesYesYes
SHFTShiftUSHORTYes0YesYesNoNo
ZRVLZero ValueULONGYes0YesYesNoYes
ONVLOne valueULONGYes0YesYesNoYes
TWVLTwo ValueULONGYes0YesYesNoYes
THVLThree ValueULONGYes0YesYesNoYes
FRVLFour ValueULONGYes0YesYesNoYes
FVVLFive ValueULONGYes0YesYesNoYes
SXVLSix ValueULONGYes0YesYesNoYes
SVVLSeven ValueULONGYes0YesYesNoYes
EIVLEight valueULONGYes0YesYesNoYes
NIVLNine ValueULONGYes0YesYesNoYes
TEVLTen ValueULONGYes0YesYesNoYes
ELVLEleven ValueULONGYes0YesYesNoYes
TVVLTwelve ValueULONGYes0YesYesNoYes
TTVLThirteen ValueULONGYes0YesYesNoYes
FTVLFourteen ValueULONGYes0YesYesNoYes
FFVLFifteen ValueULONGYes0YesYesNoYes
ZRSTZero StringSTRING [16]YesNullYesYesNoYes
ONSTOne StringSTRING [16]YesNullYesYesNoYes
TWSTTwo StringSTRING [16]YesNullYesYesNoYes
THSTThree StringSTRING [16]YesNullYesYesNoYes
FRSTFour StringSTRING [16]YesNullYesYesNoYes
FVSTFive StringSTRING [16]YesNullYesYesNoYes
SXSTSix StringSTRING [16]YesNullYesYesNoYes
SVSTSeven StringSTRING [16]YesNullYesYesNoYes
EISTEight StringSTRING [16]YesNullYesYesNoYes
NISTNine StringSTRING [16]YesNullYesYesNoYes
TESTTen StringSTRING [16]YesNullYesYesNoYes
ELSTEleven StringSTRING [16]YesNullYesYesNoYes
TVSTTwelve StringSTRING [16]YesNullYesYesNoYes
TTSTThirteen StringSTRING [16]YesNullYesYesNoYes
FTSTFourteen StringSTRING [16]YesNullYesYesNoYes
FFSTFifteen StringSTRING [16]YesNullYesYesNoYes


Operator Display Parameters

These parameters are used to present meaningful data to the operator. They display the value and other parameters of the mbbi record either textually or graphically. The ZRST-FFST fields contain strings describing one of the possible states of the record. The get_enum_str and get_enum_strs record routines retrieve these strings for the operator. Get_enum_str gets the string corresponding to the value set in VAL, and get_enum_strs retrieves all the strings.

See Fields Common to All Record Types for more on the record name (NAME) and description (DESC) fields.


FieldSummaryTypeDCTInitialAccessModifyRec Proc MonitorPP
ZRST,...,FFSTZero String, One String, ...STRING [16]YesNullYesYesNoYes
NAMERecord NameSTRING [29]Yes0YesNoNo 
DESCDescriptionSTRING [29]YesNullYesYesNoNo

Alarm Parameters

The possible alarm conditions for multi-bit binary inputs are the SCAN, READ, and state alarms. The state alarms are configured in the below severity fields. These fields have the usual possible values for severity fields: NO_ALARM, MINOR, and MAJOR.

The unknown state severity (UNSV) field, if set to MINOR or MAJOR, triggers an alarm when the record support routine cannot find a matching value in the state value fields for rval.

The change of state severity (COSV) field triggers an alarm when any change of state occurs, if set to MAJOR or MINOR.

The other fields, when set to MAJOR or MINOR, trigger an alarm when VAL equals the corresponding state. See the See Alarm Specification for a complete explanation of discrete alarms and these fields. Alarm Fields lists other fields related to a alarms that are common to all record types.


FieldSummaryTypeDCTInitialAccessModifyRec Proc MonitorPP
UNSVUnknown State SeverityGBLCHOICEYes0YesYesNoYes
COSVChange of State SeverityGBLCHOICEYes0YesYesNoYes
ZRSV0 State SeverityGBLCHOICEYes0YesYesNoYes
ONSV1 State SeverityGBLCHOICEYes0YesYesNoYes
TWSV2 State SeverityGBLCHOICEYes0YesYesNoYes
THSV3 State SeverityGBLCHOICEYes0YesYesNoYes
FRSV4 State SeverityGBLCHOICEYes0YesYesNoYes
FVSV5 State SeverityGBLCHOICEYes0YesYesNoYes
SXSV6 State SeverityGBLCHOICEYes0YesYesNoYes
SVSV7 State SeverityGBLCHOICEYes0YesYesNoYes
EISV8 State SeverityGBLCHOICEYes0YesYesNoYes
NISV9 State SeverityGBLCHOICEYes0YesYesNoYes
TESV10 State SeverityGBLCHOICEYes0YesYesNoYes
ELSV11 State SeverityGBLCHOICEYes0YesYesNoYes
TVSV12 State SeverityGBLCHOICEYes0YesYesNoYes
TTSV13 State SeverityGBLCHOICEYes0YesYesNoYes
FTSV14 State SeverityGBLCHOICEYes0YesYesNoYes
FFSV15 State SeverityGBLCHOICEYes0YesYesNoYes

Run-time Parameters

These parameters are used by the run-time code for processing the multi-bit binary input.

ORAW is used by record processing to hold the prior RVAL for use in determining when to post a monitor event for the RVAL field.

The LALM field implements the change of state alarm severity by holding the value of VAL when the previous change of state alarm was issued.

MLST holds the value when the last monitor for value change was triggered.

SDEF is used by record support to save time if no states are defined.


FieldSummaryTypeDCTInitialAccessModifyRec Proc MonitorPP
ORAWOld Raw DataULONGNo0YesNoNoNo
LALMLast AlarmedUSHORTNo0YesNoNoNo
MLSTMonitor LastUSHORTNo0YesNoNoNo
SDEFStates Defined?SHORTNo0YesNoNoNo

Simulation Mode Parameters

The following fields are used to operate the mbbi record in the simulation mode. See Fields Common to Many Record Types for more information on these fields.


FieldSummaryTypeDCTInitialAccessModifyRec Proc MonitorPP
SIOLSimulation Value LocationINLINKYes0YesYesNoNo
SVALSimulation ValueDOUBLENo0YesYesNoNo
SIMLSimulation Mode LocationINLINKYes0YesYesNoNo
SIMMSimulation ModeGBLCHOICENo0YesYesNoNo
SIMSSimulation Mode Alarm SeverityGBLCHOICEYes0YesYesNoNo


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.

Clears MASK and then sets the NOBT low order bits.

If device support includes init_record, it is called.

init_common is then called to determine if any states are defined. If states are defined, SDEF is set to TRUE.

process

See next section.

special

Calls init_common to compute SDEF when any of the fields ZRVL, ... FFVL change value.

get_value

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

get_enum_str

Retrieves ASCII string corresponding to VAL.

get_enum_strs

Retrieves ASCII strings for ZRST,...FFST.

put_enum_str

Checks if string matches ZRST,...FFST and if it does, sets VAL.


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 Input Records for more information.
  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. Convert:
    • status=read_mbbi
    • PACT = TRUE
    • TIME = tsLocalTime
    • If status is 0, then determine VAL
      • Set rval = RVAL
      • Shift rval right SHFT bits
    • If at least one state value is defined
      • Set UDF to TRUE
    • If RVAL is ZRVL,...,FFVL then set
      • VAL equals index of state
      • UDF set to FALSE
    • Else set VAL = undefined
      • Else set VAL = RVAL
    • Set UDF to FALSE
      • If status is 1, return(0)
    • If status is 2, set status = 0
  5. 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.
  6. 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 MLST is not equal to VAL.
    • Monitors for RVAL are checked whenever other monitors are invoked.
    • NSEV and NSTA are reset to 0.
  7. Scan forward link if necessary, set PACT FALSE, and return.


Device Support

Fields Of Interest To Device Support

Each input record must have an associated set of device support routines.

The primary responsibility of the device support routines is to obtain a new raw input value whenever read_mbbi is called. The device support routines are primarily interested in the following fields:


NameSummaryDescription
PACTProcessing ActiveSee Fields Common to All Record Types for an explanation of these fields.
DPVTDevice Private
UDFVAL Undefined
NSEVNew Alarm Severity
NSTANew Alarm Status
NOBTNumber of BitsNumber of hardware bits accessed. They must be consecutive.
VALValue FieldThis field is set by the device support routines if they don't want record support to set it.
INPInput LinkThis field is used by the device support routines to locate its input.
RVALRaw Data ValueIt is the responsibility of the device support routine to give this field a value.
MASKMaskThis is a mask used to read the hardware. Record support sets the low order NOBT bits. The device support routine can shift the bits. The device support routine should perform the shift in init_record.
SHFTShiftThis can be set by the device support module at init_record time.


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. If it uses MASK, it should shift it as necessary and also give SHFT a value.

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 I/O Event scanner.

read_mbbi

read_mbbi(precord)

This routine must provide a new input value. It returns the following values:

  • 0: Success. A new raw value is placed in RVAL. The record support module determines VAL from RVAL, SHFT, and ZEVL ... FFVL.
  • 2: Success, but don't modify VAL.
  • Other: Error.


Device Support For Soft Records

Two soft device support modules Soft Channel and Raw Soft Channel are provided for multi-bit binary input records not related to actual hardware devices. The INP link type must be either CONSTANT, DB_LINK, or CA_LINK.

Soft Channel

read_mbbi always returns a value of 2, which means that no conversion is performed.

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_mbbi calls recGblGetLinkValue to read the current value of VAL. See Soft Input.

If the return status of recGblGetLinkValue is zero, then read_mbbi sets UDF to FALSE. The status of recGblGetLinkValue is returned.


Raw Soft Channel

This module is like the previous except that values are read into RVAL, VAL is computed from RVAL, and read_mbbi returns a value of 0. Thus the record processing routine will determine VAL in the normal way.




EPICS Record Reference Manual - 19 MAY 1998