String Input Record (stringin)

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 record-specific fields are described below, grouped by functionality.

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.

FieldSummaryTypeDCT DefaultReadWriteCA PP
VALCurrent ValueSTRING [40]Yes YesYesYes
INPInput SpecificationINLINKYes YesYesNo
DTYPDevice TypeDEVICEYes YesYesNo

Monitor Parameters

These parameters are used to specify when the monitor post should be sent by monitor() routine. There are two possible choices:

IndexIdentifierChoice String
0 stringinPOST_OnChange On Change
1 stringinPOST_Always Always

APST is used for archiver monitors and MPST is for all other type of monitors.

FieldSummaryTypeDCT DefaultReadWriteCA PP
MPSTPost Value MonitorsMENU (stringinPOST)Yes YesYesNo
APSTPost Archive MonitorsMENU (stringinPOST)Yes YesYesNo

Operator Display Parameters

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

FieldSummaryTypeDCT DefaultReadWriteCA PP
NAMERecord NameSTRING [61]No YesNoNo
DESCDescriptorSTRING [41]Yes YesYesNo

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.

FieldSummaryTypeDCT DefaultReadWriteCA PP
OVALPrevious ValueSTRING [40]No YesNoNo

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

FieldSummaryTypeDCT DefaultReadWriteCA PP
SIOLSimulation Input LinkINLINKYes YesYesNo
SVALSimulation ValueSTRING [40]No YesYesYes
SIMLSimulation Mode LinkINLINKYes YesYesNo
SIMMSimulation ModeMENU (menuYesNo)No YesYesNo
SIMSSimulation Mode SeverityMENU (menuAlarmSevr)Yes YesYesNo
SSCNSim. Mode ScanMENU (menuScan)Yes65535YesYesNo
SDLYSim. Mode Async DelayDOUBLEYes-1.0YesYesNo

Record Support

Record Support Routines

init_record

  long (*init_record)(struct dbCommon *precord, int pass)

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 an init_record() routine it is called.

process

  long (*process)(struct dbCommon *precord)

See "Record Processing".

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. recGblGetTimeStamp() is called.

  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:

FieldSummaryTypeDCT DefaultReadWriteCA PP
PACTRecord activeUCHARNo YesNoNo
DPVTDevice PrivateNOACCESSNo NoNoNo
UDFUndefinedUCHARYes1YesYesYes
VALCurrent ValueSTRING [40]Yes YesYesYes
INPInput SpecificationINLINKYes YesYesNo

Device Support Routines (devSiSoft.c)

init_record

  long init_record(stringinRecord *prec)

This routine is optional. If provided, it is called by the record support init_record() routine.

read_stringin

  long read_stringin(stringinRecord *prec)

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

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.