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

From EPICSWIKI
 
Line 18: Line 18:
=== Scan Parameters ===
=== Scan Parameters ===


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


=== Desired Output Parameters ===
=== Desired Output Parameters ===
Line 24: Line 24:
The string output record must specify from where it gets its desired output string. The first field that determines where the desired output originates is the output mode select (OSML) field, which can have two possible value: <CODE>closed_loop</CODE> or <CODE>supervisory</CODE>. If <CODE>supervisory</CODE> is specified, DOL is ignored, the current value of VAL is written, and the VAL can be changed externally via dbPuts at run-time. If <CODE>closed_loop</CODE> is specified, the VAL field's value is obtained from the address specified in the desired output location field (DOL) which can be either a database link or a channel access link.
The string output record must specify from where it gets its desired output string. The first field that determines where the desired output originates is the output mode select (OSML) field, which can have two possible value: <CODE>closed_loop</CODE> or <CODE>supervisory</CODE>. If <CODE>supervisory</CODE> is specified, DOL is ignored, the current value of VAL is written, and the VAL can be changed externally via dbPuts at run-time. If <CODE>closed_loop</CODE> is specified, the VAL field's value is obtained from the address specified in the desired output location field (DOL) which can be either a database link or a channel access link.


DOL can also be a constant in addition to a link, in which case VAL is initialized to the constant value. Note that if DOL is a constant, OMSL cannot be <CODE>closed_loop.</CODE> See [[RRM 3-13 Concepts#Address Specification|Address Specification]] for information on specifying links.
DOL can also be a constant in addition to a link, in which case VAL is initialized to the constant value. Note that if DOL is a constant, OMSL cannot be <CODE>closed_loop.</CODE> See [[RRM 3-14 Concepts#Address Specification|Address Specification]] for information on specifying links.




Line 31: Line 31:
<TD>VAL<TD> Value Field <TD>STRING [40]<TD>Yes<TD>Null<TD>Yes<TD>Yes<TD>Yes<TD>Yes<TR>
<TD>VAL<TD> Value Field <TD>STRING [40]<TD>Yes<TD>Null<TD>Yes<TD>Yes<TD>Yes<TD>Yes<TR>
<TD>DOL <TD>Desired Output Location (Input Link) <TD>INLINK<TD>Yes<TD>0<TD>No<TD>No<TD>N/A<TD>No<TR>
<TD>DOL <TD>Desired Output Location (Input Link) <TD>INLINK<TD>Yes<TD>0<TD>No<TD>No<TD>N/A<TD>No<TR>
<TD>OMSL<TD>Output Mode Select <TD>[[RRM 3-13 Menu Choices|GBLCHOICE]]<TD>Yes<TD>0<TD>Yes<TD>Yes<TD>No<TD>No
<TD>OMSL<TD>Output Mode Select <TD>[[RRM 3-14 Menu Choices|GBLCHOICE]]<TD>Yes<TD>0<TD>Yes<TD>Yes<TD>No<TD>No
</TABLE>
</TABLE>


Line 37: Line 37:
=== Write Parameters ===
=== Write Parameters ===


The output link specified in the OUT field specifies where the string output record is to write its string. The link can be a database or channel access link. If the OUT field is a constant, no output will be written. See [[RRM 3-13 Concepts#Address Specification|Address Specification]] for information on specifying links.
The output link specified in the OUT field specifies where the string output record is to write its string. The link can be a database or channel access link. If the OUT field is a constant, no output will be written. See [[RRM 3-14 Concepts#Address Specification|Address Specification]] for information on specifying links.


In addition, the appropriate device support module must be entered into the DTYP field. All string output records must specify a device support module. 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).
In addition, the appropriate device support module must be entered into the DTYP field. All string output records must specify a device support module. 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 53: Line 53:
These parameters are used to present meaningful data to the operator. These fields are used to display the value and other parameters of the string output either textually or graphically.
These parameters are used to present meaningful data to the operator. These fields are used to display the value and other parameters of the string output either textually or graphically.


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.  


<TABLE BORDER="1">
<TABLE BORDER="1">
Line 66: Line 66:
The possible alarm conditions for the string output record are the SCAN, READ, and INVALID alarms. The severity of the first two is always MAJOR and not configurable.
The possible alarm conditions for the string output record are the SCAN, READ, and INVALID alarms. The severity of the first two is always MAJOR and not configurable.


The IVOA field specifies an action to take when the INVALID alarm is triggered. There are three possible actions: <CODE>Continue normally</CODE>, <CODE>Don't drive outputs</CODE>, and <CODE>Set output to IVOV</CODE>. When <CODE>Set output to IVOV</CODE>, the value contained in the IVOV field is written to the output link during an alarm condition. See [[RRM 3-13 Common#Invalid Alarm Output Action|Invalid Alarm Output Action]] for more information on the IVOA and IVOV fields. [[RRM 3-13 dbCommon#Alarm Fields|Alarm Fields]] lists other fields related to a alarms that are common to all record types.
The IVOA field specifies an action to take when the INVALID alarm is triggered. There are three possible actions: <CODE>Continue normally</CODE>, <CODE>Don't drive outputs</CODE>, and <CODE>Set output to IVOV</CODE>. When <CODE>Set output to IVOV</CODE>, the value contained in the IVOV field is written to the output link during an alarm condition. See [[RRM 3-14 Common#Invalid Alarm Output Action|Invalid Alarm Output Action]] for more information on the IVOA and IVOV 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>IVOA<TD>Invalid Alarm Output Action<TD>[[RRM 3-13 Menu Choices|GBLCHOICE]]<TD>Yes<TD>0<TD>Yes<TD>Yes<TD>No<TD>No<TR>
<TD>IVOA<TD>Invalid Alarm Output Action<TD>[[RRM 3-14 Menu Choices|GBLCHOICE]]<TD>Yes<TD>0<TD>Yes<TD>Yes<TD>No<TD>No<TR>
<TD>IVOV<TD>Invalid Alarm Output Value, in eng. units<TD>DOUBLE<TD>Yes<TD>0<TD>Yes<TD>Yes<TD>No<TD>No
<TD>IVOV<TD>Invalid Alarm Output Value, in eng. units<TD>DOUBLE<TD>Yes<TD>0<TD>Yes<TD>Yes<TD>No<TD>No
</TABLE>
</TABLE>
Line 87: Line 87:




The following fields are used to operate the string output in the simulation mode. See [[RRM 3-13 Common#Simulation Mode|Simulation Mode]] for more information on these fields.
The following fields are used to operate the string output in the simulation mode. See [[RRM 3-14 Common#Simulation Mode|Simulation Mode]] for more information on these fields.




Line 95: Line 95:
<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>No<TD>No<TD>N/A<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 130: Line 130:


# 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.
# If PACT is FALSE and OMSL is CLOSED_LOOP, recGblGetLinkValue is called to read the current value of VAL. See [[RRM 3-13 Common#Soft Output|Soft Output]]. If the return status of recGblGetLinkValue is zero then UDF is set to FALSE.
# If PACT is FALSE and OMSL is CLOSED_LOOP, recGblGetLinkValue is called to read the current value of VAL. See [[RRM 3-14 Common#Soft Output|Soft Output]]. If the return status of recGblGetLinkValue is zero then UDF is set to FALSE.
# Check severity and write the new value. See [[RRM 3-13 Common#Simulation Mode|Simulation Mode]] and [[RRM 3-13 Common#Invalid Alarm Output Action|Invalid Alarm Output Action]] for details on how the simulation mode and the INVALID alarm conditions affect output.
# Check severity and write the new value. See [[RRM 3-14 Common#Simulation Mode|Simulation Mode]] and [[RRM 3-14 Common#Invalid Alarm Output Action|Invalid Alarm Output Action]] for details on how the simulation mode and the INVALID alarm conditions affect output.
# If PACT has been changed to TRUE, the device support write output routine has started but has not completed writing the new value. In this case, the processing routine merely returns, leaving PACT TRUE.
# If PACT has been changed to TRUE, the device support write output routine has started but has not completed writing the new value. In this case, the processing routine merely returns, leaving PACT TRUE.
# Check to see if monitors should be invoked.
# Check to see if monitors should be invoked.
Line 149: Line 149:
<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 Field<TD rowspan=4>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 Field<TD rowspan=4>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>NSEV<TD>New Alarm Severity<TR>
<TD>NSEV<TD>New Alarm Severity<TR>
Line 201: Line 201:
If the OUT link type is PV_LINK, then dbCaAddInlink is called by init_record.
If the OUT link type is PV_LINK, then dbCaAddInlink is called by init_record.


write_so calls recGblPutLinkValue to write the current value of VAL. See [[RRM 3-13 Common#Soft Output|Soft Output]].
write_so calls recGblPutLinkValue to write the current value of VAL. See [[RRM 3-14 Common#Soft Output|Soft Output]].





Revision as of 20:02, 18 April 2008

EPICS Record Reference Manual


stringout -- String Output

The stringout record is used to write an arbitrary ASCII string of up to 40 characters to other records or software variables.

Parameter Fields

The fields fall into the following categories:

  • scan parameters
  • desired output parameters
  • write parameters
  • operator display parameters
  • run-time parameters

Scan Parameters

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

Desired Output Parameters

The string output record must specify from where it gets its desired output string. The first field that determines where the desired output originates is the output mode select (OSML) field, which can have two possible value: closed_loop or supervisory. If supervisory is specified, DOL is ignored, the current value of VAL is written, and the VAL can be changed externally via dbPuts at run-time. If closed_loop is specified, the VAL field's value is obtained from the address specified in the desired output location field (DOL) which can be either a database link or a channel access link.

DOL can also be a constant in addition to a link, in which case VAL is initialized to the constant value. Note that if DOL is a constant, OMSL cannot be closed_loop. See Address Specification for information on specifying links.


FieldSummaryTypeDCTInitialAccessModifyRec Proc MonitorPP
VAL Value Field STRING [40]YesNullYesYesYesYes
DOL Desired Output Location (Input Link) INLINKYes0NoNoN/ANo
OMSLOutput Mode Select GBLCHOICEYes0YesYesNoNo


Write Parameters

The output link specified in the OUT field specifies where the string output record is to write its string. The link can be a database or channel access link. If the OUT field is a constant, no output will be written. See Address Specification for information on specifying links.

In addition, the appropriate device support module must be entered into the DTYP field. All string output records must specify a device support module. 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
OUTOutput Link OUTLINKYes0NoNoN/ANo
DTYPDevice TypeDEVCHOICEYes0YesNoNoNo


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 string output either textually or graphically.

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 possible alarm conditions for the string output record are the SCAN, READ, and INVALID alarms. The severity of the first two is always MAJOR and not configurable.

The IVOA field specifies an action to take when the INVALID alarm is triggered. There are three possible actions: Continue normally, Don't drive outputs, and Set output to IVOV. When Set output to IVOV, the value contained in the IVOV field is written to the output link during an alarm condition. See Invalid Alarm Output Action for more information on the IVOA and IVOV fields. Alarm Fields lists other fields related to a alarms that are common to all record types.


FieldSummaryTypeDCTInitialAccessModifyRec Proc MonitorPP
IVOAInvalid Alarm Output ActionGBLCHOICEYes0YesYesNoNo
IVOVInvalid Alarm Output Value, in eng. unitsDOUBLEYes0YesYesNoNo


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 ValueSTRING [40]NoNullYesNoNoNo


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


FieldSummaryTypeDCTInitialAccessModifyRec Proc MonitorPP
SIOLSimulation Value LocationINLINKYes0NoNoN/ANo
SVALSimulation ValueSTRING [40]NoNullYesYesNoYes
SIMLSimulation Mode LocationINLINKYes0NoNoN/ANo
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 if SIML is a constant or creates a channel access link if SIML is PV_LINK. If SIOL is PV_LINK a channel access link is created.

This routine next checks to see that device support is available. The routine next checks to see if the device support write routine is defined. If either device support or the device support write routine does not exist, an error message is issued and processing is terminated.

If DOL is a constant, then the type double constant, if non-zero, is converted to a string and stored into VAL and UDF is set to FALSE. If DOL type is a PV_LINK then dbCaAddInlink is called to create a channel access link.

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. If PACT is FALSE and OMSL is CLOSED_LOOP, recGblGetLinkValue is called to read the current value of VAL. See Soft Output. If the return status of recGblGetLinkValue is zero then UDF is set to FALSE.
  3. Check severity and write the new value. See Simulation Mode and Invalid Alarm Output Action for details on how the simulation mode and the INVALID alarm conditions affect output.
  4. If PACT has been changed to TRUE, the device support write output routine has started but has not completed writing the new value. In this case, the processing routine merely returns, leaving PACT TRUE.
  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 stringout output record must have an associated set of device support routines. The primary responsibility of the device support routines is to write a new value whenever write_stringout is called. The device support routines are primarily interested in the following fields:


NameSummaryDescription
PACTProcessing Active FieldSee Fields Common to All Record Types for an explanation of these fields.
DPVTDevice Private
NSEVNew Alarm Severity
NSTANew Alarm Status
VALValueThis is the field written by the device support routines.
OUTOutput LinkThis field is used by the device support routines to locate its output.


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.

write_stringout

write_stringout(precord)

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

  • 0: Success.
  • Other: Error.

Device Support for Soft Records

The Soft Channel device support module writes the current value of VAL.

If the OUT link type is PV_LINK, then dbCaAddInlink is called by init_record.

write_so calls recGblPutLinkValue to write the current value of VAL. See Soft Output.




EPICS Record Reference Manual - 19 MAY 1998