From e5f86831448ca1d34563db3d67d55c55b256e5f8 Mon Sep 17 00:00:00 2001 From: Joao Paulo Martins Date: Fri, 6 Sep 2019 15:00:52 +0200 Subject: [PATCH 1/2] Renaming dbd file to dbd.pod --- src/std/rec/{mbboDirectRecord.dbd => mbboDirectRecord.dbd.pod} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/std/rec/{mbboDirectRecord.dbd => mbboDirectRecord.dbd.pod} (100%) diff --git a/src/std/rec/mbboDirectRecord.dbd b/src/std/rec/mbboDirectRecord.dbd.pod similarity index 100% rename from src/std/rec/mbboDirectRecord.dbd rename to src/std/rec/mbboDirectRecord.dbd.pod From 9d4b652c5e66145f7fac0bea5e2a90939dc8b6e2 Mon Sep 17 00:00:00 2001 From: Joao Paulo Martins Date: Fri, 6 Sep 2019 17:20:54 +0200 Subject: [PATCH 2/2] First version of mbbo POD file --- src/std/rec/mbboDirectRecord.dbd.pod | 380 +++++++++++++++++++++++++++ 1 file changed, 380 insertions(+) diff --git a/src/std/rec/mbboDirectRecord.dbd.pod b/src/std/rec/mbboDirectRecord.dbd.pod index 0b4285e32..e730bc854 100644 --- a/src/std/rec/mbboDirectRecord.dbd.pod +++ b/src/std/rec/mbboDirectRecord.dbd.pod @@ -6,7 +6,153 @@ # EPICS BASE is distributed subject to a Software License Agreement found # in file LICENSE that is included with this distribution. #************************************************************************* + +=head1 B + +The mbboDirect record performs the opposite function to that of the mbbiDirect +record. It accumulates bits (in the fields B0 - BF) as unsigned characters, and +converts them to a word which is then written out to hardware. If a bit field is +non-zero, it is interpreted as a binary 1. On the other hand, if it is zero, it +is interpreted as a binary 0. + +=head1 L + +=over + +=item * L + +=over + +=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 mbboDirect + +=cut + recordtype(mbboDirect) { + +=head2 Parameter Fields + +The mbboDirect record's fields fall into the following categories: + +=over + +=item * L + +=item * L + +=item * L + +=item * L + +=item * L + +=back + +=head3 Scan Parameters + +The mbboDirect 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. Note +that I/O event scanning is only supported for those card types that +interrupt. + +=head3 Desired Output Parameters + +The mbboDirect record, like all output records, must specify where its output +originates. The output mode select field (OMSL) determines whether the output +originates from another record or from database access. When set to C<<< +closed_loop >>>, the desired output is retrieved from the link specified in the +desired output (DOL) field--which can specify either a database or channel +access link--and placed into the VAL field. When set to C<<< supervisory >>>, +the DOL field is ignored and the current value of VAL is used. The desired +output can be written into the VAL field via dpPuts at run-time when the record +is in C<<< supervisory >>> mode. DOL can also be a constant, in which case VAL +is initialized to the constant value. Note that OMSL cannot be C<<< closed_loop +>>> when DOL is a constant. See L
for information on how +to specify database links. + +VAL is then converted to RVAL in the routine described in the next section. +However, the C<<< Soft Channel >>> device support module for the mbboDirect +record writes the VAL field's value without any conversion. + +=fields OMSL, DOL, VAL + +=head3 Convert and Write Parameters + +For records that are to write values to hardware devices, the OUT output link +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 L
for information +on the format of hardware addresses. + +If the mbboDirect record does not use the C<<< Soft Channel >>> device support +module, then VAL is converted to RVAL, and RVAL is the actual 16-bit word sent +out. RVAL is set equal to VAL and then shifted left by the number of bits +specified in the SHFT field (the SHFT value is set by device support and is not +configurable by the user). RVAL is then sent out to the location specified in +the OUT field. + +For mbboDirect records that specify a database link, a channel access link, or a +constant, the DTYP field must specify either one of two soft device support +routines--{Soft Channel} or C<<< Raw Soft Channel >>>. The difference between +the two is that C<<< Soft Channel >>> writes the desired output value from VAL +directly to the output link while C<<< Raw Soft Channel >>> writes the value +from RVAL to the output link after it has undergone the conversion described +above. See L
for information on how to specify database +links. + +=fields OUT, RVAL, SHFT, B0, B1, B2, B3, B4, B5, B6, B7, B8, B9, BA, BB, BC, BD, BE, BF + +=head3 Operator Display Parameters + +See L for more on the record name (NAME) and +description (DESC) fields. + +=fields NAME, DESC + +=cut + include "dbCommon.dbd" field(VAL,DBF_USHORT) { prompt("Word") @@ -184,6 +330,49 @@ recordtype(mbboDirect) { promptgroup("50 - Output") interest(1) } + +=head3 Alarm Parameters + +The possible alarm conditions for mbboDirect records are the SCAN, READ, and +INVALID alarms. The SCAN and READ alarms are not configurable by the user since +they are always of MAJOR severity. See L for a complete +explanation of Scan and Read alarms. + +The IVOA field specifies an action to take when the INVALID alarm is triggered. +There are three possible actions: C<<< Continue normally >>>, C<<< Don't drive +outputs >>>, or C<<< Set output to IVOV >>>. When C<<< Set output to IVOV >>> is +specified and a INVALID alarm is triggered, the record will write the value in +the IVOV field to output. See L for more +information. L lists other fields related to a alarms that are +common to all record types. + +=fields IVOA, IVOV + +=head3 Run-time and Simulation Mode Parameters + +These parameters are used by the run-time code for processing the mbbo Direct +record. + +MASK is used by device support routine to read the hardware register. Record +support sets low order NOBT bits. Device support can shift this value. + +MLST holds the value when the last monitor for value change was triggered. + +=fields NOBT, ORAW, MASK, MLST + +The following fields are used to operate the mbboDirect record in the simulation +mode. See L for more information on the simulation mode fields. + +=fields SIOL, SIML, SIMM, SIMS + +=begin html + +


+ +=end html + +=cut + field(SIOL,DBF_OUTLINK) { prompt("Sim Output Specifctn") promptgroup("90 - Simulate") @@ -216,4 +405,195 @@ recordtype(mbboDirect) { promptgroup("50 - Output") interest(2) } + +=head2 Record Support + +=head3 Record Support Routines + +=head4 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 VAL is initialized to its value and UDF is set to +FALSE. + +MASK is cleared and then the NOBT low order bits are set. + +If device support includes C, it is called. + +If device support returns success, VAL is then set from RVAL and UDF is set to +FALSE. + +=head4 Process + +See next section. + +=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. + +If PACT is FALSE + +=over + +=item * If DOL is DB_LINK and OMSL is CLOSED_LOOP + +=over + +=item * Get value from DOL + +=item * Set PACT to FALSE + +=back + +=back + +=item 3. + +Convert + +=over + +=item * If PACT is FALSE, compute RVAL + +=over + +=item * Set RVAL = VAL + +=item * Shift RVAL left SHFT bits + +=back + +=item * Status=write_mbboDirect + +=back + +=item 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. + +=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 MLST is not equal to VAL. + +=item * Monitors for RVAL and RBV are checked whenever other monitors are invoked. + +=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 mbboDirect record must have an associated set of device support routines. +The primary responsibility of the device support routines is to obtain a new raw +mbbo value whenever write_mbboDirect is called. The device support routines are +primarily interested in the following fields: + +=fields PACT, DPVT, UDF, NSEV, NSTA, NOBT, OUT, RVAL, RBV, MASK, SHFT + +=head3 Device Support Routines + +Device support consists of the following routines: + +=head4 long report(int level) + +This optional routine is called by the IOC command C and is passed the +report level that was requested by the user. +It should print a report on the state of the device support to stdout. +The C parameter may be used to output increasingly more detailed +information at higher levels, or to select different types of information with +different levels. +Level zero should print no more than a small summary. + +=head4 long init(int after) + +This optional routine is called twice at IOC initialization time. +The first call happens before any of the C calls are made, with +the integer parameter C set to 0. +The second call happens after all of the C calls have been made, +with C set to 1. + +=head4 init_record + + init_record(precord) + +This routine is optional. If provided, it is called by the record support +C routine. If MASK is used, it should be shifted if necessary and +SHFT given a value. + +=head4 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. + +=head4 write_mbboDirect + + write_mbboDirect(precord) + +This routine must output a new value. It returns the following values: + +=over + +=item * 0: Success. + +=item * Other: Error. + +=back + +=head3 Device Support For Soft Records + +This C<<< SOft Channel >>> module writes the current value of VAL. + +If the OUT link type is PV_LINK, then dbCaAddInlink is called by +C. + +write_mbboDirect calls recGblPutLinkValue to write the current value of VAL. + +See L. + +=cut + }