diff --git a/.appveyor.yml b/.appveyor.yml index aba48957a..eb311fcdf 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -42,14 +42,18 @@ environment: matrix: - TOOLCHAIN: mingw APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 - - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 - TOOLCHAIN: 2019 - - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 - TOOLCHAIN: 2017 + - TOOLCHAIN: 2019 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 + - TOOLCHAIN: 2017 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 - TOOLCHAIN: 14.0 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 - TOOLCHAIN: 12.0 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 - TOOLCHAIN: 11.0 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 - TOOLCHAIN: 10.0 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 # Platform: architecture platform: @@ -62,19 +66,21 @@ matrix: # VS Express installs don't have the 64 bit compiler - platform: x64 TOOLCHAIN: 10.0 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 # Exclude to reduce total job runtime # skip 64-bit for older and 32-bit for newer - platform: x64 TOOLCHAIN: 11.0 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 - platform: x86 TOOLCHAIN: mingw APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 - platform: x86 - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 TOOLCHAIN: 2019 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 - platform: x86 - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 TOOLCHAIN: 2017 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 #---------------------------------# diff --git a/configure/os/CONFIG.Common.win32-x86-mingw b/configure/os/CONFIG.Common.win32-x86-mingw index cb3f53978..7c03781b0 100644 --- a/configure/os/CONFIG.Common.win32-x86-mingw +++ b/configure/os/CONFIG.Common.win32-x86-mingw @@ -30,7 +30,7 @@ ARCH_DEP_LDFLAGS += -m32 # Compiler does not define __unix __unix__ unix # Override for -DUNIX from CONFIG.Common.UnixCommon -OP_SYS_CPPFLAGS = -D_MINGW -Wno-format +OP_SYS_CPPFLAGS = -D_MINGW -D__USE_MINGW_ANSI_STDIO EXE = .exe RES = .coff diff --git a/documentation/RELEASE_NOTES.md b/documentation/RELEASE_NOTES.md index 781cce4db..58b27947d 100644 --- a/documentation/RELEASE_NOTES.md +++ b/documentation/RELEASE_NOTES.md @@ -36,7 +36,7 @@ and can be adjusted locally if necessary. ### caRepeater /dev/null -On *NIX targets caRepeater will now partially daemonize by redirecting +On \*NIX targets caRepeater will now partially daemonize by redirecting stdin/out/err to /dev/null. This prevents caRepeater from inheriting the stdin/out of a process, like caget, which has spawned it in the background. This has been known to cause problems in some cases when @@ -195,7 +195,7 @@ set to their default values. void startitup(void) { epicsThreadOpts opts = EPICS_THREAD_OPTS_INIT; epicsThreadId tid; - + opts.priority = epicsThreadPriorityMedium; tid = epicsThreadCreateOpt("my thread", &threadMain, NULL, &opts); } @@ -662,14 +662,14 @@ number instead, like this: ``` #include - + #ifndef VERSION_INT # define VERSION_INT(V,R,M,P) ( ((V)<<24) | ((R)<<16) | ((M)<<8) | (P)) #endif #ifndef EPICS_VERSION_INT # define EPICS_VERSION_INT VERSION_INT(EPICS_VERSION, EPICS_REVISION, EPICS_MODIFICATION, EPICS_PATCH_LEVEL) #endif - + #if EPICS_VERSION_INT >= VERSION_INT(3,16,1,0) /* Code where Base has INT64 support */ #else @@ -995,7 +995,7 @@ excerpts from a database file: record(ai, math:pi) { field(INP, {const: 3.14159265358979}) # Correct field(SIOL, "{const: 3.142857}") # Wrong - + info(autosave, { # White-space and comments are allowed fields:[DESC, SIMM], pass0:[VAL] @@ -1143,7 +1143,7 @@ this: ``` #include "epicsTime.h" - + #ifndef M_time /* S_time_... status values were not provided before Base 3.16 */ #define S_time_unsynchronized epicsTimeERROR @@ -1168,9 +1168,49 @@ Added a new macro `callbackGetPriority(prio, callback)` to the callback.h header and removed the need for dbScan.c to reach into the internals of its `CALLBACK` objects. + ## Changes from the 3.15 branch since 3.15.7 -> None. +### epicsThread: Main thread defaults to allow blocking I/O + +VxWorks IOCs (and potentially RTEMS IOCs running GeSys) have had problems with +garbled error messages from dbStaticLib routines for some time — messages +printed before `iocInit` were being queued through the errlog thread instead of +being output immediately. This has been fixed by initializing the main thread +with its `OkToBlock` flag set instead of cleared. IOCs running on other +operating systems that use iocsh to execute the startup script previously had +that set anyway in iocsh so were not affected, but this change might cause other +programs that don't use iocsh to change their behavior slightly if they use +`errlogPrintf()`, `epicsPrintf()` or `errPrintf()`. + +### catools: Handle data type changes in camonitor + +The camonitor program didn't properly cope if subscribed to a channel whose data +type changed when its IOC was rebooted without restarting the camonitor program. +This has now been fixed. + +### More Record Reference Documentation + +The remaining record types have had their reference pages moved from the Wiki, +and some new reference pages have been written to cover the analog array and +long string input and output record types plus the printf recor type, none of +which were previously documented. The wiki reference pages covering the fields +common to all, input, and output record types have also been added, thanks to +Rolf Keitel. The POD conversion scripts have also been improved and they now +properly support linking to subsections in a different document, although the +POD changes to add the cross-links that appeared in the original wiki pages +still needs to be done in most cases. + +### Fix build issues with newer MinGW versions + +The `clock_gettime()` routine is no longer used under MinGW since newer versions +don't provide it any more. + +### Fix race for port in RSRV when multiple IOCs start simultaneously + +If multiple IOCs were started at the same time, by systemd say, they could race +to obtain the Channel Access TCP port number 5064. This issue has been fixed. + ## Changes made between 3.15.6 and 3.15.7 @@ -1887,4 +1927,3 @@ Simpler versions of the `epicsTime_gmtime()` and `epicsTime_localtime()` routines have been included in the Windows implementations, and a new test program added. The original versions do not report DST status properly. Fixes [Launchpad bug 1528284](https://bugs.launchpad.net/bugs/1528284). - diff --git a/documentation/RecordReference.md b/documentation/RecordReference.md index 587ec6148..8d78f1a82 100644 --- a/documentation/RecordReference.md +++ b/documentation/RecordReference.md @@ -1,9 +1,17 @@ # Record Reference Documentation -The following documentation for the record types and menus include with Base was converted from the old EPICS Wiki pages and updated. This list does not include all of the available record types as some have not been documented yet. +The following documentation for the record types and menus include with Base was +converted from the old EPICS Wiki pages and updated. This list only includes the +record types supplied with Base. + +* [Fields Common to All Record Types](dbCommonRecord.html) +* [Fields Common to Input Record Types](dbCommonInputs.html) +* [Fields Common to Output Record Types](dbCommonOutputs.html) ## Record Types +* [Analog Array Input Record (aai)](aaiRecord.html) +* [Analog Array Output Record (aao)](aaoRecord.html) * [Analog Input Record (ai)](aiRecord.html) * [Analog Output Record (ao)](aoRecord.html) * [Array Subroutine Record (aSub)](aSubRecord.html) @@ -15,15 +23,19 @@ The following documentation for the record types and menus include with Base was * [Data Fanout Record (dfanout)](dfanoutRecord.html) * [Event Record (event)](eventRecord.html) * [Fanout Record (fanout)](fanoutRecord.html) +* [Histogram Record (histogram)](histogramRecord.html) * [64bit Integer Input Record (int64in)](int64inRecord.html) * [64bit Integer Output Record (int64out)](int64outRecord.html) * [Long Input Record (longin)](longinRecord.html) * [Long Output Record (longout)](longoutRecord.html) +* [Long String Input Record (lsi)](lsiRecord.html) +* [Long String Output Record (lso)](lsoRecord.html) * [Multi-Bit Binary Input Direct Record (mbbiDirect)](mbbiDirectRecord.html) * [Multi-Bit Binary Input Record (mbbi)](mbbiRecord.html) * [Multi-Bit Binary Output Direct Record (mbboDirect)](mbboDirectRecord.html) * [Multi-Bit Binary Output Record (mbbo)](mbboRecord.html) * [Permissive Record (permissive)](permissiveRecord.html) +* [Printf Record (prinf)](printfRecord.html) * [Select Record (sel)](selRecord.html) * [Sequence Record (seq)](seqRecord.html) * [State Record (state)](stateRecord.html) @@ -47,4 +59,10 @@ The following documentation for the record types and menus include with Base was ## Corrections and Updates -Corrections to these documents can be submitted as patch files to the EPICS core developers, or as merge requests or pull requests to the 7.0 branch of epics-base. The document sources can be found in the `modules/database/src/std/rec` and `modules/database/src/ioc/db` directories in files with extension `.dbd.pod`. The documentation format is an extended version of Perl POD, run `perldoc pod` for details. +Corrections to these documents can be submitted as patch files to the EPICS core +developers, or as merge requests or pull requests to the 7.0 branch of Base. +The document sources can be found in the `modules/database/src/std/rec` and +`modules/database/src/ioc/db` directories in files with extension `.dbd.pod`. +The documentation source format is a combination of the EPICS DBD file format +with an extended version of Perl's POD (plain old documentation); run `perldoc +pod` for details of POD. diff --git a/modules/ca/src/tools/camonitor.c b/modules/ca/src/tools/camonitor.c index a3fdecd55..6799182be 100644 --- a/modules/ca/src/tools/camonitor.c +++ b/modules/ca/src/tools/camonitor.c @@ -138,7 +138,14 @@ static void connection_handler ( struct connection_handler_args args ) pv *ppv = ( pv * ) ca_puser ( args.chid ); if ( args.op == CA_OP_CONN_UP ) { nConn++; - if (!ppv->onceConnected) { + + if (ppv->onceConnected && ppv->dbfType != ca_field_type(ppv->chid)) { + /* Data type has changed. Rebuild connection with new type. */ + ca_clear_subscription(ppv->evid); + ppv->evid = NULL; + } + + if (!ppv->evid) { ppv->onceConnected = 1; /* Set up pv structure */ /* ------------------- */ @@ -169,7 +176,7 @@ static void connection_handler ( struct connection_handler_args args ) eventMask, event_handler, (void*)ppv, - NULL); + &ppv->evid); } } else if ( args.op == CA_OP_CONN_DOWN ) { diff --git a/modules/ca/src/tools/tool_lib.h b/modules/ca/src/tools/tool_lib.h index fb5c4af3c..58cf182c0 100644 --- a/modules/ca/src/tools/tool_lib.h +++ b/modules/ca/src/tools/tool_lib.h @@ -78,6 +78,7 @@ typedef struct epicsTimeStamp tsPreviousS; char firstStampPrinted; char onceConnected; + evid evid; } pv; diff --git a/modules/database/src/ioc/db/Makefile b/modules/database/src/ioc/db/Makefile index 2dc4fec0d..ebb78e229 100644 --- a/modules/database/src/ioc/db/Makefile +++ b/modules/database/src/ioc/db/Makefile @@ -4,7 +4,7 @@ # Copyright (c) 2002 The Regents of the University of California, as # Operator of Los Alamos National Laboratory. # EPICS BASE is distributed subject to a Software License Agreement found -# in file LICENSE that is included with this distribution. +# in file LICENSE that is included with this distribution. #************************************************************************* # This is a Makefile fragment, see src/ioc/Makefile. @@ -62,6 +62,9 @@ DBDINC += dbCommon dbMenusPod = $(notdir $(wildcard ../db/menu*.dbd.pod)) HTMLS += $(patsubst %.dbd.pod,%.html,$(dbMenusPod)) +HTMLS += dbCommonRecord.html +HTMLS += dbCommonInput.html +HTMLS += dbCommonOutput.html dbCore_SRCS += dbLock.c dbCore_SRCS += dbAccess.c @@ -96,4 +99,3 @@ dbCore_SRCS += chfPlugin.c dbCore_SRCS += dbState.c dbCore_SRCS += dbUnitTest.c dbCore_SRCS += dbServer.c - diff --git a/modules/database/src/ioc/db/RULES b/modules/database/src/ioc/db/RULES index 5f11a4cc6..c7dbfe8ef 100644 --- a/modules/database/src/ioc/db/RULES +++ b/modules/database/src/ioc/db/RULES @@ -6,21 +6,25 @@ # Copyright (c) 2002 The Regents of the University of California, as # Operator of Los Alamos National Laboratory. # EPICS BASE is distributed subject to a Software License Agreement found -# in file LICENSE that is included with this distribution. +# in file LICENSE that is included with this distribution. #************************************************************************* # This is a Makefile fragment, see src/ioc/Makefile. -dbCommon.h$(DEP): $(IOCDIR)/db/dbCommonRecord.dbd $(IOCDIR)/db/RULES - @$(RM) $@ - @$(DBTORECORDTYPEH) -D -I ../db -o $(COMMONDEP_TARGET) $< > $@ +THESE_RULES := $(IOCDIR)/db/RULES -$(COMMON_DIR)/dbCommon.h: $(IOCDIR)/db/dbCommonRecord.dbd $(IOCDIR)/db/RULES +dbCommon.h$(DEP): $(COMMON_DIR)/dbCommonRecord.dbd $(THESE_RULES) + @$(RM) $@ + @$(DBTORECORDTYPEH) -D -I ../db -I $(COMMON_DIR) -o $(COMMONDEP_TARGET) $< > $@ + +$(COMMON_DIR)/dbCommonRecord.html: ../db/dbCommon.dbd.pod + +$(COMMON_DIR)/dbCommon.h: $(COMMON_DIR)/dbCommonRecord.dbd $(THESE_RULES) @$(RM) $(notdir $@) - $(DBTORECORDTYPEH) -I ../db -o $(notdir $@) $< + $(DBTORECORDTYPEH) -I ../db -I $(COMMON_DIR) -o $(notdir $@) $< @$(MV) $(notdir $@) $@ -$(COMMON_DIR)/menuGlobal.dbd: $(IOCDIR)/db/Makefile $(IOCDIR)/db/RULES +$(COMMON_DIR)/menuGlobal.dbd: $(IOCDIR)/db/Makefile $(THESE_RULES) # This is a target-specific variable $(COMMON_DIR)/menuGlobal.dbd: DBDCAT_COMMAND = \ diff --git a/modules/database/src/ioc/db/dbAccess.c b/modules/database/src/ioc/db/dbAccess.c index 19f60381d..b2788b0d9 100644 --- a/modules/database/src/ioc/db/dbAccess.c +++ b/modules/database/src/ioc/db/dbAccess.c @@ -776,8 +776,19 @@ int dbLoadRecords(const char* file, const char* subs) return -1; } status = dbReadDatabase(&pdbbase, file, 0, subs); - if (!status && dbLoadRecordsHook) - dbLoadRecordsHook(file, subs); + switch(status) + { + case 0: + if(dbLoadRecordsHook) + dbLoadRecordsHook(file, subs); + break; + case -2: + errlogPrintf("dbLoadRecords: failed to load '%s'\n" + " Records cannot be loaded after iocInit!\n", file); + break; + default: + errlogPrintf("dbLoadRecords: failed to load '%s'\n", file); + } return status; } @@ -943,6 +954,11 @@ long dbGet(DBADDR *paddr, short dbrType, } else { DBADDR localAddr = *paddr; /* Structure copy */ + if (pfl->no_elements < 1) { + status = S_db_badField; + goto done; + } + localAddr.field_type = pfl->field_type; localAddr.field_size = pfl->field_size; localAddr.no_elements = pfl->no_elements; diff --git a/modules/database/src/ioc/db/dbCommon.dbd b/modules/database/src/ioc/db/dbCommon.dbd deleted file mode 100644 index aa6a63345..000000000 --- a/modules/database/src/ioc/db/dbCommon.dbd +++ /dev/null @@ -1,268 +0,0 @@ -#************************************************************************* -# Copyright (c) 2007 UChicago Argonne LLC, as Operator of Argonne -# National Laboratory. -# Copyright (c) 2002 The Regents of the University of California, as -# Operator of Los Alamos National Laboratory. -# EPICS BASE is distributed subject to a Software License Agreement found -# in file LICENSE that is included with this distribution. -#************************************************************************* - %#include "epicsTypes.h" - %#include "link.h" - field(NAME,DBF_STRING) { - prompt("Record Name") - special(SPC_NOMOD) - size(61) - } - field(DESC,DBF_STRING) { - prompt("Descriptor") - promptgroup("10 - Common") - size(41) - } - field(ASG,DBF_STRING) { - prompt("Access Security Group") - promptgroup("10 - Common") - special(SPC_AS) - size(29) - } - field(SCAN,DBF_MENU) { - prompt("Scan Mechanism") - promptgroup("20 - Scan") - special(SPC_SCAN) - interest(1) - menu(menuScan) - } - field(PINI,DBF_MENU) { - prompt("Process at iocInit") - promptgroup("20 - Scan") - interest(1) - menu(menuPini) - } - field(PHAS,DBF_SHORT) { - prompt("Scan Phase") - promptgroup("20 - Scan") - special(SPC_SCAN) - interest(1) - } - field(EVNT,DBF_STRING) { - prompt("Event Name") - promptgroup("20 - Scan") - special(SPC_SCAN) - size(40) - interest(1) - } - field(TSE,DBF_SHORT) { - prompt("Time Stamp Event") - promptgroup("20 - Scan") - interest(1) - } - field(TSEL,DBF_INLINK) { - prompt("Time Stamp Link") - promptgroup("20 - Scan") - interest(1) - } - field(DTYP,DBF_DEVICE) { - prompt("Device Type") - promptgroup("10 - Common") - interest(1) - } - field(DISV,DBF_SHORT) { - prompt("Disable Value") - promptgroup("20 - Scan") - initial("1") - } - field(DISA,DBF_SHORT) { - prompt("Disable") - } - field(SDIS,DBF_INLINK) { - prompt("Scanning Disable") - promptgroup("20 - Scan") - interest(1) - } - %#include "epicsMutex.h" - field(MLOK,DBF_NOACCESS) { - prompt("Monitor lock") - special(SPC_NOMOD) - interest(4) - extra("epicsMutexId mlok") - } - %#include "ellLib.h" - field(MLIS,DBF_NOACCESS) { - prompt("Monitor List") - special(SPC_NOMOD) - interest(4) - extra("ELLLIST mlis") - } - field(BKLNK,DBF_NOACCESS) { - prompt("Backwards link tracking") - special(SPC_NOMOD) - interest(4) - extra("ELLLIST bklnk") - } - field(DISP,DBF_UCHAR) { - prompt("Disable putField") - } - field(PROC,DBF_UCHAR) { - prompt("Force Processing") - pp(TRUE) - interest(3) - } - field(STAT,DBF_MENU) { - prompt("Alarm Status") - special(SPC_NOMOD) - menu(menuAlarmStat) - initial("UDF") - } - field(SEVR,DBF_MENU) { - prompt("Alarm Severity") - special(SPC_NOMOD) - menu(menuAlarmSevr) - } - field(NSTA,DBF_MENU) { - prompt("New Alarm Status") - special(SPC_NOMOD) - interest(2) - menu(menuAlarmStat) - } - field(NSEV,DBF_MENU) { - prompt("New Alarm Severity") - special(SPC_NOMOD) - interest(2) - menu(menuAlarmSevr) - } - field(ACKS,DBF_MENU) { - prompt("Alarm Ack Severity") - special(SPC_NOMOD) - interest(2) - menu(menuAlarmSevr) - } - field(ACKT,DBF_MENU) { - prompt("Alarm Ack Transient") - promptgroup("70 - Alarm") - special(SPC_NOMOD) - interest(2) - menu(menuYesNo) - initial("YES") - } - field(DISS,DBF_MENU) { - prompt("Disable Alarm Sevrty") - promptgroup("70 - Alarm") - interest(1) - menu(menuAlarmSevr) - } - field(LCNT,DBF_UCHAR) { - prompt("Lock Count") - special(SPC_NOMOD) - interest(2) - } - field(PACT,DBF_UCHAR) { - prompt("Record active") - special(SPC_NOMOD) - interest(1) - } - field(PUTF,DBF_UCHAR) { - prompt("dbPutField process") - special(SPC_NOMOD) - interest(1) - } - field(RPRO,DBF_UCHAR) { - prompt("Reprocess ") - special(SPC_NOMOD) - interest(1) - } - field(ASP,DBF_NOACCESS) { - prompt("Access Security Pvt") - special(SPC_NOMOD) - interest(4) - extra("struct asgMember *asp") - } - field(PPN,DBF_NOACCESS) { - prompt("pprocessNotify") - special(SPC_NOMOD) - interest(4) - extra("struct processNotify *ppn") - } - field(PPNR,DBF_NOACCESS) { - prompt("pprocessNotifyRecord") - special(SPC_NOMOD) - interest(4) - extra("struct processNotifyRecord *ppnr") - } - field(SPVT,DBF_NOACCESS) { - prompt("Scan Private") - special(SPC_NOMOD) - interest(4) - extra("struct scan_element *spvt") - } - field(RSET,DBF_NOACCESS) { - prompt("Address of RSET") - special(SPC_NOMOD) - interest(4) - extra("struct typed_rset *rset") - } - %#include "devSup.h" - field(DSET,DBF_NOACCESS) { - prompt("DSET address") - special(SPC_NOMOD) - interest(4) - extra("unambiguous_dset *dset") - } - field(DPVT,DBF_NOACCESS) { - prompt("Device Private") - special(SPC_NOMOD) - interest(4) - extra("void *dpvt") - } - field(RDES,DBF_NOACCESS) { - prompt("Address of dbRecordType") - special(SPC_NOMOD) - interest(4) - extra("struct dbRecordType *rdes") - } - field(LSET,DBF_NOACCESS) { - prompt("Lock Set") - special(SPC_NOMOD) - interest(4) - extra("struct lockRecord *lset") - } - field(PRIO,DBF_MENU) { - prompt("Scheduling Priority") - promptgroup("20 - Scan") - special(SPC_SCAN) - interest(1) - menu(menuPriority) - } - field(TPRO,DBF_UCHAR) { - prompt("Trace Processing") - } - field(BKPT,DBF_NOACCESS) { - prompt("Break Point") - special(SPC_NOMOD) - interest(1) - extra("char bkpt") - } - field(UDF,DBF_UCHAR) { - prompt("Undefined") - promptgroup("10 - Common") - pp(TRUE) - interest(1) - initial("1") - } - field(UDFS,DBF_MENU) { - prompt("Undefined Alarm Sevrty") - promptgroup("70 - Alarm") - interest(1) - menu(menuAlarmSevr) - initial("INVALID") - } - %#include "epicsTime.h" - field(TIME,DBF_NOACCESS) { - prompt("Time") - special(SPC_NOMOD) - interest(2) - extra("epicsTimeStamp time") - } - field(FLNK,DBF_FWDLINK) { - prompt("Forward Process Link") - promptgroup("20 - Scan") - interest(1) - } diff --git a/modules/database/src/ioc/db/dbCommon.dbd.pod b/modules/database/src/ioc/db/dbCommon.dbd.pod new file mode 100644 index 000000000..0fa00155a --- /dev/null +++ b/modules/database/src/ioc/db/dbCommon.dbd.pod @@ -0,0 +1,521 @@ +#************************************************************************* +# Copyright (c) 2007 UChicago Argonne LLC, as Operator of Argonne +# National Laboratory. +# Copyright (c) 2002 The Regents of the University of California, as +# Operator of Los Alamos National Laboratory. +# EPICS BASE is distributed subject to a Software License Agreement found +# in file LICENSE that is included with this distribution. +#************************************************************************* + +=head3 Operator Display Parameters + +The B field contains the record name which must be unique within an +EPICS Channel Access name space. The name is supplied by the application +developer and is the means of identifying a specific record. The name has a +maximum length of 60 characters and should use only this limited set of +characters: + + a-z A-Z 0-9 _ - : [ ] < > ; + +The B field may be set to provide a meaningful description of the +record's purpose. Maximum length is 40 characters. + +=fields NAME, DESC + +=cut + + %#include "epicsTypes.h" + %#include "link.h" + field(NAME,DBF_STRING) { + prompt("Record Name") + special(SPC_NOMOD) + size(61) + } + field(DESC,DBF_STRING) { + prompt("Descriptor") + promptgroup("10 - Common") + size(41) + } + field(ASG,DBF_STRING) { + prompt("Access Security Group") + promptgroup("10 - Common") + special(SPC_AS) + size(29) + } + +=head3 Scan Fields + +These fields contain information related to how and when a record processes. A +few records have unique fields that also affect how they process. These +fields, if any, will be listed and explained in the section for each record. + +The B field specifies the scanning period for periodic record scans or the +scan type for non-periodic record scans. The default set of values for SCAN can +be found in L. + +The choices provided by this menu are: + +=over + +=item * + +C for the record scan to be triggered by other records or Channel +Access + +=item * + +C for event-driven scan + +=item * + +C for interrupt-driven scan + +=item * + +A set of periodic scan intervals + +=back + +Additional periodic scan rates may be defined for individual IOCs by making a +local copy of menuScan.dbd and adding more choices as required. Scan rates +should normally be defined in order, with the fastest rates appearing first. +Scan periods may now be specified in seconds, minutes, hours or Hertz/Hz, and +plural time units will also be accepted (seconds are used if no unit is +mentioned in the choice string). For example the rates given below are all +valid: + + 1 hour + 0.5 hours + 15 minutes + 3 seconds + 1 second + 2 Hertz + +The B field specifies record processing at initialization. If it is set +to YES during database configuration, the record is processed once at IOC +initialization (before the normal scan tasks are started). + +The B field orders the records within a specific SCAN group. This is not +meaningful for passive records. All records of a specified phase are processed +before those with higher phase number. Whenever possible it is better to use +linked passive records to enforce the order of processing rather than a phase +number. + +The B field specifies an event number. This event number is used if the +SCAN field is set to C. All records with scan type C and the +same EVNT value will be processed when a call to post_event for EVNT is made. +The call to post_event is: post_event(short event_number). + +The B field specifies the scheduling priority for processing records +with SCAN=C and asynchronous record completion tasks. + +The B field specifies a "disable value". Record processing is +immediately terminated if the value of this field is equal to the value of the +DISA field, i.e. the record is disabled. Note that field values of a record +can be changed by database put or Channel Access, even if a record is +disabled. + +The B field contains the value that is compared with DISV to determine +if the record is disabled. The value of the DISA field is obtained via SDIS if +SDIS is a database or channel access link. If SDIS is not a database or +channel access link, then DISA can be set via dbPutField or dbPutLink. + +If the B field of a record is written to, the record is processed. + +The B field defines the record's "disable severity". If this field is +not NO_ALARM and the record is disabled, the record will be put into alarm +with this severity and a status of DISABLE_ALARM. + +The B field contains the lock set to which this record belongs. All +records linked in any way via input, output, or forward database links belong +to the same lock set. Lock sets are determined at IOC initialization time, and +are updated whenever a database link is added, removed or altered. + +The B field counts the number of times dbProcess finds the record active +during successive scans, i.e. PACT is TRUE. If dbProcess finds the record +active MAX_LOCK times (currently set to 10) it raises a SCAN_ALARM. + +The B field is TRUE while the record is being processed. For +asynchronous records PACT can be TRUE from the time record processing is +started until the asynchronous completion occurs. As long as PACT is TRUE, +dbProcess will not call the record processing routine. See Application +Developers Guide for details on usage of PACT. + +The B field is a database link to another record (the "target" record). +Processing a record with a specified FLNK field will force processing of the +target record, provided the target record's SCAN field is set to C. + +The B field is for internal use by the scanning system. + +=fields SCAN, PINI, PHAS, EVNT, PRIO, DISV, DISA, SDIS, PROC, DISS, LCNT, PACT, FLNK, SPVT + +=cut + + field(SCAN,DBF_MENU) { + prompt("Scan Mechanism") + promptgroup("20 - Scan") + special(SPC_SCAN) + interest(1) + menu(menuScan) + } + field(PINI,DBF_MENU) { + prompt("Process at iocInit") + promptgroup("20 - Scan") + interest(1) + menu(menuPini) + } + field(PHAS,DBF_SHORT) { + prompt("Scan Phase") + promptgroup("20 - Scan") + special(SPC_SCAN) + interest(1) + } + field(EVNT,DBF_STRING) { + prompt("Event Name") + promptgroup("20 - Scan") + special(SPC_SCAN) + size(40) + interest(1) + } + field(TSE,DBF_SHORT) { + prompt("Time Stamp Event") + promptgroup("20 - Scan") + interest(1) + } + field(TSEL,DBF_INLINK) { + prompt("Time Stamp Link") + promptgroup("20 - Scan") + interest(1) + } + field(DTYP,DBF_DEVICE) { + prompt("Device Type") + promptgroup("10 - Common") + interest(1) + } + field(DISV,DBF_SHORT) { + prompt("Disable Value") + promptgroup("20 - Scan") + initial("1") + } + field(DISA,DBF_SHORT) { + prompt("Disable") + } + field(SDIS,DBF_INLINK) { + prompt("Scanning Disable") + promptgroup("20 - Scan") + interest(1) + } + %#include "epicsMutex.h" + field(MLOK,DBF_NOACCESS) { + prompt("Monitor lock") + special(SPC_NOMOD) + interest(4) + extra("epicsMutexId mlok") + } + %#include "ellLib.h" + field(MLIS,DBF_NOACCESS) { + prompt("Monitor List") + special(SPC_NOMOD) + interest(4) + extra("ELLLIST mlis") + } + field(BKLNK,DBF_NOACCESS) { + prompt("Backwards link tracking") + special(SPC_NOMOD) + interest(4) + extra("ELLLIST bklnk") + } + field(DISP,DBF_UCHAR) { + prompt("Disable putField") + } + field(PROC,DBF_UCHAR) { + prompt("Force Processing") + pp(TRUE) + interest(3) + } + +=head3 Alarm Fields + +These fields indicate the status and severity of alarms, or else determine the +how and when alarms are triggered. Of course, many records have alarm-related +fields not common to all records. These fields are listed and explained in the +appropriate section on each record. + +The B field contains the current alarm status. + +The B field contains the current alarm severity. + +These two fields are seen outside database access. The B and B +fields are used by the database access, record support, and device support +routines to set new alarm status and severity values. Whenever any software +component discovers an alarm condition, it uses the following macro function: +recGblSetSevr(precord,new_status,new_severity) This ensures that the current +alarm severity is set equal to the highest outstanding alarm. The file alarm.h +defines all allowed alarm status and severity values. + +The B field contains the highest unacknowledged alarm severity. + +The B field specifies if it is necessary to acknowledge transient +alarms. + +The B indicates if the record's value is BnBeBined. Typically +this is caused by a failure in device support, the fact that the record has +never been processed, or that the VAL field currently contains a NaN (not a +number). UDF is initialized to TRUE at IOC initialization. Record and device +support routines which write to the VAL field are responsible for setting UDF. + +=fields STAT, SEVR, NSTA, NSEV, ACKS, ACKT, UDF + +=cut + + field(STAT,DBF_MENU) { + prompt("Alarm Status") + special(SPC_NOMOD) + menu(menuAlarmStat) + initial("UDF") + } + field(SEVR,DBF_MENU) { + prompt("Alarm Severity") + special(SPC_NOMOD) + menu(menuAlarmSevr) + } + field(NSTA,DBF_MENU) { + prompt("New Alarm Status") + special(SPC_NOMOD) + interest(2) + menu(menuAlarmStat) + } + field(NSEV,DBF_MENU) { + prompt("New Alarm Severity") + special(SPC_NOMOD) + interest(2) + menu(menuAlarmSevr) + } + field(ACKS,DBF_MENU) { + prompt("Alarm Ack Severity") + special(SPC_NOMOD) + interest(2) + menu(menuAlarmSevr) + } + field(ACKT,DBF_MENU) { + prompt("Alarm Ack Transient") + promptgroup("70 - Alarm") + special(SPC_NOMOD) + interest(2) + menu(menuYesNo) + initial("YES") + } + field(DISS,DBF_MENU) { + prompt("Disable Alarm Sevrty") + promptgroup("70 - Alarm") + interest(1) + menu(menuAlarmSevr) + } + field(LCNT,DBF_UCHAR) { + prompt("Lock Count") + special(SPC_NOMOD) + interest(2) + } + field(PACT,DBF_UCHAR) { + prompt("Record active") + special(SPC_NOMOD) + interest(1) + } + field(PUTF,DBF_UCHAR) { + prompt("dbPutField process") + special(SPC_NOMOD) + interest(1) + } + field(RPRO,DBF_UCHAR) { + prompt("Reprocess ") + special(SPC_NOMOD) + interest(1) + } + field(ASP,DBF_NOACCESS) { + prompt("Access Security Pvt") + special(SPC_NOMOD) + interest(4) + extra("struct asgMember *asp") + } + field(PPN,DBF_NOACCESS) { + prompt("pprocessNotify") + special(SPC_NOMOD) + interest(4) + extra("struct processNotify *ppn") + } + field(PPNR,DBF_NOACCESS) { + prompt("pprocessNotifyRecord") + special(SPC_NOMOD) + interest(4) + extra("struct processNotifyRecord *ppnr") + } + field(SPVT,DBF_NOACCESS) { + prompt("Scan Private") + special(SPC_NOMOD) + interest(4) + extra("struct scan_element *spvt") + } + +=head3 Device Fields + +The B field contains the address of the Record Support Entry Table. See +the Application Developers Guide for details on usage. + +The B field contains the address of Device Support Entry Table. The +value of this field is determined at IOC initialization time. Record support +routines use this field to locate their device support routines. + +The B field is is for private use of the device support modules. + +=fields RSET, DSET, DPVT + +=cut + + field(RSET,DBF_NOACCESS) { + prompt("Address of RSET") + special(SPC_NOMOD) + interest(4) + extra("struct typed_rset *rset") + } + %#include "devSup.h" + field(DSET,DBF_NOACCESS) { + prompt("DSET address") + special(SPC_NOMOD) + interest(4) + extra("unambiguous_dset *dset") + } + field(DPVT,DBF_NOACCESS) { + prompt("Device Private") + special(SPC_NOMOD) + interest(4) + extra("void *dpvt") + } + field(RDES,DBF_NOACCESS) { + prompt("Address of dbRecordType") + special(SPC_NOMOD) + interest(4) + extra("struct dbRecordType *rdes") + } + field(LSET,DBF_NOACCESS) { + prompt("Lock Set") + special(SPC_NOMOD) + interest(4) + extra("struct lockRecord *lset") + } + field(PRIO,DBF_MENU) { + prompt("Scheduling Priority") + promptgroup("20 - Scan") + special(SPC_SCAN) + interest(1) + menu(menuPriority) + } + +=head3 Debugging Fields + +The B field is used for trace processing. If this field is non-zero a +message is printed whenever this record is processed, and when any other +record in the same lock-set is processed by a database link from this record. + +The B field indicates if there is a breakpoint set at this record. This +supports setting a debug breakpoint in the record processing. STEP through +database processing can be supported using this. + +=fields TPRO, BKPT + + +=head3 Miscellaneous Fields + +The B field contains a character string value defining the access +security group for this record. If left empty, the record is placed in group +DEFAULT. + +The B field is a field for private use of the access security system. + +The B field controls dbPutFields to this record which are normally +issued by channel access. If the field is set to TRUE all dbPutFields +directed to this record are ignored except to the field DISP itself. + +The B field specifies the device type for the record. Each record type +has its own set of device support routines which are specified in +devSup.ASCII. If a record type does not have any associated device support, +DTYP and DSET are meaningless. + +The B field contains the monitor lock. The lock used by the monitor +routines when the monitor list is being used. The list is locked whenever +monitors are being scheduled, invoked, or when monitors are being added to or +removed from the list. This field is accessed only by the dbEvent routines. + +The B field is the head of the list of monitors connected to this +record. Each record support module is responsible for triggering monitors for +any fields that change as a result of record processing. Monitors are present +if mlis count is greater than zero. The call to trigger monitors is: +db_post_event(precord,&data,mask), where "mask" is some combination of +DBE_ALARM, DBE_VALUE, and DBE_LOG. + +The B field contains the address of a putNotify callback. + +The B field contains the next record for PutNotify. + +The B field is set to TRUE if dbPutField caused the current record +processing. + +The B field contains the address of dbRecordType + +The B field specifies a reprocessing of the record when current +processing completes. + +The B