From 4f31205188c9ebf3604ad151c5f05bd1386c877b Mon Sep 17 00:00:00 2001 From: Saeed Haghtalab Date: Fri, 6 Sep 2019 11:56:46 +0200 Subject: [PATCH 1/2] Rename stringinRecord.dbd -> stringinRecord.dbd.pod --- src/std/rec/{stringinRecord.dbd => stringinRecord.dbd.pod} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/std/rec/{stringinRecord.dbd => stringinRecord.dbd.pod} (100%) diff --git a/src/std/rec/stringinRecord.dbd b/src/std/rec/stringinRecord.dbd.pod similarity index 100% rename from src/std/rec/stringinRecord.dbd rename to src/std/rec/stringinRecord.dbd.pod From d7d142650b8f218074c3bf067c1b566f0f3e8db3 Mon Sep 17 00:00:00 2001 From: Saeed Haghtalab Date: Fri, 6 Sep 2019 14:11:20 +0200 Subject: [PATCH 2/2] Adding POD to stringin record --- src/std/rec/stringinRecord.dbd.pod | 301 ++++++++++++++++++++++++++++- 1 file changed, 295 insertions(+), 6 deletions(-) diff --git a/src/std/rec/stringinRecord.dbd.pod b/src/std/rec/stringinRecord.dbd.pod index 5b0b76813..2dd305502 100644 --- a/src/std/rec/stringinRecord.dbd.pod +++ b/src/std/rec/stringinRecord.dbd.pod @@ -6,6 +6,72 @@ # EPICS BASE is distributed subject to a Software License Agreement found # in file LICENSE that is included with this distribution. #************************************************************************* + +=head1 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. + +=head2 Contents + +=over + +=item * L + +=over + +=item * L + +=item * L + +=item * L + +=item * L + +=item * L + +=item * L + +=back + +=item * L + +=over + +=item * L + +=item * L + +=back + +=item * L + +=over + +=item * L + +=item * L + +=item * L + +=back + +=back + +=begin html + +
+
+
+ +=end html + +=recordtype stringin + +=cut + menu(stringinPOST) { choice(stringinPOST_OnChange,"On Change") choice(stringinPOST_Always,"Always") @@ -19,17 +85,56 @@ recordtype(stringin) { pp(TRUE) size(40) } - field(OVAL,DBF_STRING) { - prompt("Previous Value") - special(SPC_NOMOD) - interest(3) - size(40) - } + +=head2 Parameter Fields + +=head3 Scan Parameters + +The string input record has the standard fields for specifying under what +circumstances it will be processed. These fields are listed in +L. +In addition, +L +explains how these fields are used. + +=head3 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 L
+for information on specifying links. + +=fields VAL, INP, DTYP + +=cut + field(INP,DBF_INLINK) { prompt("Input Specification") promptgroup("40 - Input") interest(1) } + +=head3 Monitor Parameters + +These parameters are used to specify when the monitor post should be sent by +C routine. There are two possible choices: + +=head4 Menu stringinPOST + +=menu stringinPOST + +APST is used for archiver monitors and MPST is for all other type of monitors. + +=fields MPST, APST + +=cut + field(MPST,DBF_MENU) { prompt("Post Value Monitors") promptgroup("80 - Display") @@ -42,6 +147,44 @@ recordtype(stringin) { interest(1) menu(stringinPOST) } + +=head3 Operator Display Parameters + +See L +for more on the record name (NAME) and description (DESC) fields. + +=fields NAME, DESC + +=head3 Alarm Parameters + +The string input record has the alarm parameters common to all record types. +L +lists other fields related to a alarms that are common to all record types. + +=head3 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. + +=fields OVAL + + + +The following fields are used to operate the string input in the simulation +mode. See +L +for more information on simulation mode fields. + +=fields SIOL, SVAL, SIML, SIMM, SIMS + +=cut + + field(OVAL,DBF_STRING) { + prompt("Previous Value") + special(SPC_NOMOD) + interest(3) + size(40) + } field(SIOL,DBF_INLINK) { prompt("Sim Input Specifctn") promptgroup("90 - Simulate") @@ -68,4 +211,150 @@ recordtype(stringin) { interest(2) menu(menuAlarmSevr) } + +=begin html + +
+
+
+ +=end html + +=head2 Record Support + +=head3 Record Support Routines (stringinRecord.c) + +=head4 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 C routine it is called. + +=head4 process + + long (*process)(struct dbCommon *precord) + +See L. + +=head3 Record Processing + +Routine process implements the following algorithm: + +=over + +=item 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. + +=item 2. + +readValue is called. See +L +for more information on simulation mode fields and how they affect input. + +=item 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. + +=item 4. + +C is called. + +=item 5. + +Check to see if monitors should be invoked. + +=over + +=item * + +Alarm monitors are invoked if the alarm status or severity has changed. + +=item * + +Archive and value change monitors are invoked if OVAL is not equal to VAL. + +=item * + +NSEV and NSTA are reset to 0. + +=back + +=item 6. + +Scan forward link if necessary, set PACT FALSE, and return. + +=back + +=begin html + +
+
+
+ +=end html + +=head2 Device Support + +=head3 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: + +=fields PACT, DPVT, UDF, VAL, INP + +=head3 Device Support Routines (devSiSoft.c) + +=head4 init_record + + long init_record(stringinRecord *prec) + +This routine is optional. If provided, it is called by the record support +C routine. + +=head4 read_stringin + + long read_stringin(stringinRecord *prec) + +This routine must provide a new input value. It returns the following values: + +=over + +=item * 0: Success. A new ASCII string is stored into VAL. + +=item * Other: Error. + +=back + +=head3 Device Support for Soft Records + +The C<<< 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 C, and UDF is set to FALSE. If +the INP link type is PV_LINK, then dbCaAddInlink is called by C. + +read_stringin calls recGblGetLinkValue to read the current value of VAL. See +L. + +If the return status of recGblGetLinkValue is zero, then read_stringin sets UDF +to FALSE. The status of recGblGetLinkValue is returned. + +=cut + }