Difference between revisions of "RRM 3-14 String Input"

From EPICSWIKI
 
(Link fields are modifyable)
 
(One intermediate revision by one other user not shown)
Line 17: Line 17:
=== Scan Parameters ===
=== Scan Parameters ===


The string 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.
The string 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.


=== Read Parameters ===
=== Read Parameters ===
Line 23: Line 23:
The INP field determines where the string input record gets its string. It can be a database or channel access link, or a constant. If constant, the VAL field is initialized with the constant and can be changed via dbPuts. Otherwise, the string is read from the specified location each time the record is processed and placed in the VAL field. The maximum number of characters that the string in VAL can be is 40. In addition, the appropriate device support module must be entered into the DTYP field.
The INP field determines where the string input record gets its string. It can be a database or channel access link, or a constant. If constant, the VAL field is initialized with the constant and can be changed via dbPuts. Otherwise, the string is read from the specified location each time the record is processed and placed in the VAL field. The maximum number of characters that the string in VAL can be is 40. In addition, the appropriate device support module must be entered into the DTYP field.


See [[RRM 3-13 Concepts#Address Specification|Address Specification]] for information on specifying links. The user can see a list of the device support modules currently supported at the user's local site by using the <CODE>dbst</CODE> utility (R3.13).
See [[RRM 3-14 Concepts#Address Specification|Address Specification]] for information on specifying links. The user can see a list of the device support modules currently supported at the user's local site by using the <CODE>dbst</CODE> utility (R3.13).




Line 29: Line 29:
<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<TD>STRING [40]<TD>Yes<TD>Null<TD>Yes<TD>Yes<TD>Yes<TD>Yes<TR>
<TD>VAL<TD>Value<TD>STRING [40]<TD>Yes<TD>Null<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>DTYP<TD>Device Type<TD>DEVCHOICE<TD>Yes<TD>0<TD>Yes<TD>No<TD>No<TD>No
<TD>DTYP<TD>Device Type<TD>DEVCHOICE<TD>Yes<TD>0<TD>Yes<TD>No<TD>No<TD>No
</TABLE>
</TABLE>
Line 36: Line 36:
=== Operator Display Parameters ===
=== Operator Display Parameters ===


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 48: Line 48:
=== Alarm Parameters ===
=== Alarm Parameters ===


The string input record has the alarm parameters common to all record types. [[RRM 3-13 dbCommon#Alarm Fields|Alarm Fields]] lists other fields related to a alarms that are common to all record types.
The string input record has the alarm parameters common to all record types. [[RRM 3-14 dbCommon#Alarm Fields|Alarm Fields]] lists other fields related to a alarms that are common to all record types.


=== Run-time and Simulation Mode Parameters ===
=== Run-time and Simulation Mode Parameters ===
Line 61: Line 61:




The following fields are used to operate the string input in the simulation mode. See [[RRM 3-13 Common#Simulation Mode|Simulation Mode]] for more information on simulation mode fields.
The following fields are used to operate the string input in the simulation mode. See [[RRM 3-14 Common#Simulation Mode|Simulation Mode]] for more information on simulation mode 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>STRING [40]<TD>No<TD>Null<TD>Yes<TD>Yes<TD>No<TD>Yes<TR>
<TD>SVAL<TD>Simulation Value<TD>STRING [40]<TD>No<TD>Null<TD>Yes<TD>Yes<TD>No<TD>Yes<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 102: Line 102:


# 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#Simulation Mode|Simulation Mode]] for more information on simulation mode fields and how they affect input.
# readValue is called. See [[RRM 3-14 Common#Simulation Mode|Simulation Mode]] for more information on simulation mode fields and how they affect input.
# 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.
# TIME is set to tslocaltime
# TIME is set to tslocaltime
Line 121: Line 121:
<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=3>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=3>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 170: Line 170:
If the INP link type is constant, the double constant, if non-zero, is converted to a string and 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.
If the INP link type is constant, the double constant, if non-zero, is converted to a string and 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_stringin calls recGblGetLinkValue to read the current value of VAL. See [[RRM 3-13 Common#Soft Input|Soft Input]].
read_stringin 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_stringin sets UDF to FALSE. The status of recGblGetLinkValue is returned.
If the return status of recGblGetLinkValue is zero, then read_stringin sets UDF to FALSE. The status of recGblGetLinkValue is returned.

Latest revision as of 19:41, 22 March 2016

EPICS Record Reference Manual


stringin - String Input

The string input record retrieves an arbitrary ASCII string of up to 40 characters. Several device support routines are available, all of which are soft device support for retrieving values from other records or other software components.

Parameter Fields

The fields fall into the following categories.

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

Scan Parameters

The string 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.

Read Parameters

The INP field determines where the string input record gets its string. It can be a database or channel access link, or a constant. If constant, the VAL field is initialized with the constant and can be changed via dbPuts. Otherwise, the string is read from the specified location each time the record is processed and placed in the VAL field. The maximum number of characters that the string in VAL can be is 40. In addition, the appropriate device support module must be entered into the DTYP field.

See Address Specification for information on specifying links. The user can see a list of the device support modules currently supported at the user's local site by using the dbst utility (R3.13).


FieldSummaryTypeDCTInitialAccessModifyRec Proc MonitorPP
VALValueSTRING [40]YesNullYesYesYesYes
INPInput LinkINLINKYes0YesYesNoNo
DTYPDevice TypeDEVCHOICEYes0YesNoNoNo


Operator Display Parameters

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


FieldSummaryTypeDCTInitialAccessModifyRec Proc MonitorPP
NAMERecord NameSTRING [29]Yes0YesNoNoNo
DESCDescriptionSTRING [29]YesNullYesYesNoNo


Alarm Parameters

The string input record has the alarm parameters common to all record types. Alarm Fields lists other fields related to a alarms that are common to all record types.

Run-time and Simulation Mode Parameters

The old value field (OVAL) of the string input is used to implement value change monitors for VAL. If VAL is not equal to OVAL, then monitors are triggered.


FieldSummaryTypeDCTInitialAccessModifyRec Proc MonitorPP
OVALOutput ValueSTRINGNoNullYesNoNoNo


The following fields are used to operate the string input in the simulation mode. See Simulation Mode for more information on simulation mode fields.


FieldSummaryTypeDCTInitialAccessModifyRec Proc MonitorPP
SIOLSimulation Value LocationINLINKYes0YesYesNoNo
SVALSimulation ValueSTRING [40]NoNullYesYesNoYes
SIMLSimulation Mode LocationINLINKYes0YesYesNoNo
SIMMSimulation ModeGBLCHOICENo0YesYesNoNo
SIMSSimulation Mode Alarm SeverityGBLCHOICEYes0YesYesNoNo


Record Support

Record Support Routines

Three record support routines are provided: init_record, process, and get_value.

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


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 Simulation Mode for more information on simulation mode fields and how they affect input.
  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. TIME is set to tslocaltime
  5. 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 OVAL is not equal to VAL.
    • NSEV and NSTA are reset to 0.
  6. Scan forward link if necessary, set PACT FALSE, and return.


Device Support

Fields Of Interest To Device Support

Each stringin input record must have an associated set of device support routines. The primary responsibility of the device support routines is to obtain a new ASCII string value whenever read_stringin 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
VALValueThis field is set by the device support routines.
INPInput 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()

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_stringin

read_stringin(precord)

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

  • 0: Success. A new ASCII string is stored into VAL.
  • Other: Error.

Device Support For Soft Records

The Soft Channel module places a value directly in VAL.

If the INP link type is constant, the double constant, if non-zero, is converted to a string and 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_stringin calls recGblGetLinkValue to read the current value of VAL. See Soft Input.

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




EPICS Record Reference Manual - 19 MAY 1998