Compare commits
87 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
74a90d141b | ||
|
|
ed9d7550f2 | ||
|
|
87c68663f3 | ||
|
|
3881328f2f | ||
|
|
9722e707fd | ||
|
|
10e9db3710 | ||
|
|
ec31feea05 | ||
|
|
d0ff3c7672 | ||
|
|
178d5779a2 | ||
|
|
00334c981c | ||
|
|
5b5fd8004c | ||
|
|
c7db681e25 | ||
|
|
3ff62f4ddb | ||
|
|
b34859fb86 | ||
|
|
953dd2b7f9 | ||
|
|
3128fdb930 | ||
|
|
47f295fecb | ||
|
|
4816a3c04b | ||
|
|
e0950643bb | ||
|
|
252983efca | ||
|
|
7ca26c515a | ||
|
|
a961ca2fe5 | ||
|
|
a2fe07aa76 | ||
|
|
a69803f278 | ||
|
|
ee38b99e0f | ||
|
|
0a01c38698 | ||
|
|
9efefad955 | ||
|
|
0c62fc8d84 | ||
|
|
292dfe8e16 | ||
|
|
1c93726ee6 | ||
|
|
643d58fd04 | ||
|
|
f08b412a18 | ||
|
|
77574022a1 | ||
|
|
75a1b82322 | ||
|
|
73fec88168 | ||
|
|
2461dc3574 | ||
|
|
704e6251e6 | ||
|
|
f70c17ee69 | ||
|
|
96e3e678e9 | ||
|
|
9d4b652c5e | ||
|
|
0d3cc5a20a | ||
|
|
9255256f15 | ||
|
|
4685f7567b | ||
|
|
e5f8683144 | ||
|
|
4f63bf139f | ||
|
|
d7d142650b | ||
|
|
eac3d2719b | ||
|
|
a3d0699b84 | ||
|
|
a16bf2dc38 | ||
|
|
13936680e9 | ||
|
|
7b6c67b51b | ||
|
|
33febb52ba | ||
|
|
44149c170e | ||
|
|
db6825f62e | ||
|
|
6905ded0d0 | ||
|
|
4f31205188 | ||
|
|
90d9be1c00 | ||
|
|
b93f92c843 | ||
|
|
83458421aa | ||
|
|
89e3c582b5 | ||
|
|
623539c3e8 | ||
|
|
2a0df61974 | ||
|
|
6e3a15e318 | ||
|
|
86b1882186 | ||
|
|
03e613cec0 | ||
|
|
177c377b81 | ||
|
|
1cf831939a | ||
|
|
26cd81d35f | ||
|
|
31811e53b3 | ||
|
|
128d2a93c8 | ||
|
|
67583b4bda | ||
|
|
8a39ca7489 | ||
|
|
b9bc836d1e | ||
|
|
84c86e67e8 | ||
|
|
cac3e2dc3b | ||
|
|
8ff6ce4821 | ||
|
|
44ea66aaaf | ||
|
|
f79c69f0a0 | ||
|
|
e03c7edfe5 | ||
|
|
398fdee33e | ||
|
|
d3a8a49552 | ||
|
|
96998f55e0 | ||
|
|
b57f02ece2 | ||
|
|
b0db6568ea | ||
|
|
30812c23f0 | ||
|
|
5cfff383b2 | ||
|
|
deb9dbcd77 |
@@ -46,7 +46,6 @@ environment:
|
||||
- TOOLCHAIN: 14.0
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
|
||||
TOOLCHAIN: 2017
|
||||
- TOOLCHAIN: cygwin
|
||||
- TOOLCHAIN: mingw
|
||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||
|
||||
@@ -61,9 +60,6 @@ matrix:
|
||||
# VS Express installs don't have the 64 bit compiler
|
||||
- platform: x64
|
||||
TOOLCHAIN: 10.0
|
||||
# Cygwin static-debug has compiler problems
|
||||
- configuration: static-debug
|
||||
TOOLCHAIN: cygwin
|
||||
|
||||
|
||||
#---------------------------------#
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
:: Universal build script for AppVeyor (https://ci.appveyor.com/)
|
||||
:: Environment:
|
||||
:: TOOLCHAIN - toolchain version [10.0/11.0/12.0/14.0/2017/cygwin/mingw]
|
||||
:: TOOLCHAIN - toolchain version [10.0/11.0/12.0/14.0/2017/mingw]
|
||||
:: CONFIGURATION - determines EPICS build [dynamic/static]
|
||||
:: PLATFORM - architecture [x86/x64]
|
||||
::
|
||||
@@ -20,24 +20,6 @@ echo [INFO] Platform: %OS%
|
||||
set "MAKEARGS=-j2 -Otarget"
|
||||
if "%APPVEYOR_REPO_BRANCH%"=="3.14" set MAKEARGS=
|
||||
|
||||
if "%TOOLCHAIN%"=="cygwin" (
|
||||
set "MAKE=make"
|
||||
if "%OS%"=="64BIT" (
|
||||
set "EPICS_HOST_ARCH=cygwin-x86_64"
|
||||
set "INCLUDE=C:\cygwin64\include;%INCLUDE%"
|
||||
set "PATH=C:\cygwin64\bin;%PATH%"
|
||||
echo [INFO] Cygwin Toolchain 64bit
|
||||
) else (
|
||||
set "EPICS_HOST_ARCH=cygwin-x86"
|
||||
set "INCLUDE=C:\cygwin\include;%INCLUDE%"
|
||||
set "PATH=C:\cygwin\bin;%PATH%"
|
||||
echo [INFO] Cygwin Toolchain 32bit
|
||||
)
|
||||
echo [INFO] Compiler Version
|
||||
gcc -v
|
||||
goto Finish
|
||||
)
|
||||
|
||||
if "%TOOLCHAIN%"=="mingw" (
|
||||
set "MAKE=mingw32-make"
|
||||
if "%OS%"=="64BIT" (
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
:: Build script for AppVeyor (https://ci.appveyor.com/)
|
||||
:: Environment:
|
||||
:: TOOLCHAIN - Toolchain Version [9.0/10.0/11.0/12.0/14.0/cygwin/mingw]
|
||||
:: TOOLCHAIN - Toolchain Version [9.0/10.0/11.0/12.0/14.0/mingw]
|
||||
:: CONFIGURATION - determines EPICS build [dynamic/static, -debug]
|
||||
:: PLATFORM - "x86" -> use 32bit architecture
|
||||
::
|
||||
:: Prepares an Appveyor build by excuting the following steps
|
||||
:: - Set up configure\CONFIG_SITE for static vs. dynamic build
|
||||
:: - Install Cygwin / Mingw (TOOLCHAIN setting) in the in the appropriate flavor
|
||||
:: - Install Mingw (TOOLCHAIN setting) in the in the appropriate flavor
|
||||
:: - Download and install Make-4.1 from EPICS download page
|
||||
|
||||
Setlocal EnableDelayedExpansion
|
||||
@@ -16,31 +16,6 @@ if "%PLATFORM%"=="x86" set OS=32BIT
|
||||
|
||||
echo [INFO] Platform: %OS%
|
||||
|
||||
if "%TOOLCHAIN%"=="cygwin" (
|
||||
echo.%CONFIGURATION% | findstr /C:"static">nul && (
|
||||
echo SHARED_LIBRARIES=NO>> configure\CONFIG_SITE
|
||||
echo STATIC_BUILD=YES>> configure\CONFIG_SITE
|
||||
echo [INFO] EPICS set up for static build
|
||||
) || (
|
||||
echo [INFO] EPICS set up for dynamic build
|
||||
)
|
||||
echo.%CONFIGURATION% | findstr /C:"debug">nul && (
|
||||
echo HOST_OPT=NO>> configure\CONFIG_SITE
|
||||
echo [INFO] EPICS set up for debug build
|
||||
) || (
|
||||
echo [INFO] EPICS set up for optimized build
|
||||
)
|
||||
if "%OS%"=="64BIT" (
|
||||
echo [INFO] Installing Cygwin 64bit and dependencies
|
||||
@powershell -Command "(new-object net.webclient).DownloadFile('http://www.cygwin.com/setup-x86_64.exe', 'C:\cygwin64\setup-x86_64.exe')"
|
||||
C:\cygwin64\setup-x86_64.exe -q -P "libreadline-devel,libncursesw-devel"
|
||||
) else (
|
||||
echo [INFO] Installing Cygwin 32bit and dependencies
|
||||
@powershell -Command "(new-object net.webclient).DownloadFile('http://www.cygwin.com/setup-x86.exe', 'C:\cygwin\setup-x86.exe')"
|
||||
C:\cygwin\setup-x86.exe -q -P "libreadline-devel,libncursesw-devel"
|
||||
)
|
||||
)
|
||||
|
||||
if "%TOOLCHAIN%"=="mingw" (
|
||||
echo.%CONFIGURATION% | findstr /C:"static">nul && (
|
||||
echo SHARED_LIBRARIES=NO>> configure\CONFIG_SITE
|
||||
|
||||
@@ -69,6 +69,7 @@ REGISTERRECORDDEVICEDRIVER = $(PERL) $(TOOLS)/registerRecordDeviceDriver.pl
|
||||
CONVERTRELEASE = $(PERL) $(call FIND_TOOL,convertRelease.pl)
|
||||
FULLPATHNAME = $(PERL) $(TOOLS)/fullPathName.pl
|
||||
TAPTOJUNIT = $(PERL) $(TOOLS)/tap-to-junit-xml.pl
|
||||
PROVE = $(PERL) $(TOOLS)/epicsProve.pl
|
||||
|
||||
#-------------------------------------------------------
|
||||
# tools for installing libraries and products
|
||||
|
||||
@@ -27,14 +27,14 @@ EPICS_VERSION = 3
|
||||
EPICS_REVISION = 15
|
||||
|
||||
# EPICS_MODIFICATION must be a number >=0 and <256
|
||||
EPICS_MODIFICATION = 6
|
||||
EPICS_MODIFICATION = 7
|
||||
|
||||
# EPICS_PATCH_LEVEL must be a number (win32 resource file requirement)
|
||||
# Not included if zero
|
||||
EPICS_PATCH_LEVEL = 0
|
||||
|
||||
# This will end in -DEV between official releases
|
||||
EPICS_DEV_SNAPSHOT=-DEV
|
||||
#EPICS_DEV_SNAPSHOT=-DEV
|
||||
#EPICS_DEV_SNAPSHOT=-pre1
|
||||
#EPICS_DEV_SNAPSHOT=-pre1-DEV
|
||||
#EPICS_DEV_SNAPSHOT=-pre2
|
||||
@@ -43,7 +43,7 @@ EPICS_DEV_SNAPSHOT=-DEV
|
||||
#EPICS_DEV_SNAPSHOT=-rc1-DEV
|
||||
#EPICS_DEV_SNAPSHOT=-rc2
|
||||
#EPICS_DEV_SNAPSHOT=-rc2-DEV
|
||||
#EPICS_DEV_SNAPSHOT=
|
||||
EPICS_DEV_SNAPSHOT=
|
||||
|
||||
# No changes should be needed below here
|
||||
|
||||
|
||||
@@ -24,40 +24,41 @@
|
||||
|
||||
# Site-specific environment settings
|
||||
|
||||
# Time service:
|
||||
# EPICS_TIMEZONE
|
||||
# Local timezone info for vxWorks and RTEMS. The format is
|
||||
# <name>::<minutesWest>:<startDST>:<endDST>
|
||||
# where <name> is only used by strftime() for %Z conversions,
|
||||
# and <startDST> and <endDST> are mmddhh - that is month,day,hour
|
||||
# e.g. for ANL in 2018: EPICS_TIMEZONE=CUS::360:031102:110402
|
||||
# The future dates below assume the rules don't get changed;
|
||||
# see http://www.timeanddate.com/time/dst/2018.html to check.
|
||||
#
|
||||
# DST for 2018 US: Mar 11 - Nov 04
|
||||
# EU: Mar 25 - Oct 28
|
||||
EPICS_TIMEZONE = CUS::360:031102:110402
|
||||
#EPICS_TIMEZONE = MET::-60:032502:102803
|
||||
#
|
||||
# DST for 2019 US: Mar 10 - Nov 03
|
||||
# EU: Mar 31 - Oct 27
|
||||
#EPICS_TIMEZONE = CUS::360:031002:110302
|
||||
#EPICS_TIMEZONE = MET::-60:033102:102703
|
||||
#
|
||||
# DST for 2020 US: Mar 08 - Nov 01
|
||||
# EU: Mar 29 - Oct 25
|
||||
#EPICS_TIMEZONE = CUS::360:030802:110102
|
||||
#EPICS_TIMEZONE = MET::-60:032902:102503
|
||||
#
|
||||
# DST for 2021 US: Mar 14 - Nov 07
|
||||
# EU: Mar 28 - Oct 31
|
||||
#EPICS_TIMEZONE = CUS::360:031402:110702
|
||||
#EPICS_TIMEZONE = MET::-60:032802:103103
|
||||
#
|
||||
# DST for 2022 US: Mar 13 - Nov 06
|
||||
# EU: Mar 27 - Oct 30
|
||||
#EPICS_TIMEZONE = CUS::360:031302:110602
|
||||
#EPICS_TIMEZONE = MET::-60:032702:103003
|
||||
## Time service:
|
||||
# EPICS_TZ
|
||||
# Local timezone rules for vxWorks and RTEMS. The value follows the Posix
|
||||
# TZ environment variable's Mm.n.d/h format (see the IBM link below for
|
||||
# details). If TZ hasn't already been set when the osdTime timeRegister()
|
||||
# C++ static constructor runs, this parameter will be copied into the TZ
|
||||
# environment variable. Once the OS clock has been synchronized to NTP the
|
||||
# routine tz2timezone() will be run to convert TZ into the TIMEZONE
|
||||
# variable format that VxWorks needs.
|
||||
# https://developer.ibm.com/articles/au-aix-posix/
|
||||
|
||||
# Japan Standard Time, no DST:
|
||||
#EPICS_TZ = "JST-9"
|
||||
|
||||
# Central European (Summer) Time:
|
||||
#EPICS_TZ = "CET-1CEST,M3.5.0/2,M10.5.0/3"
|
||||
|
||||
# Greenwich Mean/British Summer Time:
|
||||
#EPICS_TZ = "GMT0BST,M3.5.0/1,M10.5.0/2"
|
||||
|
||||
# US Eastern Standard/Daylight Time:
|
||||
#EPICS_TZ = "EST5EDT,M3.2.0/2,M11.1.0/2"
|
||||
|
||||
# US Central Standard/Daylight Time:
|
||||
EPICS_TZ = "CST6CDT,M3.2.0/2,M11.1.0/2"
|
||||
|
||||
# US Mountain Standard/Daylight Time:
|
||||
#EPICS_TZ = "MST7MDT,M3.2.0/2,M11.1.0/2"
|
||||
|
||||
# US Pacific Standard/Daylight Time:
|
||||
#EPICS_TZ = "PST8PDT,M3.2.0/2,M11.1.0/2"
|
||||
|
||||
# US Hawaiian Standard Time, no DST:
|
||||
#EPICS_TZ = "HST10"
|
||||
|
||||
|
||||
# EPICS_TS_NTP_INET
|
||||
# NTP time server ip address for VxWorks and RTEMS.
|
||||
|
||||
@@ -351,7 +351,7 @@ testspec: $(TESTSCRIPTS)
|
||||
test-results: tapfiles
|
||||
ifneq ($(TAPFILES),)
|
||||
ifdef RUNTESTS_ENABLED
|
||||
prove --failures --ext .tap --exec "$(CAT)" --color $(TAPFILES)
|
||||
$(PROVE) --failures --ext .tap --exec "$(CAT)" --color $(TAPFILES)
|
||||
endif
|
||||
|
||||
CURRENT_TAPFILES := $(wildcard $(TAPFILES))
|
||||
|
||||
@@ -1,39 +1,35 @@
|
||||
# CONFIG_SITE.Common.linux-arm
|
||||
#
|
||||
# Site Specific definitions for all linux-arm targets
|
||||
#-------------------------------------------------------
|
||||
# Site-specific settings for the linux-arm target
|
||||
|
||||
# NOTE for SHARED_LIBRARIES: In most cases if this is set to YES the
|
||||
# NOTE: In most cases if SHARED_LIBRARIES is set to YES the
|
||||
# shared libraries will be found automatically. However if the .so
|
||||
# files are installed at a different path to their compile-time path
|
||||
# then in order to be found at runtime do one of these:
|
||||
# a) LD_LIBRARY_PATH must include the full absolute pathname to
|
||||
# $(INSTALL_LOCATION)/lib/$(EPICS_HOST_ARCH) when invoking base
|
||||
# executables.
|
||||
# b) Add the runtime path to SHRLIB_DEPLIB_DIRS and PROD_DEPLIB_DIRS, which
|
||||
# b) Add the runtime path to SHRLIB_DEPLIB_DIRS and PROD_DEPLIB_DIRS, which
|
||||
# will add the named directory to the list contained in the executables.
|
||||
# c) Add the runtime path to /etc/ld.so.conf and run ldconfig
|
||||
# to inform the system of the shared library location.
|
||||
|
||||
# Depending on your version of Linux you'll want one of the following
|
||||
# lines to enable command-line editing and history in iocsh. If you're
|
||||
# not sure which, start with the top one and work downwards until the
|
||||
# build doesn't fail to link the readline library. If none of them work,
|
||||
# comment them all out to build without readline support.
|
||||
|
||||
# No other libraries needed (recent Fedora, Ubuntu etc.):
|
||||
#COMMANDLINE_LIBRARY = READLINE
|
||||
# Use GNU Readline if the header file is installed
|
||||
COMMANDLINE_LIBRARY = $(strip $(if $(wildcard \
|
||||
$(firstword $(READLINE_DIR) $(GNU_DIR))/include/readline/readline.h), \
|
||||
READLINE, EPICS))
|
||||
|
||||
# Needs -lncurses (RHEL 5 etc.):
|
||||
# If libreadline needs additional libraries to be linked with it, try
|
||||
# uncommenting each of the lines below in turn, starting with the top
|
||||
# one and working downwards, until the build succeeds. Do a 'make rebuild'
|
||||
# from the top of the Base tree after changing this setting.
|
||||
|
||||
# Needs -lncurses:
|
||||
#COMMANDLINE_LIBRARY = READLINE_NCURSES
|
||||
|
||||
# Needs -lcurses (older versions)
|
||||
# Needs -lcurses:
|
||||
#COMMANDLINE_LIBRARY = READLINE_CURSES
|
||||
|
||||
|
||||
# It makes sense to include debugging symbols even in optimized builds
|
||||
# in case you want to attach gdb to the process or examine a core-dump.
|
||||
# This does cost disk space, but not memory as debug symbols are not
|
||||
# loaded into RAM when the binary is loaded.
|
||||
OPT_CFLAGS_YES += -g
|
||||
OPT_CXXFLAGS_YES += -g
|
||||
# Readline is broken or you don't want use it:
|
||||
#COMMANDLINE_LIBRARY = EPICS
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
# CONFIG_SITE.Common.linux-cris
|
||||
#
|
||||
# Site Specific definitions for linux-cris target
|
||||
# Only the local epics system manager should modify this file
|
||||
# Site-specific settings for the linux-cris target
|
||||
|
||||
# NOTE for SHARED_LIBRARIES: In most cases if this is set to YES the
|
||||
# NOTE: In most cases if SHARED_LIBRARIES is set to YES the
|
||||
# shared libraries will be found automatically. However if the .so
|
||||
# files are installed at a different path to their compile-time path
|
||||
# then in order to be found at runtime do one of these:
|
||||
@@ -15,21 +14,21 @@
|
||||
# c) Add the runtime path to /etc/ld.so.conf and run ldconfig
|
||||
# to inform the system of the shared library location.
|
||||
|
||||
# Depending on your version of Linux you may want one of the following
|
||||
# lines to enable command-line editing and history in iocsh. If you're
|
||||
# not sure which, start with the top one and work downwards until the
|
||||
# build doesn't fail to link the readline library. If none of them work,
|
||||
# comment them all out to build without readline support.
|
||||
|
||||
# No other libraries needed (recent Fedora, Ubuntu etc.):
|
||||
#COMMANDLINE_LIBRARY = READLINE
|
||||
# Use GNU Readline if the header file is installed
|
||||
COMMANDLINE_LIBRARY = $(strip $(if $(wildcard \
|
||||
$(GNU_DIR)/include/readline/readline.h), READLINE, EPICS))
|
||||
|
||||
# Needs -lncurses (RHEL 5 etc.):
|
||||
# If libreadline needs additional libraries to be linked with it, try
|
||||
# uncommenting each of the lines below in turn, starting with the top
|
||||
# one and working downwards, until the build succeeds. Do a 'make rebuild'
|
||||
# from the top of the Base tree after changing this setting.
|
||||
|
||||
# Needs -lncurses:
|
||||
#COMMANDLINE_LIBRARY = READLINE_NCURSES
|
||||
|
||||
# Needs -lcurses (older versions)
|
||||
# Needs -lcurses:
|
||||
#COMMANDLINE_LIBRARY = READLINE_CURSES
|
||||
|
||||
|
||||
OP_SYS_CFLAGS += -g
|
||||
|
||||
# Readline is broken or you don't want use it:
|
||||
#COMMANDLINE_LIBRARY = EPICS
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
# CONFIG_SITE.Common.linux-microblaze
|
||||
#
|
||||
# Site specific definitions for linux-microblaze target builds.
|
||||
#-------------------------------------------------------
|
||||
# Site-specific settings for the linux-microblaze target
|
||||
|
||||
# The gnu tools for cross compiling for MicroBlaze (little endian)
|
||||
# on Linux can be downloaded from the Xilinx git server:
|
||||
@@ -12,3 +11,21 @@
|
||||
|
||||
GNU_DIR = /usr/local/vw/microblaze-2.0/microblazeel-unknown-linux-gnu
|
||||
|
||||
|
||||
# Use GNU Readline if the header file is installed
|
||||
COMMANDLINE_LIBRARY = $(strip $(if $(wildcard \
|
||||
$(GNU_DIR)/include/readline/readline.h), READLINE, EPICS))
|
||||
|
||||
# If libreadline needs additional libraries to be linked with it, try
|
||||
# uncommenting each of the lines below in turn, starting with the top
|
||||
# one and working downwards, until the build succeeds. Do a 'make rebuild'
|
||||
# from the top of the Base tree after changing this setting.
|
||||
|
||||
# Needs -lncurses:
|
||||
#COMMANDLINE_LIBRARY = READLINE_NCURSES
|
||||
|
||||
# Needs -lcurses:
|
||||
#COMMANDLINE_LIBRARY = READLINE_CURSES
|
||||
|
||||
# Readline is broken or you don't want use it:
|
||||
#COMMANDLINE_LIBRARY = EPICS
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
# CONFIG_SITE.Common.linux-x86
|
||||
#
|
||||
# Site Specific definitions for linux-x86 target
|
||||
# Only the local epics system manager should modify this file
|
||||
# Site-specific settings for the linux-x86 target
|
||||
|
||||
# NOTE for SHARED_LIBRARIES: In most cases if this is set to YES the
|
||||
# NOTE: In most cases if SHARED_LIBRARIES is set to YES the
|
||||
# shared libraries will be found automatically. However if the .so
|
||||
# files are installed at a different path to their compile-time path
|
||||
# then in order to be found at runtime do one of these:
|
||||
@@ -15,14 +14,15 @@
|
||||
# c) Add the runtime path to /etc/ld.so.conf and run ldconfig
|
||||
# to inform the system of the shared library location.
|
||||
|
||||
# Depending on your version of Linux you'll want one of the following
|
||||
# lines to enable command-line editing and history in iocsh. If you're
|
||||
# not sure which, start with the top one and work downwards until the
|
||||
# build doesn't fail to link the readline library. If none of them work,
|
||||
# comment them all out to build without readline support.
|
||||
|
||||
# No other libraries needed (recent Fedora, Ubuntu etc.):
|
||||
COMMANDLINE_LIBRARY = READLINE
|
||||
# Use GNU Readline if the header file is installed
|
||||
COMMANDLINE_LIBRARY = $(strip $(if $(wildcard \
|
||||
$(GNU_DIR)/include/readline/readline.h), READLINE, EPICS))
|
||||
|
||||
# If libreadline needs additional libraries to be linked with it, try
|
||||
# uncommenting each of the lines below in turn, starting with the top
|
||||
# one and working downwards, until the build succeeds. Do a 'make rebuild'
|
||||
# from the top of the Base tree after changing this setting.
|
||||
|
||||
# Needs -lncurses (RHEL 5 etc.):
|
||||
#COMMANDLINE_LIBRARY = READLINE_NCURSES
|
||||
@@ -30,6 +30,9 @@ COMMANDLINE_LIBRARY = READLINE
|
||||
# Needs -lcurses (older versions)
|
||||
#COMMANDLINE_LIBRARY = READLINE_CURSES
|
||||
|
||||
# Readline is broken or you don't want use it:
|
||||
#COMMANDLINE_LIBRARY = EPICS
|
||||
|
||||
|
||||
# Permit access to 64-bit file-systems
|
||||
OP_SYS_CFLAGS += -D_FILE_OFFSET_BITS=64
|
||||
@@ -43,14 +46,6 @@ OP_SYS_CFLAGS += -D_FILE_OFFSET_BITS=64
|
||||
#CCC = clang++
|
||||
|
||||
|
||||
# It makes sense to include debugging symbols even in optimized builds
|
||||
# in case you want to attach gdb to the process or examine a core-dump.
|
||||
# This does cost disk space, but not memory as debug symbols are not
|
||||
# loaded into RAM when the binary is loaded.
|
||||
OPT_CFLAGS_YES += -g
|
||||
OPT_CXXFLAGS_YES += -g
|
||||
|
||||
|
||||
# Tune GNU compiler output for a specific 32-bit cpu-type
|
||||
# (e.g. generic, native, i386, i686, pentium2/3/4, prescott, k6, athlon etc.)
|
||||
GNU_TUNE_CFLAGS = -mtune=generic
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
# CONFIG_SITE.Common.linux-x86_64
|
||||
#
|
||||
# Site Specific definitions for linux-x86_64 target
|
||||
# Only the local epics system manager should modify this file
|
||||
# Site-specific settings for the linux-x86_64 target
|
||||
|
||||
# NOTE for SHARED_LIBRARIES: In most cases if this is set to YES the
|
||||
# NOTE: In most cases if SHARED_LIBRARIES is set to YES the
|
||||
# shared libraries will be found automatically. However if the .so
|
||||
# files are installed at a different path to their compile-time path
|
||||
# then in order to be found at runtime do one of these:
|
||||
@@ -15,14 +14,15 @@
|
||||
# c) Add the runtime path to /etc/ld.so.conf and run ldconfig
|
||||
# to inform the system of the shared library location.
|
||||
|
||||
# Depending on your version of Linux you'll want one of the following
|
||||
# lines to enable command-line editing and history in iocsh. If you're
|
||||
# not sure which, start with the top one and work downwards until the
|
||||
# build doesn't fail to link the readline library. If none of them work,
|
||||
# comment them all out to build without readline support.
|
||||
|
||||
# No other libraries needed (recent Fedora, Ubuntu etc.):
|
||||
COMMANDLINE_LIBRARY = READLINE
|
||||
# Use GNU Readline if the header file is installed
|
||||
COMMANDLINE_LIBRARY = $(strip $(if $(wildcard \
|
||||
$(GNU_DIR)/include/readline/readline.h), READLINE, EPICS))
|
||||
|
||||
# If libreadline needs additional libraries to be linked with it, try
|
||||
# uncommenting each of the lines below in turn, starting with the top
|
||||
# one and working downwards, until the build succeeds. Do a 'make rebuild'
|
||||
# from the top of the Base tree after changing this setting.
|
||||
|
||||
# Needs -lncurses (RHEL 5 etc.):
|
||||
#COMMANDLINE_LIBRARY = READLINE_NCURSES
|
||||
@@ -30,6 +30,9 @@ COMMANDLINE_LIBRARY = READLINE
|
||||
# Needs -lcurses (older versions)
|
||||
#COMMANDLINE_LIBRARY = READLINE_CURSES
|
||||
|
||||
# Readline is broken or you don't want use it:
|
||||
#COMMANDLINE_LIBRARY = EPICS
|
||||
|
||||
|
||||
# Uncomment the followings lines to build with CLANG instead of GCC.
|
||||
#
|
||||
@@ -39,14 +42,6 @@ COMMANDLINE_LIBRARY = READLINE
|
||||
#CCC = clang++
|
||||
|
||||
|
||||
# It makes sense to include debugging symbols even in optimized builds
|
||||
# in case you want to attach gdb to the process or examine a core-dump.
|
||||
# This does cost disk space, but not memory as debug symbols are not
|
||||
# loaded into RAM when the binary is loaded.
|
||||
OPT_CFLAGS_YES += -g
|
||||
OPT_CXXFLAGS_YES += -g
|
||||
|
||||
|
||||
# Tune GNU compiler output for a specific 64-bit cpu-type
|
||||
# (e.g. generic, native, core2, nocona, k8, opteron, athlon64, barcelona etc.)
|
||||
GNU_TUNE_CFLAGS = -mtune=generic
|
||||
|
||||
@@ -1,4 +1,23 @@
|
||||
# CONFIG_SITE.Common.linux-xscale_be
|
||||
#
|
||||
# Site specific definitions for all linux-xscale_be target builds.
|
||||
#-------------------------------------------------------
|
||||
# Site-specific settings for the linux-xscale_be target
|
||||
|
||||
|
||||
# Use GNU Readline if the header file is installed
|
||||
COMMANDLINE_LIBRARY = $(strip $(if $(wildcard \
|
||||
$(firstword $(READLINE_DIR) $(GNU_DIR))/include/readline/readline.h), \
|
||||
READLINE, EPICS))
|
||||
|
||||
# If libreadline needs additional libraries to be linked with it, try
|
||||
# uncommenting each of the lines below in turn, starting with the top
|
||||
# one and working downwards, until the build succeeds. Do a 'make rebuild'
|
||||
# from the top of the Base tree after changing this setting.
|
||||
|
||||
# Needs -lncurses:
|
||||
#COMMANDLINE_LIBRARY = READLINE_NCURSES
|
||||
|
||||
# Needs -lcurses:
|
||||
#COMMANDLINE_LIBRARY = READLINE_CURSES
|
||||
|
||||
# Readline is broken or you don't want use it:
|
||||
#COMMANDLINE_LIBRARY = EPICS
|
||||
|
||||
11
configure/os/CONFIG_SITE.Common.linuxCommon
Normal file
11
configure/os/CONFIG_SITE.Common.linuxCommon
Normal file
@@ -0,0 +1,11 @@
|
||||
# CONFIG_SITE.Common.linuxCommon
|
||||
#
|
||||
# Site-specific settings for all linux targets
|
||||
|
||||
|
||||
# It makes sense to include debugging symbols even in optimized builds
|
||||
# in case you want to attach gdb to the process or examine a core-dump.
|
||||
# This does cost disk space, but not memory as debug symbols are not
|
||||
# loaded into RAM when the binary is loaded.
|
||||
OPT_CFLAGS_YES += -g
|
||||
OPT_CXXFLAGS_YES += -g
|
||||
@@ -4,17 +4,17 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
<title>Known Problems in R3.15.6</title>
|
||||
<title>Known Problems in R3.15.7</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1 style="text-align: center">EPICS Base R3.15.6: Known Problems</h1>
|
||||
<h1 style="text-align: center">EPICS Base R3.15.7: Known Problems</h1>
|
||||
|
||||
<p>Any patch files linked below should be applied at the root of the
|
||||
base-3.15.6 tree. Download them, then use the GNU Patch program as
|
||||
base-3.15.7 tree. Download them, then use the GNU Patch program as
|
||||
follows:</p>
|
||||
|
||||
<blockquote><pre>% <b>cd <i>/path/to/</i>base-3.15.6</b>
|
||||
<blockquote><pre>% <b>cd <i>/path/to/</i>base-3.15.7</b>
|
||||
% <b>patch -p1 < <i>/path/to/</i>file.patch</b></pre></blockquote>
|
||||
|
||||
<p>The following significant problems have been reported with this
|
||||
|
||||
@@ -1,346 +0,0 @@
|
||||
Installation Instructions
|
||||
|
||||
EPICS Base Release 3.15.6
|
||||
|
||||
--------------------------------------------------------------------------
|
||||
|
||||
Table of Contents
|
||||
|
||||
* What is EPICS base?
|
||||
* What is new in this release?
|
||||
* Copyright
|
||||
* Supported platforms
|
||||
* Supported compilers
|
||||
* Software requirements
|
||||
* Host system storage requirements
|
||||
* Documentation
|
||||
* Directory Structure
|
||||
* Build related components
|
||||
* Building EPICS base (Unix and Win32)
|
||||
* Example application and extension
|
||||
* Multiple host platforms
|
||||
|
||||
--------------------------------------------------------------------------
|
||||
|
||||
What is EPICS base?
|
||||
|
||||
The Experimental Physics and Industrial Control Systems (EPICS) is an
|
||||
extensible set of software components and tools with which application
|
||||
developers can create a control system. This control system can be used
|
||||
to control accelerators, detectors, telescopes, or other scientific
|
||||
experimental equipment. EPICS base is the set of core software, i.e. the
|
||||
components of EPICS without which EPICS would not function. EPICS base
|
||||
allows an arbitrary number of target systems, IOCs (input/output
|
||||
controllers), and host systems, OPIs (operator interfaces) of various
|
||||
types.
|
||||
|
||||
What is new in this release?
|
||||
|
||||
Please check the RELEASE_NOTES file in the distribution for description
|
||||
of changes and release migration details.
|
||||
|
||||
Copyright
|
||||
|
||||
Please review the LICENSE file included in the distribution for legal
|
||||
terms of usage.
|
||||
|
||||
Supported platforms
|
||||
|
||||
The list of platforms supported by this version of EPICS base is given
|
||||
in the configure/CONFIG_SITE file. If you are trying to build EPICS Base
|
||||
on an unlisted host or for a different target machine you must have the
|
||||
proper host/target cross compiler and header files, and you will have to
|
||||
create and add the appropriate new configure files to the
|
||||
base/configure/os/directory. You can start by copying existing
|
||||
configuration files in the configure/os directory and then make changes
|
||||
for your new platforms.
|
||||
|
||||
Supported compilers
|
||||
|
||||
This version of EPICS base has been built and tested using the host
|
||||
vendor's C and C++ compilers, as well as the GNU gcc and g++ compilers.
|
||||
The GNU cross-compilers work for all cross-compiled targets. You may
|
||||
need the C and C++ compilers to be in your search path to do EPICS
|
||||
builds; check the definitions of CC and CCC in
|
||||
base/configure/os/CONFIG.<host>.<host> if you have problems.
|
||||
|
||||
Software requirements
|
||||
|
||||
GNU make
|
||||
You must use GNU make, gnumake, for any EPICS builds. Set your path so
|
||||
that a gnumake version 3.81 or later is available.
|
||||
|
||||
Perl
|
||||
You must have Perl version 5.8.1 or later installed. The EPICS
|
||||
configuration files do not specify the perl full pathname, so the perl
|
||||
executable must be found through your normal search path.
|
||||
|
||||
Unzip and tar (Winzip on WIN32 systems)
|
||||
You must have tools available to unzip and untar the EPICS base
|
||||
distribution file.
|
||||
|
||||
Target systems
|
||||
EPICS supports IOCs running on embedded platforms such as VxWorks and
|
||||
RTEMS built using a cross-compiler, and also supports soft IOCs running
|
||||
as processes on the host platform.
|
||||
|
||||
vxWorks
|
||||
You must have vxWorks 5.5.x or 6.x installed if any of your target
|
||||
systems are vxWorks systems; the C++ compiler for vxWorks 5.4 is now too
|
||||
old to support. The vxWorks installation provides the cross-compiler and
|
||||
header files needed to build for these targets. The absolute path to and
|
||||
the version number of the vxWorks installation must be set in the
|
||||
base/configure/os/CONFIG_SITE.Common.vxWorksCommon file or in one of its
|
||||
target-specific overrides.
|
||||
|
||||
Consult the vxWorks 5.x or vxWorks 6.x EPICS web pages about and the
|
||||
vxWorks documentation for information about configuring your vxWorks
|
||||
operating system for use with EPICS.
|
||||
|
||||
RTEMS
|
||||
For RTEMS targets, you need RTEMS core and toolset version 4.9.2 or
|
||||
later.
|
||||
|
||||
GNU readline or Tecla library
|
||||
GNU readline and Tecla libraries can be used by the IOC shell to provide
|
||||
command line editing and command line history recall and edit. GNU
|
||||
readline (or Tecla library) must be installed on your target system when
|
||||
COMMANDLINE_LIBRARY is set to READLINE (or TECLA) for that target. EPICS
|
||||
(EPICS shell) is the default specified in CONFIG_COMMON. A READLINE
|
||||
override is defined for linux-x86 in the EPICS distribution. Comment out
|
||||
COMMANDLINE_LIBRARY=READLINE in
|
||||
configure/os/CONFIG_SITE.Common.linux-x86 if readline is not installed
|
||||
on linux-x86. Command-line editing and history will then be those
|
||||
supplied by the os. On vxWorks the ledLib command-line input library is
|
||||
used instead.
|
||||
|
||||
Host system storage requirements
|
||||
|
||||
The compressed tar file is approximately 1.6 MB in size. The
|
||||
distribution source tree takes up approximately 12 MB. Each host target
|
||||
will need around 40 MB for build files, and each cross-compiled target
|
||||
around 20 MB.
|
||||
|
||||
Documentation
|
||||
|
||||
EPICS documentation is available through the EPICS website at Argonne.
|
||||
|
||||
Release specific documentation can also be found in the
|
||||
base/documentation directory of the distribution.
|
||||
|
||||
Directory Structure
|
||||
|
||||
Distribution directory structure:
|
||||
|
||||
base Root directory of the base distribution
|
||||
base/configure Operating system independent build config files
|
||||
base/configure/os Operating system dependent build config files
|
||||
base/documentation Distribution documentation
|
||||
base/src Source code in various subdirectories
|
||||
base/startup Scripts for setting up path and environment
|
||||
|
||||
Install directories created by the build:
|
||||
|
||||
bin Installed scripts and executables in subdirs
|
||||
cfg Installed build configuration files
|
||||
db Installed data bases
|
||||
dbd Installed data base definitions
|
||||
doc Installed documentation files
|
||||
html Installed html documentation
|
||||
include Installed header files
|
||||
include/os Installed os specific header files in subdirs
|
||||
include/compiler Installed compiler-specific header files
|
||||
lib Installed libraries in arch subdirectories
|
||||
lib/perl Installed perl modules
|
||||
templates Installed templates
|
||||
|
||||
Build related components
|
||||
|
||||
base/documentation directory - contains setup, build, and install documents
|
||||
|
||||
README.1st Instructions for setup and building epics base
|
||||
README.html html version of README.1st
|
||||
README.darwin.html Installation notes for Mac OS X (Darwin)
|
||||
RELEASE_NOTES.html Notes on release changes
|
||||
KnownProblems.html List of known problems and workarounds
|
||||
|
||||
base/startup directory - contains scripts to set environment and path
|
||||
|
||||
EpicsHostArch Shell script to set EPICS_HOST_ARCH env variable
|
||||
unix.csh C shell script to set path and env variables
|
||||
unix.sh Bourne shell script to set path and env variables
|
||||
win32.bat Bat file example to configure win32-x86 target
|
||||
windows.bat Bat file example to configure windows-x64 target
|
||||
|
||||
base/configure directory - contains build definitions and rules
|
||||
|
||||
CONFIG Includes configure files and allows variable overrides
|
||||
CONFIG.CrossCommon Cross build definitions
|
||||
CONFIG.gnuCommon Gnu compiler build definitions for all archs
|
||||
CONFIG_ADDONS Definitions for <osclass> and DEFAULT options
|
||||
CONFIG_APP_INCLUDE
|
||||
CONFIG_BASE EPICS base tool and location definitions
|
||||
CONFIG_BASE_VERSION Definitions for EPICS base version number
|
||||
CONFIG_COMMON Definitions common to all builds
|
||||
CONFIG_ENV Definitions of EPICS environment variables
|
||||
CONFIG_FILE_TYPE
|
||||
CONFIG_SITE Site specific make definitions
|
||||
CONFIG_SITE_ENV Site defaults for EPICS environment variables
|
||||
MAKEFILE Installs CONFIG* RULES* creates
|
||||
RELEASE Location of external products
|
||||
RULES Includes appropriate rules file
|
||||
RULES.Db Rules for database and database definition files
|
||||
RULES.ioc Rules for application iocBoot/ioc* directory
|
||||
RULES_ARCHS Definitions and rules for building architectures
|
||||
RULES_BUILD Build and install rules and definitions
|
||||
RULES_DIRS Definitions and rules for building subdirectories
|
||||
RULES_EXPAND
|
||||
RULES_FILE_TYPE
|
||||
RULES_TARGET
|
||||
RULES_TOP Rules specific to a <top> dir (uninstall and tar)
|
||||
Sample.Makefile Sample makefile with comments
|
||||
|
||||
base/configure/os directory - contains os-arch specific definitions
|
||||
|
||||
CONFIG.<host>.<target> Specific host-target build definitions
|
||||
CONFIG.Common.<target> Specific target definitions for all hosts
|
||||
CONFIG.<host>.Common Specific host definitions for all targets
|
||||
CONFIG.UnixCommon.Common Definitions for Unix hosts and all targets
|
||||
CONFIG.Common.UnixCommon Definitions for Unix targets and all hosts
|
||||
CONFIG.Common.vxWorksCommon Specific host definitions for all vx targets
|
||||
CONFIG_SITE.<host>.<target> Site specific host-target definitions
|
||||
CONFIG_SITE.Common.<target> Site specific target defs for all hosts
|
||||
CONFIG_SITE.<host>.Common Site specific host defs for all targets
|
||||
|
||||
Building EPICS base (Unix and Win32)
|
||||
|
||||
Unpack file
|
||||
|
||||
Unzip and untar the distribution file. Use WinZip on Windows systems.
|
||||
|
||||
Set environment variables
|
||||
|
||||
Files in the base/startup directory have been provided to help set
|
||||
required path and other environment variables.
|
||||
|
||||
EPICS_HOST_ARCH
|
||||
Before you can build or use EPICS R3.15, the environment variable
|
||||
EPICS_HOST_ARCH must be defined. A perl script EpicsHostArch.pl in the
|
||||
base/startup directory has been provided to help set EPICS_HOST_ARCH.
|
||||
You should have EPICS_HOST_ARCH set to your host operating system
|
||||
followed by a dash and then your host architecture, e.g.
|
||||
solaris-sparc. If you are not using the OS vendor's c/c++ compiler for
|
||||
host builds, you will need another dash followed by the alternate
|
||||
compiler name (e.g. "-gnu" for GNU c/c++ compilers on a solaris host
|
||||
or "-mingw" for MinGW c/c++ compilers on a WIN32 host). See
|
||||
configure/CONFIG_SITE for a list of supported EPICS_HOST_ARCH values.
|
||||
|
||||
PERLLIB
|
||||
On WIN32, some versions of Perl require that the environment variable
|
||||
PERLLIB be set to <perl directory location>.
|
||||
|
||||
PATH
|
||||
As already mentioned, you must have the perl executable and you may
|
||||
need C and C++ compilers in your search path. For building base you
|
||||
also must have echo in your search path. For Unix host builds you also
|
||||
need ln, cpp, cp, rm, mv, and mkdir in your search path and /bin/chmod
|
||||
must exist. On some Unix systems you may also need ar and ranlib in
|
||||
your path, and the C compiler may require as and ld in your path. On
|
||||
solaris systems you need uname in your path.
|
||||
|
||||
LD_LIBRARY_PATH
|
||||
R3.15 shared libraries and executables normally contain the full path
|
||||
to any libraries they require. However, if you move the EPICS files or
|
||||
directories from their build-time location then in order for the
|
||||
shared libraries to be found at runtime LD_LIBRARY_PATH must include
|
||||
the full pathname to $(INSTALL_LOCATION)/lib/$(EPICS_HOST_ARCH) when
|
||||
invoking executables, or some equivalent OS-specific mechanism (such
|
||||
as /etc/ld.so.conf on Linux) must be used. Shared libraries are now
|
||||
built by default on all Unix type hosts.
|
||||
|
||||
Do site-specific build configuration
|
||||
|
||||
Site configuration
|
||||
To configure EPICS, you may want to modify the default definitions in
|
||||
the following files:
|
||||
|
||||
configure/CONFIG_SITE Build choices. Specify target archs.
|
||||
configure/CONFIG_SITE_ENV Environment variable defaults
|
||||
configure/RELEASE TORNADO2 full path location
|
||||
|
||||
Host configuration
|
||||
To configure each host system, you may override the default
|
||||
definitions by adding a new file in the configure/os directory with
|
||||
override definitions. The new file should have the same name as the
|
||||
distribution file to be overridden except with CONFIG in the name
|
||||
changed to CONFIG_SITE.
|
||||
|
||||
configure/os/CONFIG.<host>.<host> Host build settings
|
||||
configure/os/CONFIG.<host>.Common Host common build settings
|
||||
|
||||
Target configuration
|
||||
To configure each target system, you may override the default
|
||||
definitions by adding a new file in the configure/os directory with
|
||||
override definitions. The new file should have the same name as the
|
||||
distribution file to be overridden except with CONFIG in the name
|
||||
replaced by CONFIG_SITE. This step is necessary even if the host
|
||||
system is the only target system.
|
||||
|
||||
configure/os/CONFIG.Common.<target> Target common settings
|
||||
configure/os/CONFIG.<host>.<target> Host-target settings
|
||||
|
||||
Build EPICS base
|
||||
|
||||
After configuring the build you should be able to build EPICS base by
|
||||
issuing the following commands in the distribution's root directory
|
||||
(base):
|
||||
|
||||
gnumake clean uninstall
|
||||
gnumake
|
||||
|
||||
The command "gnumake clean uninstall" will remove all files and
|
||||
directories generated by a previous build. The command "gnumake" will
|
||||
build and install everything for the configured host and targets.
|
||||
|
||||
It is recommended that you do a "gnumake clean uninstall" at the root
|
||||
directory of an EPICS directory structure before each complete rebuild
|
||||
to ensure that all components will be rebuilt.
|
||||
|
||||
Example application and extension
|
||||
|
||||
A perl tool, makeBaseApp.pl is included in the distribution file. This
|
||||
script will create a sample application that can be built and then
|
||||
executed to try out this release of base.
|
||||
|
||||
Instructions for building and executing the 3.15 example application can
|
||||
be found in the section "Example Application" of Chapter 2, "Getting
|
||||
Started", in the "IOC Application Developer's Guide" for this release.
|
||||
The "Example IOC Application" section briefly explains how to create and
|
||||
build an example application in a user created <top> directory. It also
|
||||
explains how to run the example application on a vxWorks ioc or as a
|
||||
process on the host system. By running the example application as a
|
||||
host-based IOC, you will be able to quickly implement a complete EPICS
|
||||
system and be able to run channel access clients on the host system.
|
||||
|
||||
A perl script, makeBaseExt.pl, is included in the distribution file.
|
||||
This script will create a sample extension that can be built and
|
||||
executed. The makeBaseApp.pl and makeBaseExt.pl scripts are installed
|
||||
into the install location bin/<hostarch> directory during the base
|
||||
build.
|
||||
|
||||
Multiple host platforms
|
||||
|
||||
You can build using a single EPICS directory structure on multiple host
|
||||
systems and for multiple cross target systems. The intermediate and
|
||||
binary files generated by the build will be created in separate
|
||||
subdirectories and installed into the appropriate separate host/target
|
||||
install directories. EPICS executables and perl scripts are installed
|
||||
into the $(INSTALL_LOCATION)/bin/<arch> directories. Libraries are
|
||||
installed into $(INSTALL_LOCATION)/lib/<arch>. The default definition
|
||||
for $(INSTALL_LOCATION) is $(TOP) which is the root directory in the
|
||||
distribution directory structure, base. Created object files are stored
|
||||
in O.<arch> source subdirectories, This allows objects for multiple
|
||||
cross target architectures to be maintained at the same time. To build
|
||||
EPICS base for a specific host/target combination you must have the
|
||||
proper host/target C/C++ cross compiler and target header files and the
|
||||
base/configure/os directory must have the appropriate configure files.
|
||||
@@ -1,383 +0,0 @@
|
||||
<!DOCTYPE HTML>
|
||||
<!-- Generate the README.1st file from this file using:
|
||||
elinks -dump -no-numbering -no-references -dump-width 80 README.html
|
||||
-->
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>README - EPICS Base Installation Instructions</TITLE>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<CENTER>
|
||||
<H1>Installation Instructions</H1>
|
||||
<H2>EPICS Base Release 3.15.6</H2><BR>
|
||||
</CENTER>
|
||||
<HR>
|
||||
<H3> Table of Contents</H3>
|
||||
<UL>
|
||||
<LI><A HREF="#0_0_1"> What is EPICS base?</A></LI>
|
||||
<LI><A HREF="#0_0_2"> What is new in this release?</A></LI>
|
||||
<LI><A HREF="#0_0_3"> Copyright</A></LI>
|
||||
<LI><A HREF="#0_0_4"> Supported platforms</A></LI>
|
||||
<LI><A HREF="#0_0_5"> Supported compilers</A></LI>
|
||||
<LI><A HREF="#0_0_6"> Software requirements</A></LI>
|
||||
<LI><A HREF="#0_0_7"> Host system storage requirements</A></LI>
|
||||
<LI><A HREF="#0_0_8"> Documentation</A></LI>
|
||||
<LI><A HREF="#0_0_10"> Directory Structure</A></LI>
|
||||
<LI><A HREF="#0_0_11"> Build related components</A></LI>
|
||||
<LI><A HREF="#0_0_12"> Building EPICS base (Unix and Win32)</A></LI>
|
||||
<LI><A HREF="#0_0_13"> Example application and extension</A></LI>
|
||||
<LI><A HREF="#0_0_14"> Multiple host platforms</A></LI>
|
||||
</UL>
|
||||
<HR>
|
||||
|
||||
<H3><A NAME="0_0_1"> What is EPICS base?</A></H3>
|
||||
<BLOCKQUOTE>The Experimental Physics and Industrial Control Systems
|
||||
(EPICS) is an extensible set of software components and tools with
|
||||
which application developers can create a control system. This control
|
||||
system can be used to control accelerators, detectors, telescopes, or
|
||||
other scientific experimental equipment. EPICS base is the set of core
|
||||
software, i.e. the components of EPICS without which EPICS would not
|
||||
function. EPICS base allows an arbitrary number of target systems, IOCs
|
||||
(input/output controllers), and host systems, OPIs (operator
|
||||
interfaces) of various types.</BLOCKQUOTE>
|
||||
|
||||
<H3><A NAME="0_0_2"> What is new in this release?</A></H3>
|
||||
<BLOCKQUOTE> Please check the RELEASE_NOTES file in the distribution for
|
||||
description of changes and release migration details.</BLOCKQUOTE>
|
||||
|
||||
<H3><A NAME="0_0_3"> Copyright</A></H3>
|
||||
<BLOCKQUOTE>Please review the LICENSE file included in the
|
||||
distribution for legal terms of usage.</BLOCKQUOTE>
|
||||
|
||||
<H3><A NAME="0_0_4"> Supported platforms</A></H3>
|
||||
|
||||
<BLOCKQUOTE>The list of platforms supported by this version of EPICS base
|
||||
is given in the configure/CONFIG_SITE file. If you are trying to build
|
||||
EPICS Base on an unlisted host or for a different target machine you
|
||||
must have the proper host/target cross compiler and header files, and
|
||||
you will have to create and add the appropriate new configure files to
|
||||
the base/configure/os/directory. You can start by copying existing
|
||||
configuration files in the configure/os directory and then make changes
|
||||
for your new platforms.</BLOCKQUOTE>
|
||||
|
||||
<H3><A NAME="0_0_5"> Supported compilers</A></H3>
|
||||
|
||||
<BLOCKQUOTE>This version of EPICS base has been built and tested using the host
|
||||
vendor's C and C++ compilers, as well as the GNU gcc and g++ compilers. The GNU
|
||||
cross-compilers work for all cross-compiled targets. You may need the C and C++
|
||||
compilers to be in your search path to do EPICS builds; check the definitions
|
||||
of CC and CCC in base/configure/os/CONFIG.<host>.<host> if you have
|
||||
problems.</BLOCKQUOTE>
|
||||
|
||||
<H3><A NAME="0_0_6"> Software requirements</A></H3>
|
||||
|
||||
<BLOCKQUOTE><B>GNU make</B><BR>
|
||||
You must use GNU make, gnumake, for any EPICS builds. Set your path
|
||||
so that a gnumake version 3.81 or later is available.
|
||||
|
||||
<P><B>Perl</B><BR>
|
||||
You must have Perl version 5.8.1 or later installed. The EPICS configuration
|
||||
files do not specify the perl full pathname, so the perl executable must
|
||||
be found through your normal search path.</P>
|
||||
|
||||
<P><B>Unzip and tar (Winzip on WIN32 systems)</B><BR>
|
||||
You must have tools available to unzip and untar the EPICS base
|
||||
distribution file.</P>
|
||||
|
||||
<P><B>Target systems</B><BR>
|
||||
EPICS supports IOCs running on embedded platforms such as VxWorks
|
||||
and RTEMS built using a cross-compiler, and also supports soft IOCs running
|
||||
as processes on the host platform.</P>
|
||||
|
||||
<P><B>vxWorks</B><BR>
|
||||
You must have vxWorks 5.5.x or 6.x installed if any of your target systems are
|
||||
vxWorks systems; the C++ compiler for vxWorks 5.4 is now too old to support.
|
||||
The vxWorks installation provides the cross-compiler and header files needed to
|
||||
build for these targets. The absolute path to and the version number of the
|
||||
vxWorks installation must be set in the
|
||||
base/configure/os/CONFIG_SITE.Common.vxWorksCommon file or in one of its
|
||||
target-specific overrides.</P>
|
||||
|
||||
<P>Consult the <a href="https://epics.anl.gov/base/tornado.php">vxWorks
|
||||
5.x</a> or <a href="https://epics.anl.gov/base/vxWorks6.php">vxWorks
|
||||
6.x</a> EPICS web pages about and the vxWorks documentation for information
|
||||
about configuring your vxWorks operating system for use with EPICS.</P>
|
||||
|
||||
<P><B>RTEMS</B><BR>
|
||||
For RTEMS targets, you need RTEMS core and toolset version 4.9.2 or later.</P>
|
||||
|
||||
<P><B>GNU readline or Tecla library</B><BR>
|
||||
GNU readline and Tecla libraries can be used by the IOC shell to
|
||||
provide command line editing and command line history recall and edit.
|
||||
GNU readline (or Tecla library) must be installed on your target system
|
||||
when COMMANDLINE_LIBRARY is set to READLINE (or TECLA) for that target.
|
||||
EPICS (EPICS shell) is the default specified in CONFIG_COMMON. A
|
||||
READLINE override is defined for linux-x86 in the EPICS distribution.
|
||||
Comment out COMMANDLINE_LIBRARY=READLINE in
|
||||
configure/os/CONFIG_SITE.Common.linux-x86 if readline is not installed
|
||||
on linux-x86. Command-line editing and history will then be those
|
||||
supplied by the os. On vxWorks the ledLib command-line input library is
|
||||
used instead.</P>
|
||||
</BLOCKQUOTE>
|
||||
|
||||
<H3><A NAME="0_0_7"> Host system storage requirements</A></H3>
|
||||
|
||||
<BLOCKQUOTE>The compressed tar file is approximately 1.6 MB in size. The
|
||||
distribution source tree takes up approximately 12 MB. Each host target will
|
||||
need around 40 MB for build files, and each cross-compiled target around 20
|
||||
MB.</BLOCKQUOTE>
|
||||
|
||||
<H3><A NAME="0_0_8"> Documentation</A></H3>
|
||||
<BLOCKQUOTE>EPICS documentation is available through the
|
||||
<a href="https://epics.anl.gov/">EPICS website</a> at Argonne.
|
||||
<P>Release specific documentation can also be found in the base/documentation
|
||||
directory of the distribution.</BLOCKQUOTE>
|
||||
|
||||
<H3><A NAME="0_0_10"> Directory Structure</A></H3>
|
||||
<BLOCKQUOTE><H4>Distribution directory structure:</H4>
|
||||
|
||||
<PRE>
|
||||
base Root directory of the base distribution
|
||||
base/configure Operating system independent build config files
|
||||
base/configure/os Operating system dependent build config files
|
||||
base/documentation Distribution documentation
|
||||
base/src Source code in various subdirectories
|
||||
base/startup Scripts for setting up path and environment
|
||||
</PRE>
|
||||
|
||||
<H4>Install directories created by the build:</H4>
|
||||
<PRE>
|
||||
bin Installed scripts and executables in subdirs
|
||||
cfg Installed build configuration files
|
||||
db Installed data bases
|
||||
dbd Installed data base definitions
|
||||
doc Installed documentation files
|
||||
html Installed html documentation
|
||||
include Installed header files
|
||||
include/os Installed os specific header files in subdirs
|
||||
include/compiler Installed compiler-specific header files
|
||||
lib Installed libraries in arch subdirectories
|
||||
lib/perl Installed perl modules
|
||||
templates Installed templates
|
||||
</PRE>
|
||||
</BLOCKQUOTE>
|
||||
|
||||
<H3><A NAME="0_0_11"> Build related components</A></H3>
|
||||
<BLOCKQUOTE>
|
||||
|
||||
<H4>base/documentation directory - contains setup, build, and install
|
||||
documents</H4>
|
||||
<PRE>
|
||||
README.1st Instructions for setup and building epics base
|
||||
README.html html version of README.1st
|
||||
README.darwin.html Installation notes for Mac OS X (Darwin)
|
||||
RELEASE_NOTES.html Notes on release changes
|
||||
KnownProblems.html List of known problems and workarounds
|
||||
</PRE>
|
||||
|
||||
<H4>base/startup directory - contains scripts to set environment and path</H4>
|
||||
<PRE>
|
||||
EpicsHostArch Shell script to set EPICS_HOST_ARCH env variable
|
||||
unix.csh C shell script to set path and env variables
|
||||
unix.sh Bourne shell script to set path and env variables
|
||||
win32.bat Bat file example to configure win32-x86 target
|
||||
windows.bat Bat file example to configure windows-x64 target
|
||||
</PRE>
|
||||
|
||||
<H4>base/configure directory - contains build definitions and rules</H4>
|
||||
<PRE>
|
||||
CONFIG Includes configure files and allows variable overrides
|
||||
CONFIG.CrossCommon Cross build definitions
|
||||
CONFIG.gnuCommon Gnu compiler build definitions for all archs
|
||||
CONFIG_ADDONS Definitions for <osclass> and DEFAULT options
|
||||
CONFIG_APP_INCLUDE
|
||||
CONFIG_BASE EPICS base tool and location definitions
|
||||
CONFIG_BASE_VERSION Definitions for EPICS base version number
|
||||
CONFIG_COMMON Definitions common to all builds
|
||||
CONFIG_ENV Definitions of EPICS environment variables
|
||||
CONFIG_FILE_TYPE
|
||||
CONFIG_SITE Site specific make definitions
|
||||
CONFIG_SITE_ENV Site defaults for EPICS environment variables
|
||||
MAKEFILE Installs CONFIG* RULES* creates
|
||||
RELEASE Location of external products
|
||||
RULES Includes appropriate rules file
|
||||
RULES.Db Rules for database and database definition files
|
||||
RULES.ioc Rules for application iocBoot/ioc* directory
|
||||
RULES_ARCHS Definitions and rules for building architectures
|
||||
RULES_BUILD Build and install rules and definitions
|
||||
RULES_DIRS Definitions and rules for building subdirectories
|
||||
RULES_EXPAND
|
||||
RULES_FILE_TYPE
|
||||
RULES_TARGET
|
||||
RULES_TOP Rules specific to a <top> dir (uninstall and tar)
|
||||
Sample.Makefile Sample makefile with comments
|
||||
</PRE>
|
||||
|
||||
<H4>base/configure/os directory - contains os-arch specific definitions</H4>
|
||||
<PRE>
|
||||
CONFIG.<host>.<target> Specific host-target build definitions
|
||||
CONFIG.Common.<target> Specific target definitions for all hosts
|
||||
CONFIG.<host>.Common Specific host definitions for all targets
|
||||
CONFIG.UnixCommon.Common Definitions for Unix hosts and all targets
|
||||
CONFIG.Common.UnixCommon Definitions for Unix targets and all hosts
|
||||
CONFIG.Common.vxWorksCommon Specific host definitions for all vx targets
|
||||
CONFIG_SITE.<host>.<target> Site specific host-target definitions
|
||||
CONFIG_SITE.Common.<target> Site specific target defs for all hosts
|
||||
CONFIG_SITE.<host>.Common Site specific host defs for all targets
|
||||
</PRE>
|
||||
|
||||
</BLOCKQUOTE>
|
||||
|
||||
<H3><A NAME="0_0_12"> Building EPICS base (Unix and Win32)</A></H3>
|
||||
<BLOCKQUOTE>
|
||||
|
||||
<H4> Unpack file</H4>
|
||||
<BLOCKQUOTE>
|
||||
Unzip and untar the distribution file. Use WinZip on Windows
|
||||
systems.
|
||||
</BLOCKQUOTE>
|
||||
|
||||
<H4>Set environment variables</H4>
|
||||
<BLOCKQUOTE>
|
||||
Files in the base/startup directory have been provided to
|
||||
help set required path and other environment variables.
|
||||
|
||||
<P><B>EPICS_HOST_ARCH</B><BR>
|
||||
Before you can build or use EPICS R3.15, the environment variable
|
||||
EPICS_HOST_ARCH must be defined. A perl script EpicsHostArch.pl in the
|
||||
base/startup directory has been provided to help set EPICS_HOST_ARCH.
|
||||
You should have EPICS_HOST_ARCH set to your host operating system
|
||||
followed by a dash and then your host architecture, e.g. solaris-sparc.
|
||||
If you are not using the OS vendor's c/c++ compiler for host builds,
|
||||
you will need another dash followed by the alternate compiler name
|
||||
(e.g. "-gnu" for GNU c/c++ compilers on a solaris host or "-mingw"
|
||||
for MinGW c/c++ compilers on a WIN32 host). See configure/CONFIG_SITE
|
||||
for a list of supported EPICS_HOST_ARCH values.</P>
|
||||
|
||||
<P><B>PERLLIB</B><BR>
|
||||
On WIN32, some versions of Perl require that the environment
|
||||
variable PERLLIB be set to <perl directory location>.</P>
|
||||
|
||||
<P><B>PATH</B><BR>
|
||||
As already mentioned, you must have the perl executable and you may
|
||||
need C and C++ compilers in your search path. For building base you
|
||||
also must have echo in your search path. For Unix host builds you also
|
||||
need ln, cpp, cp, rm, mv, and mkdir in your search path and /bin/chmod
|
||||
must exist. On some Unix systems you may also need ar and ranlib in
|
||||
your path, and the C compiler may require as and ld in your path. On
|
||||
solaris systems you need uname in your path.</P>
|
||||
|
||||
<P><B>LD_LIBRARY_PATH</B><BR>
|
||||
|
||||
R3.15 shared libraries and executables normally contain the full path
|
||||
to any libraries they require.
|
||||
However, if you move the EPICS files or directories from their build-time
|
||||
location then in order for the shared libraries to be found at runtime
|
||||
LD_LIBRARY_PATH must include the full pathname to
|
||||
$(INSTALL_LOCATION)/lib/$(EPICS_HOST_ARCH) when invoking executables, or
|
||||
some equivalent OS-specific mechanism (such as /etc/ld.so.conf on Linux)
|
||||
must be used.
|
||||
Shared libraries are now built by default on all Unix type hosts.</P>
|
||||
</BLOCKQUOTE>
|
||||
|
||||
<H4>Do site-specific build configuration</H4>
|
||||
<BLOCKQUOTE>
|
||||
|
||||
<B>Site configuration</B><BR>
|
||||
To configure EPICS, you may want to modify the default definitions
|
||||
in the following files:
|
||||
<PRE>
|
||||
configure/CONFIG_SITE Build choices. Specify target archs.
|
||||
configure/CONFIG_SITE_ENV Environment variable defaults
|
||||
configure/RELEASE TORNADO2 full path location
|
||||
</PRE>
|
||||
|
||||
<B> Host configuration</B><BR>
|
||||
To configure each host system, you may override the default
|
||||
definitions by adding a new file in the configure/os directory with
|
||||
override definitions. The new file should have the same name as the
|
||||
distribution file to be overridden except with CONFIG in the name
|
||||
changed to CONFIG_SITE.
|
||||
|
||||
<PRE>
|
||||
configure/os/CONFIG.<host>.<host> Host build settings
|
||||
configure/os/CONFIG.<host>.Common Host common build settings
|
||||
</PRE>
|
||||
|
||||
<B>Target configuration</B><BR>
|
||||
To configure each target system, you may override the default
|
||||
definitions by adding a new file in the configure/os directory with
|
||||
override definitions. The new file should have the same name as the
|
||||
distribution file to be overridden except with CONFIG in the name
|
||||
replaced by CONFIG_SITE. This step is necessary even if the host system
|
||||
is the only target system.
|
||||
<PRE>
|
||||
configure/os/CONFIG.Common.<target> Target common settings
|
||||
configure/os/CONFIG.<host>.<target> Host-target settings
|
||||
</PRE>
|
||||
</BLOCKQUOTE>
|
||||
|
||||
<H4>Build EPICS base</H4>
|
||||
<BLOCKQUOTE>After configuring the build you should be able to build
|
||||
EPICS base by issuing the following commands in the distribution's root
|
||||
directory (base):
|
||||
<PRE>
|
||||
gnumake clean uninstall
|
||||
gnumake
|
||||
</PRE>
|
||||
|
||||
The command "gnumake clean uninstall"
|
||||
will remove all files and directories generated by a previous build.
|
||||
The command "gnumake" will build and install everything for the
|
||||
configured host and targets.
|
||||
|
||||
<P> It is recommended that you do a "gnumake clean uninstall" at the
|
||||
root directory of an EPICS directory structure before each complete
|
||||
rebuild to ensure that all components will be rebuilt.
|
||||
</BLOCKQUOTE>
|
||||
</BLOCKQUOTE>
|
||||
|
||||
<H3><A NAME="0_0_13"> Example application and extension</A></H3>
|
||||
<BLOCKQUOTE>A perl tool, makeBaseApp.pl is included in the distribution
|
||||
file. This script will create a sample application that can be built
|
||||
and then executed to try out this release of base.
|
||||
|
||||
<P>
|
||||
Instructions for building and executing the 3.15 example application
|
||||
can be found in the section "Example Application" of Chapter 2,
|
||||
"Getting Started", in the "IOC Application Developer's Guide" for this
|
||||
release. The "Example IOC Application" section briefly explains how to
|
||||
create and build an example application in a user created <top>
|
||||
directory. It also explains how to run the example application on a
|
||||
vxWorks ioc or as a process on the host system.
|
||||
By running the example application as a host-based IOC, you will be
|
||||
able to quickly implement a complete EPICS system and be able to run channel
|
||||
access clients on the host system.
|
||||
|
||||
<P>
|
||||
A perl script,
|
||||
makeBaseExt.pl, is included in the distribution file. This script will
|
||||
create a sample extension that can be built and executed. The
|
||||
makeBaseApp.pl and makeBaseExt.pl scripts are installed into the
|
||||
install location bin/<hostarch> directory during the base build.
|
||||
</BLOCKQUOTE>
|
||||
|
||||
<H3><A NAME="0_0_14"> Multiple host platforms</A></H3>
|
||||
<BLOCKQUOTE>You can build using a single EPICS directory structure on
|
||||
multiple host systems and for multiple cross target systems. The
|
||||
intermediate and binary files generated by the build will be created in
|
||||
separate subdirectories and installed into the appropriate separate
|
||||
host/target install directories. EPICS executables and perl scripts are
|
||||
installed into the <TT>$(INSTALL_LOCATION)/bin/<arch></TT> directories.
|
||||
Libraries are installed into $<TT>(INSTALL_LOCATION)/lib/<arch></TT>.
|
||||
The default definition for <TT>$(INSTALL_LOCATION)</TT> is <TT>$(TOP)</TT>
|
||||
which is the root directory in the distribution directory structure,
|
||||
base. Created object files are stored in O.<arch> source
|
||||
subdirectories, This allows objects for multiple cross target
|
||||
architectures to be maintained at the same time. To build EPICS base
|
||||
for a specific host/target combination you must have the proper
|
||||
host/target C/C++ cross compiler and target header files and the
|
||||
base/configure/os directory must have the appropriate configure files.
|
||||
</BLOCKQUOTE>
|
||||
</BODY>
|
||||
</HTML>
|
||||
373
documentation/README.md
Normal file
373
documentation/README.md
Normal file
@@ -0,0 +1,373 @@
|
||||
# Installation Instructions
|
||||
|
||||
## EPICS Base Release 3.15.7
|
||||
|
||||
-----
|
||||
|
||||
### Table of Contents
|
||||
|
||||
- [What is EPICS base?](#0_0_1)
|
||||
- [What is new in this release?](#0_0_2)
|
||||
- [Copyright](#0_0_3)
|
||||
- [Supported platforms](#0_0_4)
|
||||
- [Supported compilers](#0_0_5)
|
||||
- [Software requirements](#0_0_6)
|
||||
- [Host system storage requirements](#0_0_7)
|
||||
- [Documentation](#0_0_8)
|
||||
- [Directory Structure](#0_0_10)
|
||||
- [Build related components](#0_0_11)
|
||||
- [Building EPICS base (Unix and Win32)](#0_0_12)
|
||||
- [Example application and extension](#0_0_13)
|
||||
- [Multiple host platforms](#0_0_14)
|
||||
|
||||
-----
|
||||
|
||||
### <span id="0_0_1">What is EPICS base?</span>
|
||||
|
||||
The Experimental Physics and Industrial Control Systems (EPICS) is an
|
||||
extensible set of software components and tools with which application
|
||||
developers can create a control system. This control system can be
|
||||
used to control accelerators, detectors, telescopes, or other
|
||||
scientific experimental equipment. EPICS base is the set of core
|
||||
software, i.e. the components of EPICS without which EPICS would not
|
||||
function. EPICS base allows an arbitrary number of target systems,
|
||||
IOCs (input/output controllers), and host systems, OPIs (operator
|
||||
interfaces) of various types.
|
||||
|
||||
### <span id="0_0_2">What is new in this release?</span>
|
||||
|
||||
Please check the `RELEASE_NOTES` file in the distribution for
|
||||
description of changes and release migration details.
|
||||
|
||||
### <span id="0_0_3">Copyright</span>
|
||||
|
||||
Please review the LICENSE file included in the distribution for legal
|
||||
terms of usage.
|
||||
|
||||
### <span id="0_0_4">Supported platforms</span>
|
||||
|
||||
The list of platforms supported by this version of EPICS base is given
|
||||
in the `configure/CONFIG_SITE` file. If you are trying to build EPICS
|
||||
Base on an unlisted host or for a different target machine you must
|
||||
have the proper host/target cross compiler and header files, and you
|
||||
will have to create and add the appropriate new configure files to the
|
||||
base/configure/os/directory. You can start by copying existing
|
||||
configuration files in the configure/os directory and then make
|
||||
changes for your new platforms.
|
||||
|
||||
### <span id="0_0_5">Supported compilers</span>
|
||||
|
||||
This version of EPICS base has been built and tested using the host
|
||||
vendor's C and C++ compilers, as well as the GNU gcc and g++
|
||||
compilers. The GNU cross-compilers work for all cross-compiled
|
||||
targets. You may need the C and C++ compilers to be in your search
|
||||
path to do EPICS builds; check the definitions of CC and CCC in
|
||||
base/configure/os/CONFIG.<host>.<host> if you have problems.
|
||||
|
||||
### <span id="0_0_6">Software requirements</span>
|
||||
|
||||
**GNU make**
|
||||
You must use GNU make, gnumake, for any EPICS builds. Set your path so
|
||||
that a gnumake version 3.81 or later is available.
|
||||
|
||||
**Perl**
|
||||
You must have Perl version 5.8.1 or later installed. The EPICS
|
||||
configuration files do not specify the perl full pathname, so the perl
|
||||
executable must be found through your normal search path.
|
||||
|
||||
**Unzip and tar (Winzip on WIN32 systems)**
|
||||
You must have tools available to unzip and untar the EPICS base
|
||||
distribution file.
|
||||
|
||||
**Target systems**
|
||||
EPICS supports IOCs running on embedded platforms such as VxWorks and
|
||||
RTEMS built using a cross-compiler, and also supports soft IOCs
|
||||
running as processes on the host platform.
|
||||
|
||||
**vxWorks**
|
||||
You must have vxWorks 5.5.x or 6.x installed if any of your target
|
||||
systems are vxWorks systems; the C++ compiler for vxWorks 5.4 is now
|
||||
too old to support. The vxWorks installation provides the
|
||||
cross-compiler and header files needed to build for these targets. The
|
||||
absolute path to and the version number of the vxWorks installation
|
||||
must be set in the `base/configure/os/CONFIG_SITE.Common.vxWorksCommon`
|
||||
file or in one of its target-specific overrides.
|
||||
|
||||
Consult the [vxWorks 5.x](https://epics.anl.gov/base/tornado.php) or
|
||||
[vxWorks 6.x](https://epics.anl.gov/base/vxWorks6.php) EPICS web pages
|
||||
about and the vxWorks documentation for information about configuring
|
||||
your vxWorks operating system for use with EPICS.
|
||||
|
||||
**RTEMS**
|
||||
For RTEMS targets, you need RTEMS core and toolset version 4.9.2 or
|
||||
later.
|
||||
|
||||
**GNU readline or Tecla library**
|
||||
GNU readline and Tecla libraries can be used by the IOC shell to
|
||||
provide command line editing and command line history recall and edit.
|
||||
GNU readline (or Tecla library) must be installed on your target
|
||||
system when `COMMANDLINE_LIBRARY` is set to READLINE (or TECLA) for
|
||||
that target. EPICS (EPICS shell) is the default specified in
|
||||
`CONFIG_COMMON`. A READLINE override is defined for linux-x86 in the
|
||||
EPICS distribution. Comment out `COMMANDLINE_LIBRARY=READLINE` in
|
||||
`configure/os/CONFIG_SITE.Common.linux-x86` if readline is not
|
||||
installed on linux-x86. Command-line editing and history will then be
|
||||
those supplied by the os. On vxWorks the ledLib command-line input
|
||||
library is used instead.
|
||||
|
||||
### <span id="0_0_7">Host system storage requirements</span>
|
||||
|
||||
The compressed tar file is approximately 1.6 MB in size. The
|
||||
distribution source tree takes up approximately 12 MB. Each host
|
||||
target will need around 40 MB for build files, and each cross-compiled
|
||||
target around 20 MB.
|
||||
|
||||
### <span id="0_0_8">Documentation</span>
|
||||
|
||||
EPICS documentation is available through the [EPICS
|
||||
website](https://epics.anl.gov/) at Argonne.
|
||||
|
||||
Release specific documentation can also be found in the
|
||||
base/documentation directory of the distribution.
|
||||
|
||||
### <span id="0_0_10">Directory Structure</span>
|
||||
|
||||
#### Distribution directory structure:
|
||||
|
||||
```
|
||||
base Root directory of the base distribution
|
||||
base/configure Operating system independent build config files
|
||||
base/configure/os Operating system dependent build config files
|
||||
base/documentation Distribution documentation
|
||||
base/src Source code in various subdirectories
|
||||
base/startup Scripts for setting up path and environment
|
||||
```
|
||||
|
||||
#### Install directories created by the build:
|
||||
|
||||
```
|
||||
bin Installed scripts and executables in subdirs
|
||||
cfg Installed build configuration files
|
||||
db Installed data bases
|
||||
dbd Installed data base definitions
|
||||
doc Installed documentation files
|
||||
html Installed html documentation
|
||||
include Installed header files
|
||||
include/os Installed os specific header files in subdirs
|
||||
include/compiler Installed compiler-specific header files
|
||||
lib Installed libraries in arch subdirectories
|
||||
lib/perl Installed perl modules
|
||||
templates Installed templates
|
||||
```
|
||||
|
||||
### <span id="0_0_11">Build related components</span>
|
||||
|
||||
#### base/documentation directory - contains setup, build, and install documents
|
||||
|
||||
```
|
||||
README.md Instructions for setup and building epics base
|
||||
README.darwin.html Installation notes for Mac OS X (Darwin)
|
||||
RELEASE_NOTES.html Notes on release changes
|
||||
KnownProblems.html List of known problems and workarounds
|
||||
```
|
||||
|
||||
#### base/startup directory - contains scripts to set environment and path
|
||||
|
||||
```
|
||||
EpicsHostArch Shell script to set EPICS_HOST_ARCH env variable
|
||||
unix.csh C shell script to set path and env variables
|
||||
unix.sh Bourne shell script to set path and env variables
|
||||
win32.bat Bat file example to configure win32-x86 target
|
||||
windows.bat Bat file example to configure windows-x64 target
|
||||
```
|
||||
|
||||
#### base/configure directory - contains build definitions and rules
|
||||
|
||||
```
|
||||
CONFIG Includes configure files and allows variable overrides
|
||||
CONFIG.CrossCommon Cross build definitions
|
||||
CONFIG.gnuCommon Gnu compiler build definitions for all archs
|
||||
CONFIG_ADDONS Definitions for <osclass> and DEFAULT options
|
||||
CONFIG_APP_INCLUDE
|
||||
CONFIG_BASE EPICS base tool and location definitions
|
||||
CONFIG_BASE_VERSION Definitions for EPICS base version number
|
||||
CONFIG_COMMON Definitions common to all builds
|
||||
CONFIG_ENV Definitions of EPICS environment variables
|
||||
CONFIG_FILE_TYPE
|
||||
CONFIG_SITE Site specific make definitions
|
||||
CONFIG_SITE_ENV Site defaults for EPICS environment variables
|
||||
MAKEFILE Installs CONFIG* RULES* creates
|
||||
RELEASE Location of external products
|
||||
RULES Includes appropriate rules file
|
||||
RULES.Db Rules for database and database definition files
|
||||
RULES.ioc Rules for application iocBoot/ioc* directory
|
||||
RULES_ARCHS Definitions and rules for building architectures
|
||||
RULES_BUILD Build and install rules and definitions
|
||||
RULES_DIRS Definitions and rules for building subdirectories
|
||||
RULES_EXPAND
|
||||
RULES_FILE_TYPE
|
||||
RULES_TARGET
|
||||
RULES_TOP Rules specific to a <top> dir (uninstall and tar)
|
||||
Sample.Makefile Sample makefile with comments
|
||||
```
|
||||
|
||||
#### base/configure/os directory - contains os-arch specific definitions
|
||||
|
||||
```
|
||||
CONFIG.<host>.<target> Specific host-target build definitions
|
||||
CONFIG.Common.<target> Specific target definitions for all hosts
|
||||
CONFIG.<host>.Common Specific host definitions for all targets
|
||||
CONFIG.UnixCommon.Common Definitions for Unix hosts and all targets
|
||||
CONFIG.Common.UnixCommon Definitions for Unix targets and all hosts
|
||||
CONFIG.Common.vxWorksCommon Specific host definitions for all vx targets
|
||||
CONFIG_SITE.<host>.<target> Site specific host-target definitions
|
||||
CONFIG_SITE.Common.<target> Site specific target defs for all hosts
|
||||
CONFIG_SITE.<host>.Common Site specific host defs for all targets
|
||||
```
|
||||
|
||||
### <span id="0_0_12">Building EPICS base (Unix and Win32)</span>
|
||||
|
||||
#### Unpack file
|
||||
|
||||
Unzip and untar the distribution file. Use WinZip on Windows
|
||||
systems.
|
||||
|
||||
#### Set environment variables
|
||||
|
||||
Files in the base/startup directory have been provided to help set
|
||||
required path and other environment variables.
|
||||
|
||||
* `EPICS_HOST_ARCH`
|
||||
Before you can build or use EPICS R3.15, the environment variable
|
||||
`EPICS_HOST_ARCH` must be defined. A perl script EpicsHostArch.pl in
|
||||
the base/startup directory has been provided to help set
|
||||
`EPICS_HOST_ARCH.` You should have `EPICS_HOST_ARCH` set to your
|
||||
host operating system followed by a dash and then your host
|
||||
architecture, e.g. solaris-sparc. If you are not using the OS
|
||||
vendor's c/c++ compiler for host builds, you will need another dash
|
||||
followed by the alternate compiler name (e.g. "-gnu" for GNU c/c++
|
||||
compilers on a solaris host or "-mingw" for MinGW c/c++ compilers on
|
||||
a WIN32 host). See `configure/CONFIG_SITE` for a list of supported
|
||||
`EPICS_HOST_ARCH` values.
|
||||
|
||||
* `PERLLIB`
|
||||
On WIN32, some versions of Perl require that the environment
|
||||
variable PERLLIB be set to <perl directory location>.
|
||||
|
||||
* `PATH`
|
||||
As already mentioned, you must have the perl executable and you may
|
||||
need C and C++ compilers in your search path. For building base you
|
||||
also must have echo in your search path. For Unix host builds you
|
||||
also need ln, cpp, cp, rm, mv, and mkdir in your search path and
|
||||
/bin/chmod must exist. On some Unix systems you may also need ar and
|
||||
ranlib in your path, and the C compiler may require as and ld in
|
||||
your path. On solaris systems you need uname in your path.
|
||||
|
||||
* `LD_LIBRARY_PATH`
|
||||
R3.15 shared libraries and executables normally contain the full
|
||||
path to any libraries they require. However, if you move the EPICS
|
||||
files or directories from their build-time location then in order
|
||||
for the shared libraries to be found at runtime `LD_LIBRARY_PATH`
|
||||
must include the full pathname to
|
||||
`$(INSTALL_LOCATION)/lib/$(EPICS_HOST_ARCH)` when invoking
|
||||
executables, or some equivalent OS-specific mechanism (such as
|
||||
/etc/ld.so.conf on Linux) must be used. Shared libraries are now
|
||||
built by default on all Unix type hosts.
|
||||
|
||||
#### Do site-specific build configuration
|
||||
|
||||
**Site configuration**
|
||||
To configure EPICS, you may want to modify the default definitions
|
||||
in the following files:
|
||||
|
||||
```
|
||||
configure/CONFIG_SITE Build choices. Specify target archs.
|
||||
configure/CONFIG_SITE_ENV Environment variable defaults
|
||||
configure/RELEASE TORNADO2 full path location
|
||||
```
|
||||
|
||||
**Host configuration**
|
||||
To configure each host system, you may override the default
|
||||
definitions by adding a new file in the configure/os directory with
|
||||
override definitions. The new file should have the same name as the
|
||||
distribution file to be overridden except with CONFIG in the name
|
||||
changed to `CONFIG_SITE`.
|
||||
|
||||
```
|
||||
configure/os/CONFIG.<host>.<host> Host build settings
|
||||
configure/os/CONFIG.<host>.Common Host common build settings
|
||||
```
|
||||
|
||||
**Target configuration**
|
||||
To configure each target system, you may override the default
|
||||
definitions by adding a new file in the configure/os directory with
|
||||
override definitions. The new file should have the same name as the
|
||||
distribution file to be overridden except with CONFIG in the name
|
||||
replaced by `CONFIG_SITE`. This step is necessary even if the host
|
||||
system is the only target system.
|
||||
|
||||
```
|
||||
configure/os/CONFIG.Common.<target> Target common settings
|
||||
configure/os/CONFIG.<host>.<target> Host-target settings
|
||||
```
|
||||
|
||||
#### Build EPICS base
|
||||
|
||||
After configuring the build you should be able to build EPICS base
|
||||
by issuing the following commands in the distribution's root
|
||||
directory (base):
|
||||
|
||||
```
|
||||
gnumake clean uninstall
|
||||
gnumake
|
||||
```
|
||||
|
||||
The command "gnumake clean uninstall" will remove all files and
|
||||
directories generated by a previous build. The command "gnumake"
|
||||
will build and install everything for the configured host and
|
||||
targets.
|
||||
|
||||
It is recommended that you do a "gnumake clean uninstall" at the
|
||||
root directory of an EPICS directory structure before each complete
|
||||
rebuild to ensure that all components will be rebuilt.
|
||||
|
||||
### <span id="0_0_13">Example application and extension</span>
|
||||
|
||||
A perl tool, makeBaseApp.pl is included in the distribution file. This
|
||||
script will create a sample application that can be built and then
|
||||
executed to try out this release of base.
|
||||
|
||||
Instructions for building and executing the 3.15 example application
|
||||
can be found in the section "Example Application" of Chapter 2,
|
||||
"Getting Started", in the "IOC Application Developer's Guide" for this
|
||||
release. The "Example IOC Application" section briefly explains how to
|
||||
create and build an example application in a user created <top>
|
||||
directory. It also explains how to run the example application on a
|
||||
vxWorks ioc or as a process on the host system. By running the example
|
||||
application as a host-based IOC, you will be able to quickly implement
|
||||
a complete EPICS system and be able to run channel access clients on
|
||||
the host system.
|
||||
|
||||
A perl script, makeBaseExt.pl, is included in the distribution file.
|
||||
This script will create a sample extension that can be built and
|
||||
executed. The makeBaseApp.pl and makeBaseExt.pl scripts are installed
|
||||
into the install location bin/<hostarch> directory during the base
|
||||
build.
|
||||
|
||||
### <span id="0_0_14">Multiple host platforms</span>
|
||||
|
||||
You can build using a single EPICS directory structure on multiple
|
||||
host systems and for multiple cross target systems. The intermediate
|
||||
and binary files generated by the build will be created in separate
|
||||
subdirectories and installed into the appropriate separate host/target
|
||||
install directories. EPICS executables and perl scripts are installed
|
||||
into the `$(INSTALL_LOCATION)/bin/<arch>` directories. Libraries are
|
||||
installed into $`(INSTALL_LOCATION)/lib/<arch>`. The default
|
||||
definition for `$(INSTALL_LOCATION)` is `$(TOP)` which is the root
|
||||
directory in the distribution directory structure, base. Created
|
||||
object files are stored in O.<arch> source subdirectories, This
|
||||
allows objects for multiple cross target architectures to be
|
||||
maintained at the same time. To build EPICS base for a specific
|
||||
host/target combination you must have the proper host/target C/C++
|
||||
cross compiler and target header files and the base/configure/os
|
||||
directory must have the appropriate configure files.
|
||||
File diff suppressed because it is too large
Load Diff
1700
documentation/RELEASE_NOTES.md
Normal file
1700
documentation/RELEASE_NOTES.md
Normal file
File diff suppressed because it is too large
Load Diff
@@ -136,17 +136,17 @@ relevent roles unless the Release Manager designates otherwise:</p>
|
||||
<td>Tag the module in Git, using these tag conventions:
|
||||
<ul>
|
||||
<li>
|
||||
<tt>R3.15.6-pre1</tt>
|
||||
<tt>R3.15.7-pre1</tt>
|
||||
— pre-release tag
|
||||
</li>
|
||||
<li>
|
||||
<tt>R3.15.6-rc1</tt>
|
||||
<tt>R3.15.7-rc1</tt>
|
||||
— release candidate tag
|
||||
</li>
|
||||
</ul>
|
||||
<blockquote><tt>
|
||||
cd base-3.15<br />
|
||||
git tag -m 'RL: Tagged for 3.15.6-rc1' R3.15.6-rc1
|
||||
git tag -m 'ANJ: Tagged for 3.15.7-rc1' R3.15.7-rc1
|
||||
</tt></blockquote>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -158,11 +158,11 @@ relevent roles unless the Release Manager designates otherwise:</p>
|
||||
files and directories that are only used for continuous integration:
|
||||
<blockquote><tt>
|
||||
cd base-3.15<br />
|
||||
git archive --prefix=base-3.15.6-rc1/ --output=base-3.15.6-rc1.tar.gz R3.15.6-rc1 configure documentation LICENSE Makefile README src startup
|
||||
git archive --prefix=base-3.15.7-rc1/ --output=base-3.15.7-rc1.tar.gz R3.15.7-rc1 configure documentation LICENSE Makefile README src startup
|
||||
</tt></blockquote>
|
||||
Create a GPG signature file of the tarfile as follows:
|
||||
<blockquote><tt>
|
||||
gpg --armor --sign --detach-sig base-3.15.6-rc1.tar.gz
|
||||
gpg --armor --sign --detach-sig base-3.15.7-rc1.tar.gz
|
||||
</tt></blockquote>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -274,7 +274,7 @@ relevent roles unless the Release Manager designates otherwise:</p>
|
||||
<td>Tag the module in Git:
|
||||
<blockquote><tt>
|
||||
cd base-3.15<br />
|
||||
git tag -m 'RL: Tagged for 3.15.6' R3.15.6
|
||||
git tag -m 'ANJ: Tagged for 3.15.7' R3.15.7
|
||||
</tt></blockquote>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -285,11 +285,11 @@ relevent roles unless the Release Manager designates otherwise:</p>
|
||||
generates a gzipped tarfile directly from the repository:
|
||||
<blockquote><tt>
|
||||
cd base-3.15<br />
|
||||
git archive --prefix=base-3.15.6/ --output=base-3.15.6.tar.gz R3.15.6 configure documentation LICENSE Makefile README src startup
|
||||
git archive --prefix=base-3.15.7/ --output=base-3.15.7.tar.gz R3.15.7 configure documentation LICENSE Makefile README src startup
|
||||
</tt></blockquote>
|
||||
Create a GPG signature file of the tarfile as follows:
|
||||
<blockquote><tt>
|
||||
gpg --armor --sign --detach-sig base-3.15.6.tar.gz
|
||||
gpg --armor --sign --detach-sig base-3.15.7.tar.gz
|
||||
</tt></blockquote>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -32,10 +32,12 @@
|
||||
#define epicsAssertAuthor "Jeff Hill johill@lanl.gov"
|
||||
|
||||
#include "epicsAssert.h"
|
||||
#include "osiUnistd.h"
|
||||
#include "udpiiu.h"
|
||||
|
||||
int main()
|
||||
{
|
||||
chdir ( "/" );
|
||||
ca_repeater ();
|
||||
return ( 0 );
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#include "shareLib.h"
|
||||
|
||||
typedef struct {
|
||||
CALLBACK callback;
|
||||
epicsCallback callback;
|
||||
long status;
|
||||
} ASDBCALLBACK;
|
||||
|
||||
|
||||
@@ -168,7 +168,7 @@ static void callbackTask(void *arg)
|
||||
epicsEventMustWait(mySet->semWakeUp);
|
||||
|
||||
while ((ptr = epicsRingPointerPop(mySet->queue))) {
|
||||
CALLBACK *pcallback = (CALLBACK *)ptr;
|
||||
epicsCallback *pcallback = (epicsCallback *)ptr;
|
||||
if(!epicsRingPointerIsEmpty(mySet->queue))
|
||||
epicsEventMustTrigger(mySet->semWakeUp);
|
||||
mySet->queueOverflow = FALSE;
|
||||
@@ -268,7 +268,7 @@ void callbackInit(void)
|
||||
}
|
||||
|
||||
/* This routine can be called from interrupt context */
|
||||
int callbackRequest(CALLBACK *pcallback)
|
||||
int callbackRequest(epicsCallback *pcallback)
|
||||
{
|
||||
int priority;
|
||||
int pushOK;
|
||||
@@ -297,7 +297,7 @@ int callbackRequest(CALLBACK *pcallback)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void ProcessCallback(CALLBACK *pcallback)
|
||||
static void ProcessCallback(epicsCallback *pcallback)
|
||||
{
|
||||
dbCommon *pRec;
|
||||
|
||||
@@ -308,14 +308,14 @@ static void ProcessCallback(CALLBACK *pcallback)
|
||||
dbScanUnlock(pRec);
|
||||
}
|
||||
|
||||
void callbackSetProcess(CALLBACK *pcallback, int Priority, void *pRec)
|
||||
void callbackSetProcess(epicsCallback *pcallback, int Priority, void *pRec)
|
||||
{
|
||||
callbackSetCallback(ProcessCallback, pcallback);
|
||||
callbackSetPriority(Priority, pcallback);
|
||||
callbackSetUser(pRec, pcallback);
|
||||
}
|
||||
|
||||
int callbackRequestProcessCallback(CALLBACK *pcallback,
|
||||
int callbackRequestProcessCallback(epicsCallback *pcallback,
|
||||
int Priority, void *pRec)
|
||||
{
|
||||
callbackSetProcess(pcallback, Priority, pRec);
|
||||
@@ -324,11 +324,11 @@ int callbackRequestProcessCallback(CALLBACK *pcallback,
|
||||
|
||||
static void notify(void *pPrivate)
|
||||
{
|
||||
CALLBACK *pcallback = (CALLBACK *)pPrivate;
|
||||
epicsCallback *pcallback = (epicsCallback *)pPrivate;
|
||||
callbackRequest(pcallback);
|
||||
}
|
||||
|
||||
void callbackRequestDelayed(CALLBACK *pcallback, double seconds)
|
||||
void callbackRequestDelayed(epicsCallback *pcallback, double seconds)
|
||||
{
|
||||
epicsTimerId timer = (epicsTimerId)pcallback->timer;
|
||||
|
||||
@@ -339,7 +339,7 @@ void callbackRequestDelayed(CALLBACK *pcallback, double seconds)
|
||||
epicsTimerStartDelay(timer, seconds);
|
||||
}
|
||||
|
||||
void callbackCancelDelayed(CALLBACK *pcallback)
|
||||
void callbackCancelDelayed(epicsCallback *pcallback)
|
||||
{
|
||||
epicsTimerId timer = (epicsTimerId)pcallback->timer;
|
||||
|
||||
@@ -348,7 +348,7 @@ void callbackCancelDelayed(CALLBACK *pcallback)
|
||||
}
|
||||
}
|
||||
|
||||
void callbackRequestProcessCallbackDelayed(CALLBACK *pcallback,
|
||||
void callbackRequestProcessCallbackDelayed(epicsCallback *pcallback,
|
||||
int Priority, void *pRec, double seconds)
|
||||
{
|
||||
callbackSetProcess(pcallback, Priority, pRec);
|
||||
|
||||
@@ -26,7 +26,7 @@ extern "C" {
|
||||
/*
|
||||
* WINDOWS also has a "CALLBACK" type def
|
||||
*/
|
||||
#ifdef _WIN32
|
||||
#if defined(_WIN32) && !defined(EPICS_NO_CALLBACK)
|
||||
# ifdef CALLBACK
|
||||
# undef CALLBACK
|
||||
# endif /*CALLBACK*/
|
||||
@@ -44,7 +44,9 @@ typedef struct callbackPvt {
|
||||
void *timer; /*for use by callback itself*/
|
||||
}epicsCallback;
|
||||
|
||||
#if !defined(EPICS_NO_CALLBACK)
|
||||
typedef epicsCallback CALLBACK;
|
||||
#endif
|
||||
|
||||
typedef void (*CALLBACKFUNC)(struct callbackPvt*);
|
||||
|
||||
@@ -55,21 +57,21 @@ typedef void (*CALLBACKFUNC)(struct callbackPvt*);
|
||||
#define callbackSetUser(USER,PCALLBACK)\
|
||||
( (PCALLBACK)->user = (void *)(USER) )
|
||||
#define callbackGetUser(USER,PCALLBACK)\
|
||||
( (USER) = (void *)((CALLBACK *)(PCALLBACK))->user )
|
||||
( (USER) = (void *)((epicsCallback *)(PCALLBACK))->user )
|
||||
|
||||
epicsShareFunc void callbackInit(void);
|
||||
epicsShareFunc void callbackStop(void);
|
||||
epicsShareFunc void callbackCleanup(void);
|
||||
epicsShareFunc int callbackRequest(CALLBACK *pCallback);
|
||||
epicsShareFunc int callbackRequest(epicsCallback *pCallback);
|
||||
epicsShareFunc void callbackSetProcess(
|
||||
CALLBACK *pcallback, int Priority, void *pRec);
|
||||
epicsCallback *pcallback, int Priority, void *pRec);
|
||||
epicsShareFunc int callbackRequestProcessCallback(
|
||||
CALLBACK *pCallback,int Priority, void *pRec);
|
||||
epicsCallback *pCallback,int Priority, void *pRec);
|
||||
epicsShareFunc void callbackRequestDelayed(
|
||||
CALLBACK *pCallback,double seconds);
|
||||
epicsShareFunc void callbackCancelDelayed(CALLBACK *pcallback);
|
||||
epicsCallback *pCallback,double seconds);
|
||||
epicsShareFunc void callbackCancelDelayed(epicsCallback *pcallback);
|
||||
epicsShareFunc void callbackRequestProcessCallbackDelayed(
|
||||
CALLBACK *pCallback, int Priority, void *pRec, double seconds);
|
||||
epicsCallback *pCallback, int Priority, void *pRec, double seconds);
|
||||
epicsShareFunc int callbackSetQueueSize(int size);
|
||||
epicsShareFunc int callbackParallelThreads(int count, const char *prio);
|
||||
|
||||
|
||||
@@ -1165,3 +1165,8 @@ void db_delete_field_log (db_field_log *pfl)
|
||||
freeListFree(dbevFieldLogFreeList, pfl);
|
||||
}
|
||||
}
|
||||
|
||||
int db_available_logs(void)
|
||||
{
|
||||
return (int) freeListItemsAvail(dbevFieldLogFreeList);
|
||||
}
|
||||
|
||||
@@ -78,6 +78,7 @@ epicsShareFunc void db_event_disable (dbEventSubscription es);
|
||||
epicsShareFunc struct db_field_log* db_create_event_log (struct evSubscrip *pevent);
|
||||
epicsShareFunc struct db_field_log* db_create_read_log (struct dbChannel *chan);
|
||||
epicsShareFunc void db_delete_field_log (struct db_field_log *pfl);
|
||||
epicsShareFunc int db_available_logs(void);
|
||||
|
||||
#define DB_EVENT_OK 0
|
||||
#define DB_EVENT_ERROR (-1)
|
||||
@@ -87,4 +88,3 @@ epicsShareFunc void db_delete_field_log (struct db_field_log *pfl);
|
||||
#endif
|
||||
|
||||
#endif /*INCLdbEventh*/
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ typedef struct notifyPvt {
|
||||
ELLNODE node; /*For free list*/
|
||||
long magic;
|
||||
short state;
|
||||
CALLBACK callback;
|
||||
epicsCallback callback;
|
||||
ELLLIST waitList; /*list of records for current processNotify*/
|
||||
short cancelWait;
|
||||
short userCallbackWait;
|
||||
@@ -93,7 +93,7 @@ static void notifyCleanup(processNotify *ppn);
|
||||
static void restartCheck(processNotifyRecord *ppnr);
|
||||
static void callDone(dbCommon *precord,processNotify *ppn);
|
||||
static void processNotifyCommon(processNotify *ppn,dbCommon *precord);
|
||||
static void notifyCallback(CALLBACK *pcallback);
|
||||
static void notifyCallback(epicsCallback *pcallback);
|
||||
|
||||
#define ellSafeAdd(list,listnode) \
|
||||
{ \
|
||||
@@ -265,7 +265,7 @@ static void processNotifyCommon(processNotify *ppn,dbCommon *precord)
|
||||
callDone(precord, ppn);
|
||||
}
|
||||
|
||||
static void notifyCallback(CALLBACK *pcallback)
|
||||
static void notifyCallback(epicsCallback *pcallback)
|
||||
{
|
||||
processNotify *ppn = NULL;
|
||||
dbCommon *precord;
|
||||
|
||||
@@ -109,7 +109,7 @@ static char *priorityName[NUM_CALLBACK_PRIORITIES] = {
|
||||
/* EVENT */
|
||||
|
||||
typedef struct event_list {
|
||||
CALLBACK callback[NUM_CALLBACK_PRIORITIES];
|
||||
epicsCallback callback[NUM_CALLBACK_PRIORITIES];
|
||||
scan_list scan_list[NUM_CALLBACK_PRIORITIES];
|
||||
struct event_list *next;
|
||||
char eventname[1]; /* actually arbitrary size */
|
||||
@@ -120,7 +120,7 @@ static epicsMutexId event_lock;
|
||||
/* IO_EVENT*/
|
||||
|
||||
typedef struct io_scan_list {
|
||||
CALLBACK callback;
|
||||
epicsCallback callback;
|
||||
scan_list scan_list;
|
||||
} io_scan_list;
|
||||
|
||||
@@ -141,9 +141,9 @@ static void periodicTask(void *arg);
|
||||
static void initPeriodic(void);
|
||||
static void deletePeriodic(void);
|
||||
static void spawnPeriodic(int ind);
|
||||
static void eventCallback(CALLBACK *pcallback);
|
||||
static void eventCallback(epicsCallback *pcallback);
|
||||
static void ioscanInit(void);
|
||||
static void ioscanCallback(CALLBACK *pcallback);
|
||||
static void ioscanCallback(epicsCallback *pcallback);
|
||||
static void ioscanDestroy(void);
|
||||
static void printList(scan_list *psl, char *message);
|
||||
static void scanList(scan_list *psl);
|
||||
@@ -448,7 +448,7 @@ int scanpiol(void) /* print pioscan_list */
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void eventCallback(CALLBACK *pcallback)
|
||||
static void eventCallback(epicsCallback *pcallback)
|
||||
{
|
||||
scan_list *psl;
|
||||
|
||||
@@ -863,7 +863,7 @@ static void spawnPeriodic(int ind)
|
||||
epicsEventWait(startStopEvent);
|
||||
}
|
||||
|
||||
static void ioscanCallback(CALLBACK *pcallback)
|
||||
static void ioscanCallback(epicsCallback *pcallback)
|
||||
{
|
||||
ioscan_head *piosh = (ioscan_head *) pcallback->user;
|
||||
int prio = pcallback->priority;
|
||||
|
||||
@@ -54,7 +54,7 @@ typedef struct msgBuff TAB_BUFFER;
|
||||
# define MIN(x,y) (((x) < (y)) ? (x) : (y))
|
||||
#endif
|
||||
#ifndef MAX
|
||||
# define MAX(x,y) (((x) < (y)) ? (x) : (y))
|
||||
# define MAX(x,y) (((x) > (y)) ? (x) : (y))
|
||||
#endif
|
||||
|
||||
/* Local Routines */
|
||||
|
||||
@@ -7,6 +7,17 @@
|
||||
# and higher are distributed subject to a Software License Agreement found
|
||||
# in file LICENSE that is included with this distribution.
|
||||
#*************************************************************************
|
||||
|
||||
=head1 Menu menuAlarmStat
|
||||
|
||||
This menu defines the possible alarm statuses that EPICS records can exhibit
|
||||
which is used for C<STAT> and C<NSTA> fields of all record types.
|
||||
See L<Alarm Status> for more information.
|
||||
|
||||
=menu menuAlarmStat
|
||||
|
||||
=cut
|
||||
|
||||
menu(menuAlarmStat) {
|
||||
choice(menuAlarmStatNO_ALARM,"NO_ALARM")
|
||||
choice(menuAlarmStatREAD,"READ")
|
||||
@@ -7,6 +7,15 @@
|
||||
# and higher are distributed subject to a Software License Agreement found
|
||||
# in file LICENSE that is included with this distribution.
|
||||
#*************************************************************************
|
||||
|
||||
=head1 Menu menuFtype
|
||||
|
||||
This menu is used for the C<FTVL> and similar fields of many record types.
|
||||
|
||||
=menu menuFtype
|
||||
|
||||
=cut
|
||||
|
||||
menu(menuFtype) {
|
||||
choice(menuFtypeSTRING,"STRING")
|
||||
choice(menuFtypeCHAR,"CHAR")
|
||||
@@ -3,10 +3,19 @@
|
||||
# National Laboratory.
|
||||
# Copyright (c) 2002 The Regents of the University of California, as
|
||||
# Operator of Los Alamos National Laboratory.
|
||||
# EPICS BASE Versions 3.13.7
|
||||
# and higher are distributed subject to a Software License Agreement found
|
||||
# in file LICENSE that is included with this distribution.
|
||||
# EPICS BASE is distributed subject to a Software License Agreement found
|
||||
# in file LICENSE that is included with this distribution.
|
||||
#*************************************************************************
|
||||
|
||||
=head1 Menu menuIvoa
|
||||
|
||||
This menu specifies the possibile actions to take when the INVALID alarm is
|
||||
triggered. See individual record types for more information.
|
||||
|
||||
=menu menuIvoa
|
||||
|
||||
=cut
|
||||
|
||||
menu(menuIvoa) {
|
||||
choice(menuIvoaContinue_normally,"Continue normally")
|
||||
choice(menuIvoaDon_t_drive_outputs,"Don't drive outputs")
|
||||
@@ -1,13 +0,0 @@
|
||||
#*************************************************************************
|
||||
# Copyright (c) 2002 The University of Chicago, 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 Versions 3.13.7
|
||||
# and higher are distributed subject to a Software License Agreement found
|
||||
# in file LICENSE that is included with this distribution.
|
||||
#*************************************************************************
|
||||
menu(menuOmsl) {
|
||||
choice(menuOmslsupervisory,"supervisory")
|
||||
choice(menuOmslclosed_loop,"closed_loop")
|
||||
}
|
||||
@@ -6,19 +6,20 @@
|
||||
# EPICS BASE is distributed subject to a Software License Agreement found
|
||||
# in file LICENSE that is included with this distribution.
|
||||
#*************************************************************************
|
||||
recordtype(state) {
|
||||
include "dbCommon.dbd"
|
||||
field(VAL,DBF_STRING) {
|
||||
prompt("Value")
|
||||
promptgroup("40 - Input")
|
||||
asl(ASL0)
|
||||
pp(TRUE)
|
||||
size(20)
|
||||
}
|
||||
field(OVAL,DBF_STRING) {
|
||||
prompt("Prev Value")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
size(20)
|
||||
}
|
||||
|
||||
=head1 Menu menuOmsl
|
||||
|
||||
This menu is used for the C<OMSL> field of many output record types. It controls
|
||||
whether the record will fetch an input value from its C<DOL> input link when
|
||||
processed, which is useful when it is part of a closed loop control algorithm.
|
||||
The C<supervisory> state means the input link will not be used, C<closed_loop>
|
||||
enables the input link.
|
||||
|
||||
=menu menuOmsl
|
||||
|
||||
=cut
|
||||
|
||||
menu(menuOmsl) {
|
||||
choice(menuOmslsupervisory,"supervisory")
|
||||
choice(menuOmslclosed_loop,"closed_loop")
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
#*************************************************************************
|
||||
# Copyright (c) 2002 The University of Chicago, 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 Versions 3.13.7
|
||||
# and higher are distributed subject to a Software License Agreement found
|
||||
# in file LICENSE that is included with this distribution.
|
||||
#*************************************************************************
|
||||
menu(menuYesNo) {
|
||||
choice(menuYesNoNO,"NO")
|
||||
choice(menuYesNoYES,"YES")
|
||||
}
|
||||
29
src/ioc/db/menuYesNo.dbd.pod
Normal file
29
src/ioc/db/menuYesNo.dbd.pod
Normal file
@@ -0,0 +1,29 @@
|
||||
#*************************************************************************
|
||||
# Copyright (c) 2002 The University of Chicago, 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.
|
||||
#*************************************************************************
|
||||
|
||||
=head1 Menu menuYesNo
|
||||
|
||||
This menu is used by many record types to specify simple C<NO> or C<YES>
|
||||
options for record-specific purposes.
|
||||
|
||||
Note that no other values for a field that uses menuYesNo are possible, e.g.
|
||||
C<MAYBE> or C<NO WAY> would not be accepted as choices for the field.
|
||||
Also, the choices C<yes>, C<No>, and C<Yes> are not valid choices since they
|
||||
don't match the case of C<NO> or C<YES>.
|
||||
The integer values C<0> and C<1> may often be used instead however, they are
|
||||
used as an index into the choices so C<0> becomes C<NO> and C<1> becomes <YES>.
|
||||
|
||||
=menu menuYesNo
|
||||
|
||||
=cut
|
||||
|
||||
menu(menuYesNo) {
|
||||
choice(menuYesNoNO,"NO")
|
||||
choice(menuYesNoYES,"YES")
|
||||
}
|
||||
@@ -44,8 +44,8 @@
|
||||
#define TEST_DELAY(i) ((i / NUM_CALLBACK_PRIORITIES) * DELAY_QUANTUM)
|
||||
|
||||
typedef struct myPvt {
|
||||
CALLBACK cb1;
|
||||
CALLBACK cb2;
|
||||
epicsCallback cb1;
|
||||
epicsCallback cb2;
|
||||
epicsTimeStamp pass1Time;
|
||||
epicsTimeStamp pass2Time;
|
||||
double delay;
|
||||
@@ -55,7 +55,7 @@ typedef struct myPvt {
|
||||
|
||||
epicsEventId finished;
|
||||
|
||||
static void myCallback(CALLBACK *pCallback)
|
||||
static void myCallback(epicsCallback *pCallback)
|
||||
{
|
||||
myPvt *pmyPvt;
|
||||
|
||||
@@ -74,7 +74,7 @@ static void myCallback(CALLBACK *pCallback)
|
||||
}
|
||||
}
|
||||
|
||||
static void finalCallback(CALLBACK *pCallback)
|
||||
static void finalCallback(epicsCallback *pCallback)
|
||||
{
|
||||
myCallback(pCallback);
|
||||
epicsEventSignal(finished);
|
||||
|
||||
@@ -44,8 +44,8 @@
|
||||
#define TEST_DELAY(i) ((i / NUM_CALLBACK_PRIORITIES) * DELAY_QUANTUM)
|
||||
|
||||
typedef struct myPvt {
|
||||
CALLBACK cb1;
|
||||
CALLBACK cb2;
|
||||
epicsCallback cb1;
|
||||
epicsCallback cb2;
|
||||
epicsTimeStamp pass1Time;
|
||||
epicsTimeStamp pass2Time;
|
||||
double delay;
|
||||
@@ -56,7 +56,7 @@ typedef struct myPvt {
|
||||
epicsEventId finished;
|
||||
|
||||
|
||||
static void myCallback(CALLBACK *pCallback)
|
||||
static void myCallback(epicsCallback *pCallback)
|
||||
{
|
||||
myPvt *pmyPvt;
|
||||
|
||||
@@ -75,7 +75,7 @@ static void myCallback(CALLBACK *pCallback)
|
||||
}
|
||||
}
|
||||
|
||||
static void finalCallback(CALLBACK *pCallback)
|
||||
static void finalCallback(epicsCallback *pCallback)
|
||||
{
|
||||
myCallback(pCallback);
|
||||
epicsEventSignal(finished);
|
||||
|
||||
@@ -581,25 +581,11 @@ Init (rtems_task_argument ignored)
|
||||
printf ("***** Can't set time: %s\n", rtems_status_text (sc));
|
||||
}
|
||||
if (getenv("TZ") == NULL) {
|
||||
const char *tzp = envGetConfigParamPtr(&EPICS_TIMEZONE);
|
||||
if (tzp == NULL) {
|
||||
printf("Warning -- no timezone information available -- times will be displayed as GMT.\n");
|
||||
}
|
||||
else {
|
||||
char tz[10];
|
||||
int minWest, toDst = 0, fromDst = 0;
|
||||
if(sscanf(tzp, "%9[^:]::%d:%d:%d", tz, &minWest, &toDst, &fromDst) < 2) {
|
||||
printf("Warning: EPICS_TIMEZONE (%s) unrecognizable -- times will be displayed as GMT.\n", tzp);
|
||||
}
|
||||
else {
|
||||
char posixTzBuf[40];
|
||||
char *p = posixTzBuf;
|
||||
p += sprintf(p, "%cST%d:%.2d", tz[0], minWest/60, minWest%60);
|
||||
if (toDst != fromDst)
|
||||
p += sprintf(p, "%cDT", tz[0]);
|
||||
epicsEnvSet("TZ", posixTzBuf);
|
||||
}
|
||||
}
|
||||
const char *tzp = envGetConfigParamPtr(&EPICS_TZ);
|
||||
if (!tzp || *tzp)
|
||||
printf("Warning: No timezone information, times will be displayed in UTC.\n");
|
||||
else
|
||||
epicsEnvSet("TZ", tzp);
|
||||
}
|
||||
tzset();
|
||||
osdTimeRegister();
|
||||
|
||||
2
src/libCom/env/envDefs.h
vendored
2
src/libCom/env/envDefs.h
vendored
@@ -61,7 +61,7 @@ epicsShareExtern const ENV_PARAM EPICS_CAS_BEACON_PORT;
|
||||
epicsShareExtern const ENV_PARAM EPICS_BUILD_COMPILER_CLASS;
|
||||
epicsShareExtern const ENV_PARAM EPICS_BUILD_OS_CLASS;
|
||||
epicsShareExtern const ENV_PARAM EPICS_BUILD_TARGET_ARCH;
|
||||
epicsShareExtern const ENV_PARAM EPICS_TIMEZONE;
|
||||
epicsShareExtern const ENV_PARAM EPICS_TZ;
|
||||
epicsShareExtern const ENV_PARAM EPICS_TS_NTP_INET;
|
||||
epicsShareExtern const ENV_PARAM EPICS_IOC_LOG_PORT;
|
||||
epicsShareExtern const ENV_PARAM EPICS_IOC_LOG_INET;
|
||||
|
||||
@@ -77,7 +77,7 @@ Com_SRCS += epicsGeneralTime.c
|
||||
|
||||
# Time providers
|
||||
Com_SRCS += osiClockTime.c
|
||||
Com_SRCS_vxWorks += osiNTPTime.c
|
||||
Com_SRCS_vxWorks += osiNTPTime.c tz2timezone.c
|
||||
Com_SRCS_RTEMS += osiNTPTime.c
|
||||
|
||||
ifeq ($(OS_CLASS),vxWorks)
|
||||
|
||||
@@ -952,7 +952,8 @@ extern "C" {
|
||||
try {
|
||||
local_tm_nano_sec tmns = epicsTime (*pSrc);
|
||||
*pDest = tmns.ansi_tm;
|
||||
*pNSecDest = tmns.nSec;
|
||||
if (pNSecDest)
|
||||
*pNSecDest = tmns.nSec;
|
||||
}
|
||||
catch (...) {
|
||||
return epicsTimeERROR;
|
||||
@@ -964,7 +965,8 @@ extern "C" {
|
||||
try {
|
||||
gm_tm_nano_sec gmtmns = epicsTime (*pSrc);
|
||||
*pDest = gmtmns.ansi_tm;
|
||||
*pNSecDest = gmtmns.nSec;
|
||||
if (pNSecDest)
|
||||
*pNSecDest = gmtmns.nSec;
|
||||
}
|
||||
catch (...) {
|
||||
return epicsTimeERROR;
|
||||
|
||||
@@ -24,22 +24,38 @@
|
||||
|
||||
#define NTP_REQUEST_TIMEOUT 4 /* seconds */
|
||||
|
||||
extern "C" {
|
||||
int tz2timezone(void);
|
||||
}
|
||||
|
||||
static char sntp_sync_task[] = "ipsntps";
|
||||
static char ntp_daemon[] = "ipntpd";
|
||||
|
||||
static const char *pserverAddr = NULL;
|
||||
static CLOCKTIME_SYNCHOOK prevHook;
|
||||
|
||||
extern char* sysBootLine;
|
||||
|
||||
static void timeSync(int synchronized) {
|
||||
if (!tz2timezone())
|
||||
ClockTime_syncHook = prevHook; /* Don't call me again */
|
||||
}
|
||||
|
||||
static int timeRegister(void)
|
||||
{
|
||||
/* If TIMEZONE not defined, set it from EPICS_TIMEZONE */
|
||||
if (getenv("TIMEZONE") == NULL) {
|
||||
const char *timezone = envGetConfigParamPtr(&EPICS_TIMEZONE);
|
||||
if (timezone == NULL) {
|
||||
printf("timeRegister: No Time Zone Information\n");
|
||||
} else {
|
||||
epicsEnvSet("TIMEZONE", timezone);
|
||||
/* If TZ not defined, set it from EPICS_TZ */
|
||||
if (getenv("TZ") == NULL) {
|
||||
const char *tz = envGetConfigParamPtr(&EPICS_TZ);
|
||||
|
||||
if (tz && *tz) {
|
||||
epicsEnvSet("TZ", tz);
|
||||
|
||||
/* Call tz2timezone() once we know what year it is */
|
||||
prevHook = ClockTime_syncHook;
|
||||
ClockTime_syncHook = timeSync;
|
||||
}
|
||||
else if (getenv("TIMEZONE") == NULL)
|
||||
printf("timeRegister: No Time Zone Information available\n");
|
||||
}
|
||||
|
||||
// Define EPICS_TS_FORCE_NTPTIME to force use of NTPTime provider
|
||||
@@ -57,7 +73,7 @@ static int timeRegister(void)
|
||||
}
|
||||
|
||||
if (useNTP) {
|
||||
// Start NTP first so it can be used to sync SysTime
|
||||
// Start NTP first so it can be used to sync ClockTime
|
||||
NTPTime_Init(100);
|
||||
ClockTime_Init(CLOCKTIME_SYNC);
|
||||
} else {
|
||||
|
||||
278
src/libCom/osi/os/vxWorks/tz2timezone.c
Normal file
278
src/libCom/osi/os/vxWorks/tz2timezone.c
Normal file
@@ -0,0 +1,278 @@
|
||||
/*************************************************************************\
|
||||
* Copyright (c) 2009 Brookhaven Science Associates, as Operator of
|
||||
* Brookhaven National Laboratory.
|
||||
* Copyright (c) 2019 UChicago Argonne LLC, as Operator of Argonne
|
||||
* National Laboratory.
|
||||
* EPICS BASE is distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
/*
|
||||
* Authors: Larry Hoff, Andrew Johnson <anj@anl.gov>
|
||||
*/
|
||||
|
||||
/*
|
||||
* This file exports a single function "int tz2timezone(void)" which reads
|
||||
* the TZ environment variable (defined by POSIX) and converts it to the
|
||||
* TIMEZONE environment variable defined by ANSI. The latter is used by
|
||||
* VxWorks "time" functions, is largely deprecated in other computing
|
||||
* environments, has limitations, and is difficult to maintain. This holds
|
||||
* out the possibility of "pretending" that VxWorks supports "TZ" - until
|
||||
* such time as it actually does.
|
||||
*
|
||||
* For simplicity, only the "POSIX standard form" of TZ will be supported.
|
||||
* Even that is complicated enough (see following spec). Furthermore,
|
||||
* only the "M" form of DST start and stop dates are supported.
|
||||
*
|
||||
* TZ = zone[-]offset[dst[offset],start[/time],end[/time]]
|
||||
*
|
||||
* zone
|
||||
* A three or more letter name for the timezone in normal (winter) time.
|
||||
*
|
||||
* [-]offset
|
||||
* A signed time giving the offset of the time zone westwards from
|
||||
* Greenwich. The time has the form hh[:mm[:ss]] with a one of two
|
||||
* digit hour, and optional two digit minutes and seconds.
|
||||
*
|
||||
* dst
|
||||
* The name of the time zone when daylight saving is in effect. It may
|
||||
* be followed by an offset giving how big the adjustment is, required
|
||||
* if different than the default of 1 hour.
|
||||
*
|
||||
* start/time,end/time
|
||||
* Specify the start and end of the daylight saving period. The start
|
||||
* and end fields indicate on what day the changeover occurs, and must
|
||||
* be in this format:
|
||||
*
|
||||
* Mm.n.d
|
||||
* This indicates month m, the n-th occurrence of day d, where
|
||||
* 1 <= m <= 12, 1 <= n <= 5, 0 <= d <= 6, 0=Sunday
|
||||
* The 5th occurrence means the last occurrence of that day in a
|
||||
* month. So M4.1.0 is the first Sunday in April, M9.5.0 is the
|
||||
* last Sunday in September.
|
||||
*
|
||||
* The time field indicates what hour the changeover occurs on the given
|
||||
* day (TIMEZONE only supports switching on the hour).
|
||||
*
|
||||
*/
|
||||
|
||||
#include <vxWorks.h>
|
||||
#include <envLib.h> /* getenv() */
|
||||
#include <stdio.h> /* printf() */
|
||||
#include <string.h> /* strchr() */
|
||||
#include <ctype.h> /* isalpha() */
|
||||
|
||||
#include <epicsTime.h>
|
||||
|
||||
/* for reference: TZ syntax, example, and TIMEZONE example
|
||||
* std offset dst [offset],start[/time],end[/time]
|
||||
* CST6CDT5,M3.2.0,M11.1.0
|
||||
* EST+5EDT,M4.1.0/2,M10.5.0/2
|
||||
*
|
||||
* std <unused> offset start stop
|
||||
* TIMEZONE=EST::300:030802:110102
|
||||
*/
|
||||
|
||||
static int extractDate(const char *tz, struct tm *current, char *s)
|
||||
{
|
||||
static const int startdays[] = {
|
||||
0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334
|
||||
};
|
||||
static const int molengths[] = {
|
||||
31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
|
||||
};
|
||||
|
||||
int month, week, weekday, hour=2; /* default=2AM */
|
||||
int jan1wday, wday, mday;
|
||||
|
||||
/* Require 'M' format */
|
||||
if (*++tz != 'M') {
|
||||
printf("tz2timezone: Unsupported date type, need 'M' format\n");
|
||||
return ERROR;
|
||||
}
|
||||
tz++;
|
||||
|
||||
if (sscanf(tz, "%d.%d.%d/%d", &month, &week, &weekday, &hour) < 3)
|
||||
return ERROR; /* something important missing */
|
||||
|
||||
if (month == 0 || month>12 ||
|
||||
week < 1 || week > 5 ||
|
||||
weekday < 0 || weekday > 6 ||
|
||||
hour < 0 || hour > 23)
|
||||
return ERROR;
|
||||
|
||||
/* Now for some brute-force calendar calculations... */
|
||||
/* start month is in "month", and the day is "weekday", but
|
||||
we need to know when that weekday first occurs in that month */
|
||||
/* Let's start with weekday on Jan. 1 */
|
||||
jan1wday = (7 + current->tm_wday - (current->tm_yday % 7)) % 7;
|
||||
|
||||
/* We need to know if it is a leap year (and if it matters) */
|
||||
/* Let's assume that we're working with a date between 1901 and 2099,
|
||||
that way we don't have to think about the "century exception".
|
||||
If this code is still running (unchanged) in 2100, I'll be stunned
|
||||
(and 139 years old) */
|
||||
wday = (jan1wday + startdays[month-1] +
|
||||
((month > 2 && (current->tm_year % 4 == 0)) ? 1 : 0)) % 7;
|
||||
|
||||
/* Let's see on what day-of-the-month the first target weekday occurs
|
||||
(counting from 1). The result is a number between 1 and 7, inclusive. */
|
||||
mday = 1 + ((7 + weekday - wday) % 7);
|
||||
|
||||
/* Next, we add the week offset. If we overflow the month, we subtract
|
||||
one week */
|
||||
mday += 7 * (week - 1);
|
||||
if (mday > molengths[month-1])
|
||||
mday -= 7;
|
||||
|
||||
/* Should I handle Feb 29? I'm willing to gamble that no one in their right
|
||||
mind would schedule a time change to occur on Feb. 29. If so, we'll be a
|
||||
week early */
|
||||
sprintf(s, "%02d%02d%02d", month, mday, hour);
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
|
||||
static const char *getTime(const char *s, int *time)
|
||||
{
|
||||
/* Time format is [+/-]hh[:mm][:ss] followed by the next zone name */
|
||||
|
||||
*time = 0;
|
||||
|
||||
if (!isdigit((int) s[0]))
|
||||
return s; /* no number here... */
|
||||
|
||||
if (!isdigit((int) s[1])) { /* single digit form */
|
||||
*time = s[0] - '0';
|
||||
return s + 1;
|
||||
}
|
||||
|
||||
if (isdigit((int) s[1])) { /* two digit form */
|
||||
*time = 10 * (s[0] - '0') + (s[1] - '0');
|
||||
return s + 2;
|
||||
}
|
||||
|
||||
return s; /* does not follow supported form */
|
||||
}
|
||||
|
||||
int tz2timezone(void)
|
||||
{
|
||||
const char *tz = getenv("TZ");
|
||||
/* Spec. says that zone names must be at least 3 chars.
|
||||
* I've never seen a longer zone name, but I'll allocate
|
||||
* 40 chars. If you live in a zone with a longer name,
|
||||
* you may want to think about the benefits of relocation.
|
||||
*/
|
||||
char zone[40];
|
||||
char start[10], stop[10]; /* only really need 7 bytes now */
|
||||
int hours = 0, minutes = 0, sign = 1;
|
||||
/* This is more than enough, even with a 40-char zone
|
||||
* name, and 4-char offset.
|
||||
*/
|
||||
char timezone[100];
|
||||
int i = 0; /* You *always need an "i" :-) */
|
||||
epicsTimeStamp now;
|
||||
struct tm current;
|
||||
|
||||
/* First let's get the current time. We need the year to
|
||||
* compute the start/stop dates for DST.
|
||||
*/
|
||||
if (epicsTimeGetCurrent(&now) ||
|
||||
epicsTimeToTM(¤t, NULL, &now))
|
||||
return ERROR;
|
||||
|
||||
/* Make sure TZ exists.
|
||||
* Spec. says that ZONE must be at least 3 chars.
|
||||
*/
|
||||
if ((!tz) || (strlen(tz) < 3))
|
||||
return ERROR;
|
||||
|
||||
/* OK, now a bunch of brute-force parsing. My brain hurts if
|
||||
* I try to think of an elegant regular expression for the
|
||||
* string.
|
||||
*/
|
||||
|
||||
/* Start extracting zone name, must be alpha */
|
||||
while ((i < sizeof(zone) - 1) && isalpha((int) *tz)) {
|
||||
zone[i++] = *tz++;
|
||||
}
|
||||
if (i < 3)
|
||||
return ERROR; /* Too short, not a real zone name? */
|
||||
|
||||
zone[i] = 0; /* Nil-terminate (for now) */
|
||||
|
||||
/* Now extract offset time. The format is [+/-]hh[:mm[:ss]]
|
||||
* Recall that TIMEZONE doesn't support seconds....
|
||||
*/
|
||||
if (*tz == '-') {
|
||||
sign = -1;
|
||||
tz++;
|
||||
}
|
||||
else if (*tz == '+') {
|
||||
tz++;
|
||||
}
|
||||
|
||||
/* Need a digit now */
|
||||
if (!isdigit((int) *tz))
|
||||
return ERROR;
|
||||
|
||||
/* First get the hours */
|
||||
tz = getTime(tz, &hours);
|
||||
if (hours > 24)
|
||||
return ERROR;
|
||||
|
||||
if (*tz == ':') { /* There is a minutes part */
|
||||
/* Need another digit now */
|
||||
if (!isdigit((int) *++tz))
|
||||
return ERROR;
|
||||
|
||||
/* Extract the minutes */
|
||||
tz = getTime(tz, &minutes);
|
||||
if (minutes > 60)
|
||||
return ERROR;
|
||||
|
||||
/* Skip any seconds part */
|
||||
if (*tz == ':') {
|
||||
int seconds;
|
||||
tz = getTime(tz + 1, &seconds);
|
||||
}
|
||||
}
|
||||
|
||||
/* Extract any DST zone name, must be alpha */
|
||||
if (isalpha((int) *tz)) {
|
||||
zone[i++] = '/'; /* Separate the names */
|
||||
|
||||
while ((i < sizeof(zone) - 1) && isalpha((int) *tz)) {
|
||||
zone[i++] = *tz++;
|
||||
}
|
||||
zone[i] = 0; /* Nil-terminate */
|
||||
}
|
||||
|
||||
minutes += hours * 60;
|
||||
minutes *= sign;
|
||||
|
||||
/* Look for start/stop dates - require neither or both */
|
||||
tz = strchr(tz, ',');
|
||||
if (!tz) { /* No daylight savings time here */
|
||||
/* Format the env. variable */
|
||||
sprintf(timezone, "TIMEZONE=%s::%d", zone, minutes);
|
||||
}
|
||||
else {
|
||||
if (extractDate(tz, ¤t, start) != OK)
|
||||
return ERROR;
|
||||
|
||||
tz = strchr(tz + 1, ',');
|
||||
if (!tz)
|
||||
return ERROR;
|
||||
if (extractDate(tz, ¤t, stop) != OK)
|
||||
return ERROR;
|
||||
|
||||
/* Format the env. variable */
|
||||
sprintf(timezone, "TIMEZONE=%s::%d:%s:%s", zone, minutes, start, stop);
|
||||
}
|
||||
|
||||
/* Make it live! */
|
||||
putenv(timezone);
|
||||
|
||||
return OK;
|
||||
}
|
||||
@@ -23,7 +23,8 @@
|
||||
#include "taskwd.h"
|
||||
|
||||
#define NSEC_PER_SEC 1000000000
|
||||
#define ClockTimeSyncInterval_value 60.0
|
||||
#define ClockTimeSyncInterval_initial 1.0
|
||||
#define ClockTimeSyncInterval_normal 60.0
|
||||
|
||||
|
||||
static struct {
|
||||
@@ -79,7 +80,7 @@ static void ClockTime_InitOnce(void *pfirst)
|
||||
|
||||
ClockTimePvt.loopEvent = epicsEventMustCreate(epicsEventEmpty);
|
||||
ClockTimePvt.lock = epicsMutexCreate();
|
||||
ClockTimePvt.ClockTimeSyncInterval = 1.0; /* First sync */
|
||||
ClockTimePvt.ClockTimeSyncInterval = ClockTimeSyncInterval_initial;
|
||||
|
||||
epicsAtExit(ClockTime_Shutdown, NULL);
|
||||
|
||||
@@ -148,6 +149,8 @@ void ClockTime_GetProgramStart(epicsTimeStamp *pDest)
|
||||
/* Synchronization thread */
|
||||
|
||||
#if defined(vxWorks) || defined(__rtems__)
|
||||
CLOCKTIME_SYNCHOOK ClockTime_syncHook = NULL;
|
||||
|
||||
static void ClockTimeSync(void *dummy)
|
||||
{
|
||||
taskwdInsert(0, NULL, NULL);
|
||||
@@ -179,11 +182,16 @@ static void ClockTimeSync(void *dummy)
|
||||
ClockTimePvt.syncTime = timeNow;
|
||||
epicsMutexUnlock(ClockTimePvt.lock);
|
||||
|
||||
ClockTimePvt.ClockTimeSyncInterval = ClockTimeSyncInterval_value;
|
||||
if (ClockTime_syncHook)
|
||||
ClockTime_syncHook(1);
|
||||
|
||||
ClockTimePvt.ClockTimeSyncInterval = ClockTimeSyncInterval_normal;
|
||||
}
|
||||
}
|
||||
|
||||
ClockTimePvt.synchronized = 0;
|
||||
if (ClockTime_syncHook)
|
||||
ClockTime_syncHook(0);
|
||||
taskwdRemove(0);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -19,6 +19,12 @@ void ClockTime_Init(int synchronize);
|
||||
void ClockTime_Shutdown(void *dummy);
|
||||
int ClockTime_Report(int level);
|
||||
|
||||
#if defined(vxWorks) || defined(__rtems__)
|
||||
typedef void (* CLOCKTIME_SYNCHOOK)(int synchronized);
|
||||
|
||||
extern CLOCKTIME_SYNCHOOK ClockTime_syncHook;
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -367,7 +367,7 @@ epicsShareFunc void taskwdShow(int level)
|
||||
mCount, tCount, fCount);
|
||||
if (level) {
|
||||
printf("%16.16s %9s %12s %12s %12s\n",
|
||||
"THREAD NAME", "STATE", "EPICS TID", "CALLBACK", "USR ARG");
|
||||
"THREAD NAME", "STATE", "EPICS TID", "epicsCallback", "USR ARG");
|
||||
pt = (struct tNode *)ellFirst(&tList);
|
||||
while (pt != NULL) {
|
||||
epicsThreadGetName(pt->tid, tName, sizeof(tName));
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
/* The following is provided for access security*/
|
||||
/*It allows a CA client to force access security initialization*/
|
||||
|
||||
static void myCallback(CALLBACK *pcallback)
|
||||
static void myCallback(epicsCallback *pcallback)
|
||||
{
|
||||
ASDBCALLBACK *pasdbcallback = (ASDBCALLBACK *)pcallback;
|
||||
subRecord *precord;
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
|
||||
typedef struct devPvt {
|
||||
processNotify pn;
|
||||
CALLBACK callback;
|
||||
epicsCallback callback;
|
||||
long options;
|
||||
int status;
|
||||
int smooth;
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
typedef struct devPvt {
|
||||
processNotify pn;
|
||||
CALLBACK callback;
|
||||
epicsCallback callback;
|
||||
long options;
|
||||
int status;
|
||||
struct {
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
typedef struct devPvt {
|
||||
processNotify pn;
|
||||
CALLBACK callback;
|
||||
epicsCallback callback;
|
||||
long options;
|
||||
int status;
|
||||
struct {
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
typedef struct devPvt {
|
||||
processNotify pn;
|
||||
CALLBACK callback;
|
||||
epicsCallback callback;
|
||||
long options;
|
||||
int status;
|
||||
struct {
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
typedef struct devPvt {
|
||||
processNotify pn;
|
||||
CALLBACK callback;
|
||||
epicsCallback callback;
|
||||
long options;
|
||||
int status;
|
||||
struct {
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
typedef struct devPvt {
|
||||
DBADDR dbaddr;
|
||||
processNotify pn;
|
||||
CALLBACK callback;
|
||||
epicsCallback callback;
|
||||
long options;
|
||||
int status;
|
||||
struct {
|
||||
|
||||
@@ -15,6 +15,7 @@ dbRecStd_SRCS += ts.c
|
||||
dbRecStd_SRCS += dbnd.c
|
||||
dbRecStd_SRCS += arr.c
|
||||
dbRecStd_SRCS += sync.c
|
||||
dbRecStd_SRCS += decimate.c
|
||||
|
||||
HTMLS += filters.html
|
||||
|
||||
|
||||
117
src/std/filters/decimate.c
Normal file
117
src/std/filters/decimate.c
Normal file
@@ -0,0 +1,117 @@
|
||||
/*************************************************************************\
|
||||
* Copyright (c) 2019 UChicago Argonne LLC, as Operator of Argonne
|
||||
* National Laboratory.
|
||||
* Copyright (c) 2010 Brookhaven National Laboratory.
|
||||
* Copyright (c) 2010 Helmholtz-Zentrum Berlin
|
||||
* fuer Materialien und Energie GmbH.
|
||||
* EPICS BASE is distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
/*
|
||||
* Authors: Ralph Lange <Ralph.Lange@bessy.de>,
|
||||
* Andrew Johnson <anj@anl.gov>
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "freeList.h"
|
||||
#include "db_field_log.h"
|
||||
#include "chfPlugin.h"
|
||||
#include "epicsExport.h"
|
||||
|
||||
typedef struct myStruct {
|
||||
epicsInt32 n, i;
|
||||
} myStruct;
|
||||
|
||||
static void *myStructFreeList;
|
||||
|
||||
static const
|
||||
chfPluginArgDef opts[] = {
|
||||
chfInt32(myStruct, n, "n", 1, 0),
|
||||
chfPluginArgEnd
|
||||
};
|
||||
|
||||
static void * allocPvt(void)
|
||||
{
|
||||
myStruct *my = (myStruct*) freeListCalloc(myStructFreeList);
|
||||
return (void *) my;
|
||||
}
|
||||
|
||||
static void freePvt(void *pvt)
|
||||
{
|
||||
freeListFree(myStructFreeList, pvt);
|
||||
}
|
||||
|
||||
static int parse_ok(void *pvt)
|
||||
{
|
||||
myStruct *my = (myStruct*) pvt;
|
||||
|
||||
if (my->n < 1)
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static db_field_log* filter(void* pvt, dbChannel *chan, db_field_log *pfl) {
|
||||
db_field_log *passfl = NULL;
|
||||
myStruct *my = (myStruct*) pvt;
|
||||
epicsInt32 i = my->i;
|
||||
|
||||
if (pfl->ctx == dbfl_context_read)
|
||||
return pfl;
|
||||
|
||||
if (i++ == 0)
|
||||
passfl = pfl;
|
||||
else
|
||||
db_delete_field_log(pfl);
|
||||
|
||||
if (i >= my->n)
|
||||
i = 0;
|
||||
|
||||
my->i = i;
|
||||
return passfl;
|
||||
}
|
||||
|
||||
static void channelRegisterPre(dbChannel *chan, void *pvt,
|
||||
chPostEventFunc **cb_out, void **arg_out, db_field_log *probe)
|
||||
{
|
||||
*cb_out = filter;
|
||||
*arg_out = pvt;
|
||||
}
|
||||
|
||||
static void channel_report(dbChannel *chan, void *pvt, int level, const unsigned short indent)
|
||||
{
|
||||
myStruct *my = (myStruct*) pvt;
|
||||
printf("%*sDecimate (dec): n=%d, i=%d\n", indent, "",
|
||||
my->n, my->i);
|
||||
}
|
||||
|
||||
static chfPluginIf pif = {
|
||||
allocPvt,
|
||||
freePvt,
|
||||
|
||||
NULL, /* parse_error, */
|
||||
parse_ok,
|
||||
|
||||
NULL, /* channel_open, */
|
||||
channelRegisterPre,
|
||||
NULL, /* channelRegisterPost, */
|
||||
channel_report,
|
||||
NULL /* channel_close */
|
||||
};
|
||||
|
||||
static void decInitialize(void)
|
||||
{
|
||||
static int firstTime = 1;
|
||||
|
||||
if (!firstTime) return;
|
||||
firstTime = 0;
|
||||
|
||||
if (!myStructFreeList)
|
||||
freeListInitPvt(&myStructFreeList, sizeof(myStruct), 64);
|
||||
|
||||
chfPluginRegister("dec", &pif, opts);
|
||||
}
|
||||
|
||||
epicsExportRegistrar(decInitialize);
|
||||
@@ -14,6 +14,8 @@ The following filters are available in this release:
|
||||
|
||||
=item * L<Synchronize|/"Synchronize Filter sync">
|
||||
|
||||
=item * L<Decimation|/"Decimation Filter dec">
|
||||
|
||||
=back
|
||||
|
||||
=head2 Using Filters
|
||||
@@ -245,3 +247,41 @@ periods only when "blue" is true by using
|
||||
...
|
||||
|
||||
=cut
|
||||
|
||||
registrar(decInitialize)
|
||||
|
||||
=head3 Decimation Filter C<"dec">
|
||||
|
||||
This filter is used to reduce the number or rate of monitor updates from a
|
||||
channel by an integer factor C<n> that is provided as a filter argument,
|
||||
discarding the other updates. A true decimation following the original meaning
|
||||
of the word would be achieved by giving C<n> as 10, to only allow every tenth
|
||||
update through.
|
||||
|
||||
=head4 Parameters
|
||||
|
||||
=over
|
||||
|
||||
=item Number C<"n">
|
||||
|
||||
The decimation factor, a positive integer. Giving n=1 is equivalent to a no-op
|
||||
that allows all updates to be passed to the client.
|
||||
|
||||
=back
|
||||
|
||||
This filter is intentionally very simplistic. It passes on the first monitor
|
||||
event that it sees after the channel connects, then discards the next N-1 events
|
||||
before sending the next event. If several clients connect to a channel using the
|
||||
same filter settings they may see completely different data streams since each
|
||||
client gets its own instance of the filter whose event counter starts when that
|
||||
client connects.
|
||||
|
||||
=head4 Example
|
||||
|
||||
To sample a 60Hz channel at 1Hz, a 10Hz channel every 6 seconds or a 1Hz channel
|
||||
once every minute:
|
||||
|
||||
Hal$ camonitor 'test:channel' 'test:channel.{"dec":{"n":60}}'
|
||||
...
|
||||
|
||||
=cut
|
||||
|
||||
@@ -109,7 +109,9 @@ static db_field_log* filter(void* pvt, dbChannel *chan, db_field_log *pfl) {
|
||||
passfl = pfl;
|
||||
pfl = NULL;
|
||||
}
|
||||
break;
|
||||
else
|
||||
db_delete_field_log(pfl);
|
||||
goto save_state;
|
||||
case syncModeLast:
|
||||
if (!actstate && my->laststate) {
|
||||
passfl = my->lastfl;
|
||||
@@ -121,28 +123,34 @@ static db_field_log* filter(void* pvt, dbChannel *chan, db_field_log *pfl) {
|
||||
passfl = pfl;
|
||||
pfl = NULL;
|
||||
}
|
||||
break;
|
||||
else
|
||||
db_delete_field_log(pfl);
|
||||
goto save_state;
|
||||
case syncModeWhile:
|
||||
if (actstate) {
|
||||
if (actstate)
|
||||
passfl = pfl;
|
||||
}
|
||||
else
|
||||
db_delete_field_log(pfl);
|
||||
goto no_shift;
|
||||
case syncModeUnless:
|
||||
if (!actstate) {
|
||||
if (!actstate)
|
||||
passfl = pfl;
|
||||
}
|
||||
else
|
||||
db_delete_field_log(pfl);
|
||||
goto no_shift;
|
||||
}
|
||||
|
||||
if (my->lastfl)
|
||||
db_delete_field_log(my->lastfl);
|
||||
my->lastfl = pfl;
|
||||
my->laststate = actstate;
|
||||
|
||||
/* since no copy is made we can't keep a reference to the returned fl */
|
||||
assert(my->lastfl != passfl);
|
||||
|
||||
no_shift:
|
||||
save_state:
|
||||
my->laststate = actstate;
|
||||
|
||||
no_shift:
|
||||
return passfl;
|
||||
}
|
||||
|
||||
|
||||
@@ -56,6 +56,12 @@ syncTest_SRCS += filterTest_registerRecordDeviceDriver.cpp
|
||||
testHarness_SRCS += syncTest.c
|
||||
TESTS += syncTest
|
||||
|
||||
TESTPROD_HOST += decTest
|
||||
decTest_SRCS += decTest.c
|
||||
decTest_SRCS += filterTest_registerRecordDeviceDriver.cpp
|
||||
testHarness_SRCS += decTest.c
|
||||
TESTS += decTest
|
||||
|
||||
# epicsRunFilterTests runs all the test programs in a known working order.
|
||||
testHarness_SRCS += epicsRunFilterTests.c
|
||||
|
||||
|
||||
@@ -39,12 +39,14 @@ static int fl_equal(const db_field_log *pfl1, const db_field_log *pfl2) {
|
||||
static void fl_setup(dbChannel *chan, db_field_log *pfl) {
|
||||
struct dbCommon *prec = dbChannelRecord(chan);
|
||||
|
||||
memset(pfl, 0, sizeof(db_field_log));
|
||||
pfl->ctx = dbfl_context_read;
|
||||
pfl->type = dbfl_type_val;
|
||||
pfl->stat = prec->stat;
|
||||
pfl->sevr = prec->sevr;
|
||||
pfl->time = prec->time;
|
||||
pfl->field_type = dbChannelFieldType(chan);
|
||||
pfl->field_size = dbChannelFieldSize(chan);
|
||||
pfl->no_elements = dbChannelElements(chan);
|
||||
/*
|
||||
* use memcpy to avoid a bus error on
|
||||
@@ -62,6 +64,7 @@ static void changeValue(db_field_log *pfl2, long val) {
|
||||
}
|
||||
|
||||
static void mustPassOnce(dbChannel *pch, db_field_log *pfl2, char* m, double d, long val) {
|
||||
int oldFree = db_available_logs(), newFree;
|
||||
db_field_log *pfl;
|
||||
|
||||
changeValue(pfl2, val);
|
||||
@@ -71,18 +74,26 @@ static void mustPassOnce(dbChannel *pch, db_field_log *pfl2, char* m, double d,
|
||||
testOk(fl_equal(pfl, pfl2), "call 1 does not change field_log data");
|
||||
pfl = dbChannelRunPreChain(pch, pfl2);
|
||||
testOk(NULL == pfl, "call 2 drops field_log");
|
||||
newFree = db_available_logs();
|
||||
testOk(newFree == oldFree + 1, "field_log was freed - %d+1 => %d",
|
||||
oldFree, newFree);
|
||||
}
|
||||
|
||||
static void mustDrop(dbChannel *pch, db_field_log *pfl2, char* m, double d, long val) {
|
||||
int oldFree = db_available_logs(), newFree;
|
||||
db_field_log *pfl;
|
||||
|
||||
changeValue(pfl2, val);
|
||||
testDiag("mode=%s delta=%g filter must drop", m, d);
|
||||
pfl = dbChannelRunPreChain(pch, pfl2);
|
||||
testOk(NULL == pfl, "call 1 drops field_log");
|
||||
newFree = db_available_logs();
|
||||
testOk(newFree == oldFree + 1, "field_log was freed - %d+1 => %d",
|
||||
oldFree, newFree);
|
||||
}
|
||||
|
||||
static void mustPassTwice(dbChannel *pch, db_field_log *pfl2, char* m, double d, long val) {
|
||||
int oldFree = db_available_logs(), newFree;
|
||||
db_field_log *pfl;
|
||||
|
||||
changeValue(pfl2, val);
|
||||
@@ -93,6 +104,9 @@ static void mustPassTwice(dbChannel *pch, db_field_log *pfl2, char* m, double d,
|
||||
pfl = dbChannelRunPreChain(pch, pfl2);
|
||||
testOk(pfl2 == pfl, "call 2 does not drop or replace field_log");
|
||||
testOk(fl_equal(pfl, pfl2), "call 2 does not change field_log data");
|
||||
newFree = db_available_logs();
|
||||
testOk(newFree == oldFree, "field_log was not freed - %d => %d",
|
||||
oldFree, newFree);
|
||||
}
|
||||
|
||||
static void testHead (char* title) {
|
||||
@@ -113,8 +127,9 @@ MAIN(dbndTest)
|
||||
db_field_log *pfl2;
|
||||
db_field_log fl1;
|
||||
dbEventCtx evtctx;
|
||||
int logsFree, logsFinal;
|
||||
|
||||
testPlan(59);
|
||||
testPlan(77);
|
||||
|
||||
testdbPrepare();
|
||||
|
||||
@@ -135,6 +150,11 @@ MAIN(dbndTest)
|
||||
testOk(!!(pch = dbChannelCreate("x.VAL{\"dbnd\":{}}")), "dbChannel with plugin dbnd (delta=0) created");
|
||||
testOk((ellCount(&pch->filters) == 1), "channel has one plugin");
|
||||
|
||||
/* Start the free-list */
|
||||
db_delete_field_log(db_create_read_log(pch));
|
||||
logsFree = db_available_logs();
|
||||
testDiag("%d field_logs on free-list", logsFree);
|
||||
|
||||
memset(&fl, PATTERN, sizeof(fl));
|
||||
fl1 = fl;
|
||||
node = ellFirst(&pch->filters);
|
||||
@@ -176,6 +196,8 @@ MAIN(dbndTest)
|
||||
|
||||
dbChannelDelete(pch);
|
||||
|
||||
testDiag("%d field_logs on free-list", db_available_logs());
|
||||
|
||||
/* Delta = -1: pass any update */
|
||||
|
||||
testHead("Delta = -1: pass any update");
|
||||
@@ -192,6 +214,8 @@ MAIN(dbndTest)
|
||||
db_delete_field_log(pfl2);
|
||||
dbChannelDelete(pch);
|
||||
|
||||
testDiag("%d field_logs on free-list", db_available_logs());
|
||||
|
||||
/* Delta = absolute */
|
||||
|
||||
testHead("Delta = absolute");
|
||||
@@ -224,6 +248,8 @@ MAIN(dbndTest)
|
||||
|
||||
dbChannelDelete(pch);
|
||||
|
||||
testDiag("%d field_logs on free-list", db_available_logs());
|
||||
|
||||
/* Delta = relative */
|
||||
|
||||
testHead("Delta = relative");
|
||||
@@ -275,6 +301,9 @@ MAIN(dbndTest)
|
||||
|
||||
dbChannelDelete(pch);
|
||||
|
||||
logsFinal = db_available_logs();
|
||||
testOk(logsFree == logsFinal, "%d field_logs on free-list", logsFinal);
|
||||
|
||||
db_close_events(evtctx);
|
||||
|
||||
testIocShutdownOk();
|
||||
|
||||
289
src/std/filters/test/decTest.c
Normal file
289
src/std/filters/test/decTest.c
Normal file
@@ -0,0 +1,289 @@
|
||||
/*************************************************************************\
|
||||
* Copyright (c) 2019 UChicago Argonne LLC, as Operator of Argonne
|
||||
* National Laboratory.
|
||||
* Copyright (c) 2010 Brookhaven National Laboratory.
|
||||
* Copyright (c) 2010 Helmholtz-Zentrum Berlin
|
||||
* fuer Materialien und Energie GmbH.
|
||||
* EPICS BASE is distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
/*
|
||||
* Authors: Ralph Lange <Ralph.Lange@bessy.de>,
|
||||
* Andrew Johnson <anj@anl.gov>
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "dbStaticLib.h"
|
||||
#include "dbAccessDefs.h"
|
||||
#include "db_field_log.h"
|
||||
#include "dbCommon.h"
|
||||
#include "dbChannel.h"
|
||||
#include "registry.h"
|
||||
#include "chfPlugin.h"
|
||||
#include "errlog.h"
|
||||
#include "dbmf.h"
|
||||
#include "epicsUnitTest.h"
|
||||
#include "dbUnitTest.h"
|
||||
#include "epicsTime.h"
|
||||
#include "testMain.h"
|
||||
#include "osiFileName.h"
|
||||
|
||||
void filterTest_registerRecordDeviceDriver(struct dbBase *);
|
||||
|
||||
static int fl_equal(const db_field_log *pfl1, const db_field_log *pfl2) {
|
||||
return !(memcmp(pfl1, pfl2, sizeof(db_field_log)));
|
||||
}
|
||||
|
||||
static void fl_setup(dbChannel *chan, db_field_log *pfl, long val) {
|
||||
struct dbCommon *prec = dbChannelRecord(chan);
|
||||
|
||||
memset(pfl, 0, sizeof(db_field_log));
|
||||
pfl->ctx = dbfl_context_event;
|
||||
pfl->type = dbfl_type_val;
|
||||
pfl->stat = prec->stat;
|
||||
pfl->sevr = prec->sevr;
|
||||
pfl->time = prec->time;
|
||||
pfl->field_type = DBF_LONG;
|
||||
pfl->field_size = sizeof(epicsInt32);
|
||||
pfl->no_elements = 1;
|
||||
/*
|
||||
* use memcpy to avoid a bus error on
|
||||
* union copy of char in the db at an odd
|
||||
* address
|
||||
*/
|
||||
memcpy(&pfl->u.v.field,
|
||||
dbChannelField(chan),
|
||||
dbChannelFieldSize(chan));
|
||||
pfl->u.v.field.dbf_long = val;
|
||||
}
|
||||
|
||||
static void testHead (char* title) {
|
||||
testDiag("--------------------------------------------------------");
|
||||
testDiag("%s", title);
|
||||
testDiag("--------------------------------------------------------");
|
||||
}
|
||||
|
||||
static void mustDrop(dbChannel *pch, db_field_log *pfl, char* m) {
|
||||
int oldFree = db_available_logs();
|
||||
db_field_log *pfl2 = dbChannelRunPreChain(pch, pfl);
|
||||
int newFree = db_available_logs();
|
||||
|
||||
testOk(NULL == pfl2, "filter drops field_log (%s)", m);
|
||||
testOk(newFree == oldFree + 1, "field_log was freed - %d+1 => %d",
|
||||
oldFree, newFree);
|
||||
|
||||
db_delete_field_log(pfl2);
|
||||
}
|
||||
|
||||
static void mustPass(dbChannel *pch, db_field_log *pfl, char* m) {
|
||||
int oldFree = db_available_logs();
|
||||
db_field_log *pfl2 = dbChannelRunPreChain(pch, pfl);
|
||||
int newFree = db_available_logs();
|
||||
|
||||
testOk(pfl == pfl2, "filter passes field_log (%s)", m);
|
||||
testOk(newFree == oldFree, "field_log was not freed - %d => %d",
|
||||
oldFree, newFree);
|
||||
|
||||
db_delete_field_log(pfl2);
|
||||
}
|
||||
|
||||
static void checkAndOpenChannel(dbChannel *pch, const chFilterPlugin *plug) {
|
||||
ELLNODE *node;
|
||||
chFilter *filter;
|
||||
chPostEventFunc *cb_out = NULL;
|
||||
void *arg_out = NULL;
|
||||
db_field_log fl, fl1;
|
||||
|
||||
testDiag("Test filter structure and open channel");
|
||||
|
||||
testOk((ellCount(&pch->filters) == 1), "channel has one plugin");
|
||||
|
||||
fl_setup(pch, &fl, 1);
|
||||
fl1 = fl;
|
||||
node = ellFirst(&pch->filters);
|
||||
filter = CONTAINER(node, chFilter, list_node);
|
||||
plug->fif->channel_register_pre(filter, &cb_out, &arg_out, &fl1);
|
||||
testOk(cb_out && arg_out,
|
||||
"register_pre registers one filter with argument");
|
||||
testOk(fl_equal(&fl1, &fl),
|
||||
"register_pre does not change field_log data type");
|
||||
|
||||
testOk(!(dbChannelOpen(pch)), "dbChannel with plugin dec opened");
|
||||
node = ellFirst(&pch->pre_chain);
|
||||
filter = CONTAINER(node, chFilter, pre_node);
|
||||
testOk((ellCount(&pch->pre_chain) == 1 && filter->pre_arg != NULL),
|
||||
"dec has one filter with argument in pre chain");
|
||||
testOk((ellCount(&pch->post_chain) == 0),
|
||||
"sync has no filter in post chain");
|
||||
}
|
||||
|
||||
MAIN(decTest)
|
||||
{
|
||||
dbChannel *pch;
|
||||
const chFilterPlugin *plug;
|
||||
char myname[] = "dec";
|
||||
db_field_log *pfl[10];
|
||||
int i, logsFree, logsFinal;
|
||||
dbEventCtx evtctx;
|
||||
|
||||
testPlan(104);
|
||||
|
||||
testdbPrepare();
|
||||
|
||||
testdbReadDatabase("filterTest.dbd", NULL, NULL);
|
||||
|
||||
filterTest_registerRecordDeviceDriver(pdbbase);
|
||||
|
||||
testdbReadDatabase("xRecord.db", NULL, NULL);
|
||||
|
||||
eltc(0);
|
||||
testIocInitOk();
|
||||
eltc(1);
|
||||
|
||||
evtctx = db_init_events();
|
||||
|
||||
testOk(!!(plug = dbFindFilter(myname, strlen(myname))),
|
||||
"plugin '%s' registered correctly", myname);
|
||||
|
||||
/* N < 1 */
|
||||
testOk(!(pch = dbChannelCreate("x.VAL{\"dec\":{\"n\":-1}}")),
|
||||
"dbChannel with dec (n=-1) failed");
|
||||
testOk(!(pch = dbChannelCreate("x.VAL{\"dec\":{\"n\":0}}")),
|
||||
"dbChannel with dec (n=0) failed");
|
||||
/* Bad parms */
|
||||
testOk(!(pch = dbChannelCreate("x.VAL{\"dec\":{}}")),
|
||||
"dbChannel with dec (no parm) failed");
|
||||
testOk(!(pch = dbChannelCreate("x.VAL{\"dec\":{\"x\":true}}")),
|
||||
"dbChannel with dec (x=true) failed");
|
||||
|
||||
/* No Decimation (N=1) */
|
||||
|
||||
testHead("No Decimation (n=1)");
|
||||
testOk(!!(pch = dbChannelCreate("x.VAL{\"dec\":{\"n\":1}}")),
|
||||
"dbChannel with plugin dec (n=1) created");
|
||||
|
||||
/* Start the free-list */
|
||||
db_delete_field_log(db_create_read_log(pch));
|
||||
logsFree = db_available_logs();
|
||||
testDiag("%d field_logs on free-list", logsFree);
|
||||
|
||||
checkAndOpenChannel(pch, plug);
|
||||
|
||||
for (i = 0; i < 5; i++) {
|
||||
pfl[i] = db_create_read_log(pch);
|
||||
fl_setup(pch, pfl[i], 10 + i);
|
||||
}
|
||||
|
||||
testDiag("Test event stream");
|
||||
|
||||
mustPass(pch, pfl[0], "i=0");
|
||||
mustPass(pch, pfl[1], "i=1");
|
||||
mustPass(pch, pfl[2], "i=2");
|
||||
mustPass(pch, pfl[3], "i=3");
|
||||
mustPass(pch, pfl[4], "i=4");
|
||||
|
||||
dbChannelDelete(pch);
|
||||
|
||||
testDiag("%d field_logs on free-list", db_available_logs());
|
||||
|
||||
/* Decimation (N=2) */
|
||||
|
||||
testHead("Decimation (n=2)");
|
||||
testOk(!!(pch = dbChannelCreate("x.VAL{\"dec\":{\"n\":2}}")),
|
||||
"dbChannel with plugin dec (n=2) created");
|
||||
|
||||
checkAndOpenChannel(pch, plug);
|
||||
|
||||
for (i = 0; i < 10; i++) {
|
||||
pfl[i] = db_create_read_log(pch);
|
||||
fl_setup(pch, pfl[i], 20 + i);
|
||||
}
|
||||
|
||||
testDiag("Test event stream");
|
||||
|
||||
mustPass(pch, pfl[0], "i=0");
|
||||
mustDrop(pch, pfl[1], "i=1");
|
||||
mustPass(pch, pfl[2], "i=2");
|
||||
mustDrop(pch, pfl[3], "i=3");
|
||||
mustPass(pch, pfl[4], "i=4");
|
||||
mustDrop(pch, pfl[5], "i=5");
|
||||
mustPass(pch, pfl[6], "i=6");
|
||||
mustDrop(pch, pfl[7], "i=7");
|
||||
mustPass(pch, pfl[8], "i=8");
|
||||
mustDrop(pch, pfl[9], "i=9");
|
||||
|
||||
dbChannelDelete(pch);
|
||||
|
||||
testDiag("%d field_logs on free-list", db_available_logs());
|
||||
|
||||
/* Decimation (N=3) */
|
||||
|
||||
testHead("Decimation (n=3)");
|
||||
testOk(!!(pch = dbChannelCreate("x.VAL{\"dec\":{\"n\":3}}")),
|
||||
"dbChannel with plugin dec (n=3) created");
|
||||
|
||||
checkAndOpenChannel(pch, plug);
|
||||
|
||||
for (i = 0; i < 10; i++) {
|
||||
pfl[i] = db_create_read_log(pch);
|
||||
fl_setup(pch, pfl[i], 30 + i);
|
||||
}
|
||||
|
||||
testDiag("Test event stream");
|
||||
|
||||
mustPass(pch, pfl[0], "i=0");
|
||||
mustDrop(pch, pfl[1], "i=1");
|
||||
mustDrop(pch, pfl[2], "i=2");
|
||||
mustPass(pch, pfl[3], "i=3");
|
||||
mustDrop(pch, pfl[4], "i=4");
|
||||
mustDrop(pch, pfl[5], "i=5");
|
||||
mustPass(pch, pfl[6], "i=6");
|
||||
mustDrop(pch, pfl[7], "i=7");
|
||||
mustDrop(pch, pfl[8], "i=8");
|
||||
mustPass(pch, pfl[9], "i=9");
|
||||
|
||||
dbChannelDelete(pch);
|
||||
|
||||
testDiag("%d field_logs on free-list", db_available_logs());
|
||||
|
||||
/* Decimation (N=4) */
|
||||
|
||||
testHead("Decimation (n=4)");
|
||||
testOk(!!(pch = dbChannelCreate("x.VAL{\"dec\":{\"n\":4}}")),
|
||||
"dbChannel with plugin dec (n=4) created");
|
||||
|
||||
checkAndOpenChannel(pch, plug);
|
||||
|
||||
for (i = 0; i < 10; i++) {
|
||||
pfl[i] = db_create_read_log(pch);
|
||||
fl_setup(pch, pfl[i], 40 + i);
|
||||
}
|
||||
|
||||
testDiag("Test event stream");
|
||||
|
||||
mustPass(pch, pfl[0], "i=0");
|
||||
mustDrop(pch, pfl[1], "i=1");
|
||||
mustDrop(pch, pfl[2], "i=2");
|
||||
mustDrop(pch, pfl[3], "i=3");
|
||||
mustPass(pch, pfl[4], "i=4");
|
||||
mustDrop(pch, pfl[5], "i=5");
|
||||
mustDrop(pch, pfl[6], "i=6");
|
||||
mustDrop(pch, pfl[7], "i=7");
|
||||
mustPass(pch, pfl[8], "i=8");
|
||||
mustDrop(pch, pfl[9], "i=9");
|
||||
|
||||
dbChannelDelete(pch);
|
||||
|
||||
logsFinal = db_available_logs();
|
||||
testOk(logsFree == logsFinal, "%d field_logs on free-list", logsFinal);
|
||||
|
||||
db_close_events(evtctx);
|
||||
|
||||
testIocShutdownOk();
|
||||
|
||||
testdbCleanup();
|
||||
|
||||
return testDone();
|
||||
}
|
||||
@@ -17,6 +17,7 @@ int tsTest(void);
|
||||
int dbndTest(void);
|
||||
int syncTest(void);
|
||||
int arrTest(void);
|
||||
int decTest(void);
|
||||
|
||||
void epicsRunFilterTests(void)
|
||||
{
|
||||
@@ -26,6 +27,7 @@ void epicsRunFilterTests(void)
|
||||
runTest(dbndTest);
|
||||
runTest(syncTest);
|
||||
runTest(arrTest);
|
||||
runTest(decTest);
|
||||
|
||||
dbmfFreeChunks();
|
||||
|
||||
|
||||
@@ -42,12 +42,14 @@ static int fl_equal(const db_field_log *pfl1, const db_field_log *pfl2) {
|
||||
static void fl_setup(dbChannel *chan, db_field_log *pfl, long val) {
|
||||
struct dbCommon *prec = dbChannelRecord(chan);
|
||||
|
||||
memset(pfl, 0, sizeof(db_field_log));
|
||||
pfl->ctx = dbfl_context_event;
|
||||
pfl->type = dbfl_type_val;
|
||||
pfl->stat = prec->stat;
|
||||
pfl->sevr = prec->sevr;
|
||||
pfl->time = prec->time;
|
||||
pfl->field_type = DBF_LONG;
|
||||
pfl->field_size = sizeof(epicsInt32);
|
||||
pfl->no_elements = 1;
|
||||
/*
|
||||
* use memcpy to avoid a bus error on
|
||||
@@ -66,31 +68,92 @@ static void testHead (char* title) {
|
||||
testDiag("--------------------------------------------------------");
|
||||
}
|
||||
|
||||
static void mustDrop(dbChannel *pch, db_field_log *pfl2, char* m) {
|
||||
db_field_log *pfl = dbChannelRunPreChain(pch, pfl2);
|
||||
testOk(NULL == pfl, "filter drops field_log (%s)", m);
|
||||
/*
|
||||
* Use mustDrop() and mustPass() to test filters with no memory
|
||||
* of previous field_log pointers.
|
||||
*/
|
||||
static void mustDrop(dbChannel *pch, db_field_log *pfl, char* m) {
|
||||
int oldFree = db_available_logs();
|
||||
db_field_log *pfl2 = dbChannelRunPreChain(pch, pfl);
|
||||
int newFree = db_available_logs();
|
||||
|
||||
testOk(NULL == pfl2, "filter drops field_log (%s)", m);
|
||||
testOk(newFree == oldFree + 1, "a field_log was freed - %d+1 => %d",
|
||||
oldFree, newFree);
|
||||
|
||||
db_delete_field_log(pfl2);
|
||||
}
|
||||
|
||||
static void mustPassTwice(dbChannel *pch, db_field_log *pfl2, char* m) {
|
||||
db_field_log *pfl;
|
||||
static void mustPass(dbChannel *pch, db_field_log *pfl, char* m) {
|
||||
int oldFree = db_available_logs();
|
||||
db_field_log *pfl2 = dbChannelRunPreChain(pch, pfl);
|
||||
int newFree = db_available_logs();
|
||||
|
||||
testOk(pfl == pfl2, "filter passes field_log (%s)", m);
|
||||
testOk(newFree == oldFree, "no field_logs were freed - %d => %d",
|
||||
oldFree, newFree);
|
||||
|
||||
db_delete_field_log(pfl2);
|
||||
}
|
||||
|
||||
/*
|
||||
* Use mustStash() and mustSwap() to test filters that save
|
||||
* field_log pointers and return them later.
|
||||
*
|
||||
* mustStash() expects the filter to save the current pointer
|
||||
* (freeing any previously saved pointer) and return NULL.
|
||||
* mustSwap() expects the filter to return the previously
|
||||
* saved pointer and save the current pointer.
|
||||
*/
|
||||
static db_field_log *stashed;
|
||||
|
||||
static void streamReset(void) {
|
||||
stashed = NULL;
|
||||
}
|
||||
|
||||
static void mustStash(dbChannel *pch, db_field_log *pfl, char* m) {
|
||||
int oldFree = db_available_logs();
|
||||
db_field_log *pfl2 = dbChannelRunPreChain(pch, pfl);
|
||||
int newFree = db_available_logs();
|
||||
|
||||
testOk(NULL == pfl2, "filter stashes field_log (%s)", m);
|
||||
if (stashed) {
|
||||
testOk(newFree == oldFree + 1, "a field_log was freed - %d+1 => %d",
|
||||
oldFree, newFree);
|
||||
}
|
||||
else {
|
||||
testOk(newFree == oldFree, "no field_logs were freed - %d => %d",
|
||||
oldFree, newFree);
|
||||
}
|
||||
stashed = pfl;
|
||||
db_delete_field_log(pfl2);
|
||||
}
|
||||
|
||||
static void mustSwap(dbChannel *pch, db_field_log *pfl, char* m) {
|
||||
int oldFree = db_available_logs();
|
||||
db_field_log *pfl2 = dbChannelRunPreChain(pch, pfl);
|
||||
int newFree = db_available_logs();
|
||||
|
||||
testOk(stashed == pfl2, "filter returns stashed field log (%s)", m);
|
||||
testOk(newFree == oldFree, "no field_logs were freed - %d => %d",
|
||||
oldFree, newFree);
|
||||
|
||||
stashed = pfl;
|
||||
db_delete_field_log(pfl2);
|
||||
}
|
||||
|
||||
static void mustPassTwice(dbChannel *pch, db_field_log *pfl, char* m) {
|
||||
int oldFree = db_available_logs(), newFree;
|
||||
db_field_log *pfl2;
|
||||
|
||||
testDiag("%s: filter must pass twice", m);
|
||||
pfl = dbChannelRunPreChain(pch, pfl2);
|
||||
pfl2 = dbChannelRunPreChain(pch, pfl);
|
||||
testOk(pfl2 == pfl, "call 1 does not drop or replace field_log");
|
||||
pfl = dbChannelRunPreChain(pch, pfl2);
|
||||
pfl2 = dbChannelRunPreChain(pch, pfl);
|
||||
testOk(pfl2 == pfl, "call 2 does not drop or replace field_log");
|
||||
}
|
||||
|
||||
static void mustPassOld(dbChannel *pch, db_field_log *old, db_field_log *cur, char* m) {
|
||||
db_field_log *pfl = dbChannelRunPreChain(pch, cur);
|
||||
|
||||
testOk(old == pfl, "filter passes previous field log (%s)", m);
|
||||
}
|
||||
|
||||
static void mustPass(dbChannel *pch, db_field_log *cur, char* m) {
|
||||
db_field_log *pfl = dbChannelRunPreChain(pch, cur);
|
||||
|
||||
testOk(cur == pfl, "filter passes field_log (%s)", m);
|
||||
newFree = db_available_logs();
|
||||
testOk(newFree == oldFree, "no field_logs were freed - %d => %d",
|
||||
oldFree, newFree);
|
||||
}
|
||||
|
||||
static void checkCtxRead(dbChannel *pch, dbStateId id) {
|
||||
@@ -138,10 +201,10 @@ MAIN(syncTest)
|
||||
const chFilterPlugin *plug;
|
||||
char myname[] = "sync";
|
||||
db_field_log *pfl[10];
|
||||
int i;
|
||||
int i, logsFree, logsFinal;
|
||||
dbEventCtx evtctx;
|
||||
|
||||
testPlan(139);
|
||||
testPlan(214);
|
||||
|
||||
testdbPrepare();
|
||||
|
||||
@@ -176,9 +239,14 @@ MAIN(syncTest)
|
||||
testOk(!!(pch = dbChannelCreate("x.VAL{\"sync\":{\"m\":\"while\",\"s\":\"red\"}}")),
|
||||
"dbChannel with plugin sync (m='while' s='red') created");
|
||||
|
||||
/* Start the free-list */
|
||||
db_delete_field_log(db_create_read_log(pch));
|
||||
logsFree = db_available_logs();
|
||||
testDiag("%d field_logs on free-list", logsFree);
|
||||
|
||||
checkAndOpenChannel(pch, plug);
|
||||
|
||||
for (i = 0; i < 10; i++) {
|
||||
for (i = 0; i < 9; i++) {
|
||||
pfl[i] = db_create_read_log(pch);
|
||||
fl_setup(pch, pfl[i], 120 + i);
|
||||
}
|
||||
@@ -198,11 +266,10 @@ MAIN(syncTest)
|
||||
mustDrop(pch, pfl[7], "state=FALSE, log7");
|
||||
mustDrop(pch, pfl[8], "state=FALSE, log8");
|
||||
|
||||
for (i = 0; i < 10; i++)
|
||||
db_delete_field_log(pfl[i]);
|
||||
|
||||
dbChannelDelete(pch);
|
||||
|
||||
testDiag("%d field_logs on free-list", db_available_logs());
|
||||
|
||||
/* mode UNLESS */
|
||||
|
||||
testHead("Mode UNLESS (m='unless', s='red')");
|
||||
@@ -211,7 +278,7 @@ MAIN(syncTest)
|
||||
|
||||
checkAndOpenChannel(pch, plug);
|
||||
|
||||
for (i = 0; i < 10; i++) {
|
||||
for (i = 0; i < 9; i++) {
|
||||
pfl[i] = db_create_read_log(pch);
|
||||
fl_setup(pch, pfl[i], 120 + i);
|
||||
}
|
||||
@@ -231,11 +298,10 @@ MAIN(syncTest)
|
||||
mustPass(pch, pfl[7], "state=FALSE, log7");
|
||||
mustPass(pch, pfl[8], "state=FALSE, log8");
|
||||
|
||||
for (i = 0; i < 10; i++)
|
||||
db_delete_field_log(pfl[i]);
|
||||
|
||||
dbChannelDelete(pch);
|
||||
|
||||
testDiag("%d field_logs on free-list", db_available_logs());
|
||||
|
||||
/* mode BEFORE */
|
||||
|
||||
testHead("Mode BEFORE (m='before', s='red')");
|
||||
@@ -251,24 +317,25 @@ MAIN(syncTest)
|
||||
|
||||
testDiag("Test event stream");
|
||||
|
||||
streamReset();
|
||||
dbStateClear(red);
|
||||
mustDrop(pch, pfl[0], "state=FALSE, log0");
|
||||
mustDrop(pch, pfl[1], "state=FALSE, log1");
|
||||
mustDrop(pch, pfl[2], "state=FALSE, log2");
|
||||
mustStash(pch, pfl[0], "state=FALSE, log0");
|
||||
mustStash(pch, pfl[1], "state=FALSE, log1");
|
||||
mustStash(pch, pfl[2], "state=FALSE, log2");
|
||||
dbStateSet(red);
|
||||
mustPassOld(pch, pfl[2], pfl[3], "state=TRUE, log3, pass=log2");
|
||||
mustDrop(pch, pfl[4], "state=TRUE, log4");
|
||||
mustDrop(pch, pfl[5], "state=TRUE, log5");
|
||||
mustDrop(pch, pfl[6], "state=TRUE, log6");
|
||||
mustSwap(pch, pfl[3], "state=TRUE, log3");
|
||||
mustStash(pch, pfl[4], "state=TRUE, log4");
|
||||
mustStash(pch, pfl[5], "state=TRUE, log5");
|
||||
mustStash(pch, pfl[6], "state=TRUE, log6");
|
||||
dbStateClear(red);
|
||||
mustDrop(pch, pfl[7], "state=FALSE, log7");
|
||||
mustDrop(pch, pfl[8], "state=FALSE, log8");
|
||||
mustDrop(pch, pfl[9], "state=FALSE, log9");
|
||||
|
||||
db_delete_field_log(pfl[2]);
|
||||
mustStash(pch, pfl[7], "state=FALSE, log7");
|
||||
mustStash(pch, pfl[8], "state=FALSE, log8");
|
||||
mustStash(pch, pfl[9], "state=FALSE, log9");
|
||||
|
||||
dbChannelDelete(pch);
|
||||
|
||||
testDiag("%d field_logs on free-list", db_available_logs());
|
||||
|
||||
/* mode FIRST */
|
||||
|
||||
testHead("Mode FIRST (m='first', s='red')");
|
||||
@@ -277,13 +344,14 @@ MAIN(syncTest)
|
||||
|
||||
checkAndOpenChannel(pch, plug);
|
||||
|
||||
for (i = 0; i < 10; i++) {
|
||||
for (i = 0; i < 9; i++) {
|
||||
pfl[i] = db_create_read_log(pch);
|
||||
fl_setup(pch, pfl[i], 120 + i);
|
||||
}
|
||||
|
||||
testDiag("Test event stream");
|
||||
|
||||
streamReset();
|
||||
dbStateClear(red);
|
||||
mustDrop(pch, pfl[0], "state=FALSE, log0");
|
||||
mustDrop(pch, pfl[1], "state=FALSE, log1");
|
||||
@@ -297,11 +365,10 @@ MAIN(syncTest)
|
||||
mustDrop(pch, pfl[7], "state=FALSE, log7");
|
||||
mustDrop(pch, pfl[8], "state=FALSE, log8");
|
||||
|
||||
db_delete_field_log(pfl[3]);
|
||||
db_delete_field_log(pfl[9]);
|
||||
|
||||
dbChannelDelete(pch);
|
||||
|
||||
testDiag("%d field_logs on free-list", db_available_logs());
|
||||
|
||||
/* mode LAST */
|
||||
|
||||
testHead("Mode LAST (m='last', s='red')");
|
||||
@@ -317,24 +384,25 @@ MAIN(syncTest)
|
||||
|
||||
testDiag("Test event stream");
|
||||
|
||||
streamReset();
|
||||
dbStateClear(red);
|
||||
mustDrop(pch, pfl[0], "state=FALSE, log0");
|
||||
mustDrop(pch, pfl[1], "state=FALSE, log1");
|
||||
mustDrop(pch, pfl[2], "state=FALSE, log2");
|
||||
mustStash(pch, pfl[0], "state=FALSE, log0");
|
||||
mustStash(pch, pfl[1], "state=FALSE, log1");
|
||||
mustStash(pch, pfl[2], "state=FALSE, log2");
|
||||
dbStateSet(red);
|
||||
mustDrop(pch, pfl[3], "state=TRUE, log3");
|
||||
mustDrop(pch, pfl[4], "state=TRUE, log4");
|
||||
mustDrop(pch, pfl[5], "state=TRUE, log5");
|
||||
mustStash(pch, pfl[3], "state=TRUE, log3");
|
||||
mustStash(pch, pfl[4], "state=TRUE, log4");
|
||||
mustStash(pch, pfl[5], "state=TRUE, log5");
|
||||
dbStateClear(red);
|
||||
mustPassOld(pch, pfl[5], pfl[6], "state=TRUE, log6, pass=log5");
|
||||
mustDrop(pch, pfl[7], "state=FALSE, log7");
|
||||
mustDrop(pch, pfl[8], "state=FALSE, log8");
|
||||
mustDrop(pch, pfl[9], "state=FALSE, log9");
|
||||
|
||||
db_delete_field_log(pfl[5]);
|
||||
mustSwap(pch, pfl[6], "state=TRUE, log6");
|
||||
mustStash(pch, pfl[7], "state=FALSE, log7");
|
||||
mustStash(pch, pfl[8], "state=FALSE, log8");
|
||||
mustStash(pch, pfl[9], "state=FALSE, log9");
|
||||
|
||||
dbChannelDelete(pch);
|
||||
|
||||
testDiag("%d field_logs on free-list", db_available_logs());
|
||||
|
||||
/* mode AFTER */
|
||||
|
||||
testHead("Mode AFTER (m='after', s='red')");
|
||||
@@ -343,13 +411,14 @@ MAIN(syncTest)
|
||||
|
||||
checkAndOpenChannel(pch, plug);
|
||||
|
||||
for (i = 0; i < 10; i++) {
|
||||
for (i = 0; i < 9; i++) {
|
||||
pfl[i] = db_create_read_log(pch);
|
||||
fl_setup(pch, pfl[i], 120 + i);
|
||||
}
|
||||
|
||||
testDiag("Test event stream");
|
||||
|
||||
streamReset();
|
||||
dbStateClear(red);
|
||||
mustDrop(pch, pfl[0], "state=FALSE, log0");
|
||||
mustDrop(pch, pfl[1], "state=FALSE, log1");
|
||||
@@ -363,11 +432,11 @@ MAIN(syncTest)
|
||||
mustDrop(pch, pfl[7], "state=FALSE, log7");
|
||||
mustDrop(pch, pfl[8], "state=FALSE, log8");
|
||||
|
||||
db_delete_field_log(pfl[6]);
|
||||
db_delete_field_log(pfl[9]);
|
||||
|
||||
dbChannelDelete(pch);
|
||||
|
||||
logsFinal = db_available_logs();
|
||||
testOk(logsFree == logsFinal, "%d field_logs on free-list", logsFinal);
|
||||
|
||||
db_close_events(evtctx);
|
||||
|
||||
testIocShutdownOk();
|
||||
|
||||
@@ -53,3 +53,7 @@ stdRecords_DBD = $(patsubst %,%.dbd,$(stdRecords))
|
||||
dbRecStd_SRCS += $(patsubst %,%.c,$(stdRecords))
|
||||
|
||||
HTMLS += $(patsubst %.dbd.pod,%.html,$(notdir $(wildcard ../rec/*Record.dbd.pod)))
|
||||
|
||||
vpath %.png $(SRC_DIRS)
|
||||
HTMLS += image/compress-1.png
|
||||
HTMLS += image/compress-2.png
|
||||
|
||||
@@ -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.
|
||||
#*************************************************************************
|
||||
|
||||
=title Analog Input Record (ai)
|
||||
@@ -214,7 +214,7 @@ monitoring functionality.
|
||||
|
||||
=cut
|
||||
|
||||
include "dbCommon.dbd"
|
||||
include "dbCommon.dbd"
|
||||
field(VAL,DBF_DOUBLE) {
|
||||
prompt("Current EGU Value")
|
||||
promptgroup("40 - Input")
|
||||
@@ -520,7 +520,7 @@ The individual routines are described below.
|
||||
|
||||
=head3 Device Support Routines
|
||||
|
||||
=head4 long report(int level)
|
||||
long report(int level)
|
||||
|
||||
This optional routine is called by the IOC command C<dbior> and is passed the
|
||||
report level that was requested by the user.
|
||||
@@ -530,7 +530,7 @@ 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)
|
||||
long init(int after)
|
||||
|
||||
This optional routine is called twice at IOC initialization time.
|
||||
The first call happens before any of the C<init_record()> calls are made, with
|
||||
@@ -538,7 +538,7 @@ the integer parameter C<after> set to 0.
|
||||
The second call happens after all of the C<init_record()> calls have been made,
|
||||
with C<after> set to 1.
|
||||
|
||||
=head4 long init_record(aiRecord *prec)
|
||||
long init_record(aiRecord *prec)
|
||||
|
||||
This optional routine is called by the record initialization code for each ai
|
||||
record instance that has its DTYP field set to use this device support.
|
||||
@@ -555,7 +555,7 @@ C<LINEAR>, but it is not necessary to check that condition first.
|
||||
This same calculation takes place in the C<special_linconv()> routine, so the
|
||||
implementation can usually just call that routine to perform the task.
|
||||
|
||||
=head4 long get_ioint_info(int cmd, aiRecord *prec, IOSCANPVT *piosl)
|
||||
long get_ioint_info(int cmd, aiRecord *prec, IOSCANPVT *piosl)
|
||||
|
||||
This optional routine is called whenever the record's SCAN field is being
|
||||
changed to or from the value C<I/O Intr> to find out which I/O Interrupt Scan
|
||||
@@ -584,7 +584,7 @@ thread.
|
||||
The C<scanIoRequest()> routine is safe to call from an interrupt service routine
|
||||
on embedded architectures (vxWorks and RTEMS).
|
||||
|
||||
=head4 long read_ai(aiRecord *prec)
|
||||
long read_ai(aiRecord *prec)
|
||||
|
||||
This essential routine is called when the record wants a new value from the
|
||||
addressed device.
|
||||
@@ -595,7 +595,7 @@ It is responsible for performing (or at least initiating) a read operation, and
|
||||
|
||||
... return value ...
|
||||
|
||||
=head4 long special_linconv(aiRecord *prec, int after)
|
||||
long special_linconv(aiRecord *prec, int after)
|
||||
|
||||
This optional routine should be provided if the record type's unit conversion
|
||||
features are used by the device support's C<read_ai()> routine returning a
|
||||
|
||||
@@ -70,7 +70,7 @@ output value PVAL is added to it.
|
||||
=head4 Drive Limits
|
||||
|
||||
The output value is now clipped to the range DRVL to DRVH inclusive, provided
|
||||
that DRVH > DRVL.
|
||||
that DRVH E<gt> DRVL.
|
||||
The result is copied into both the VAL and PVAL fields.
|
||||
|
||||
=head4 Limit Rate of Change
|
||||
@@ -164,9 +164,7 @@ OUT field must specify the address of the I/O card. In addition, the
|
||||
DTYP field must contain the name of the device support module. Be aware
|
||||
that the address format differs according to the I/O bus used. See
|
||||
Address Specification for information on the format of hardware
|
||||
addresses. The user can see a list of the device support modules
|
||||
currently supported at the user's local site by using the dbst utility
|
||||
in R3.13.
|
||||
addresses.
|
||||
|
||||
For soft records the output link can be a database link, a channel
|
||||
access link, or a constant value. If the link is a constant, no output
|
||||
@@ -593,7 +591,7 @@ terminated.
|
||||
For compatibility with old device supports that don't know EOFF, if
|
||||
both EOFF and ESLO have their default value, EOFF is set to EGUL.
|
||||
|
||||
If device support includes init_record, it is called.
|
||||
If device support includes C<init_record()>, it is called.
|
||||
|
||||
INIT is set TRUE. This causes PBRK, LBRK, and smoothing to be
|
||||
re-initialized. If "backwards" linear conversion is requested, then VAL
|
||||
@@ -620,10 +618,6 @@ called.
|
||||
INIT is set TRUE. This causes PBRK, LBRK, and smoothing to be
|
||||
re-initialized.
|
||||
|
||||
=item get_value
|
||||
|
||||
Fills in the values of struct valueDes so that they refer to VAL.
|
||||
|
||||
=item get_alarm_double
|
||||
|
||||
Sets the following values:
|
||||
@@ -903,7 +897,7 @@ OUT link type must be either a CONSTANT, DB_LINK, or CA_LINK.
|
||||
This module writes the current value of OVAL.
|
||||
|
||||
If the OUT link type is PV_LINK, then dbCaAddInlink is called by
|
||||
init_record. init_record always returns a value of 2, which means that
|
||||
C<init_record()>. C<init_record()> always returns a value of 2, which means that
|
||||
no conversion will ever be attempted.
|
||||
|
||||
write_ao calls recGblPutLinkValue to write the current value of VAL.
|
||||
|
||||
@@ -69,9 +69,7 @@ If the binary input record gets its value from hardware, the address of the
|
||||
card must be entered in the INP field, and the name of the device support
|
||||
module must be entered in the DTYP field. See L<Address Specification> for
|
||||
information on the format of the hardware address. Be aware that the format
|
||||
differs between types of cards. You can see a list of device support
|
||||
modules currently supported at the user's local site by using C<dbst>
|
||||
utility (R3.13).
|
||||
differs between types of cards.
|
||||
|
||||
For records that specify C<Soft Channel> or C<Raw Soft Channel> device
|
||||
support routines, the INP field can be a channel or a database link, or a
|
||||
@@ -94,18 +92,18 @@ the device support module reads a value directly into VAL or the
|
||||
C<Soft Channel> device support is used. The value can also be fetched as one of
|
||||
the strings specified in the ZNAM or ONAM fields. The ZNAM field has a
|
||||
string that corresponds to the 0 state, so when the value is fetched as
|
||||
this string, C<put_enum_str> will return a 0. The ONAM field hold the
|
||||
this string, C<put_enum_str()> will return a 0. The ONAM field hold the
|
||||
string that corresponds to the 1 state, so when the value is fetched as
|
||||
this string, C<put_enum_str> returns a 1.
|
||||
this string, C<put_enum_str()> returns a 1.
|
||||
|
||||
=fields ZNAM, ONAM
|
||||
|
||||
=head3 Operator Display Parameters
|
||||
|
||||
These parameters are used to present meaningful data to the operator. The
|
||||
C<get_enum_str> record support routine can retrieve the state string
|
||||
corresponding to the VAL's state. If the value is 1, C<get_enum_str> will
|
||||
return the string in the ONAM field; and if 0, C<get_enum_str> will return
|
||||
C<get_enum_str()> record support routine can retrieve the state string
|
||||
corresponding to the VAL's state. If the value is 1, C<get_enum_str()> will
|
||||
return the string in the ONAM field; and if 0, C<get_enum_str()> will return
|
||||
the ZNAM string.
|
||||
|
||||
See L<Fields Common to All Record Types> for more on the record name (NAME)
|
||||
@@ -149,7 +147,7 @@ The LALM fields holds the value of the last occurence of the change of
|
||||
state alarm. It is used to implement the change of state alarm, and thus
|
||||
only has meaning if COSV is MAJOR or MINOR.
|
||||
|
||||
The MSLT field is used by the C<process> record support routine to
|
||||
The MSLT field is used by the C<process()> record support routine to
|
||||
determine if archive and value change monitors are invoked. They are if MSLT
|
||||
is not equal to VAL.
|
||||
|
||||
@@ -164,7 +162,7 @@ these fields.
|
||||
|
||||
=cut
|
||||
|
||||
include "dbCommon.dbd"
|
||||
include "dbCommon.dbd"
|
||||
field(INP,DBF_INLINK) {
|
||||
prompt("Input Specification")
|
||||
promptgroup("40 - Input")
|
||||
@@ -266,7 +264,7 @@ these fields.
|
||||
|
||||
=head3 Record Support Routines
|
||||
|
||||
=head2 C<init_record>
|
||||
long init_record(struct dbCommon *precord, int pass);
|
||||
|
||||
This routine initializes SIMM with the value of SIML if SIML type is a
|
||||
CONSTANT link or creates a channel access link if SIML type is PV_LINK.
|
||||
@@ -276,25 +274,21 @@ This routine next checks to see that device support is available and a
|
||||
device support routine is defined. If neither exist, an error is issued and
|
||||
processing is terminated.
|
||||
|
||||
If device support includes C<init_record>, it is called.
|
||||
If device support includes C<init_record()>, it is called.
|
||||
|
||||
=head2 C<process>
|
||||
long process(struct dbCommon *precord);
|
||||
|
||||
See next section.
|
||||
See L<Record Processing> below.
|
||||
|
||||
=head2 C<get_value>
|
||||
|
||||
Fills in the values of struct valueDes so that they refer to VAL.
|
||||
|
||||
=head2 C<get_enum_str>
|
||||
long get_enum_str(const struct dbAddr *paddr, char *pbuffer);
|
||||
|
||||
Retrieves ASCII string corresponding to VAL.
|
||||
|
||||
=head2 C<get_enum_strs>
|
||||
long get_enum_strs(const struct dbAddr *paddr, struct dbr_enumStrs *p);
|
||||
|
||||
Retrieves ASCII strings for ZNAM and ONAM.
|
||||
|
||||
=head2 C<put_enum_str>
|
||||
long put_enum_str(const struct dbAddr *paddr, const char *pbuffer);
|
||||
|
||||
Check if string matches ZNAM or ONAM, and if it does, sets VAL.
|
||||
|
||||
@@ -302,7 +296,7 @@ Check if string matches ZNAM or ONAM, and if it does, sets VAL.
|
||||
|
||||
Routine process implements the following algorithm:
|
||||
|
||||
=over 1
|
||||
=over
|
||||
|
||||
=item 1.
|
||||
Check to see that the appropriate device support module exists. If it
|
||||
@@ -311,7 +305,7 @@ 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.
|
||||
C<readValue> is called. See L<Input Records> for details.
|
||||
C<readValue()> is called. See L<Input Records> for details.
|
||||
|
||||
=item 3.
|
||||
If PACT has been changed to TRUE, the device support read routine has
|
||||
@@ -323,7 +317,7 @@ Convert.
|
||||
|
||||
=back
|
||||
|
||||
=over 1
|
||||
=over
|
||||
|
||||
=item *
|
||||
status = read_bi
|
||||
@@ -332,7 +326,7 @@ status = read_bi
|
||||
PACT = TRUE
|
||||
|
||||
=item *
|
||||
TIME = tslocaltime
|
||||
C<recGblGetTimeStamp()> is called.
|
||||
|
||||
=item *
|
||||
if status is 0, then set VAL=(0,1) if RVAL is (0, not 0) and UDF = False.
|
||||
@@ -342,7 +336,7 @@ if status is 2, set status = 0
|
||||
|
||||
=back
|
||||
|
||||
=over 1
|
||||
=over
|
||||
|
||||
=item 5.
|
||||
Check alarms: This routine checks to see if the new VAL causes the alarm
|
||||
@@ -354,7 +348,7 @@ Check if monitors should be invoked:
|
||||
|
||||
=back
|
||||
|
||||
=over 1
|
||||
=over
|
||||
|
||||
=item *
|
||||
Alarm monitors are invoked if the alarm status or severity has changed.
|
||||
@@ -370,7 +364,7 @@ NSEV and NSTA are reset to 0.
|
||||
|
||||
=back
|
||||
|
||||
=over 1
|
||||
=over
|
||||
|
||||
=item 7.
|
||||
Scan forward link if necessary, set PACT FALSE, and return.
|
||||
@@ -383,7 +377,7 @@ Scan forward link if necessary, set PACT FALSE, and return.
|
||||
|
||||
Each binary input record must have an associated set of device support
|
||||
routines. The primary resposibility of the device support routines is to
|
||||
obtain a new raw input value whenever C<read_bi> is called. The device
|
||||
obtain a new raw input value whenever C<read_bi()> is called. The device
|
||||
support routines are primarily interested in the following fields:
|
||||
|
||||
=fields PACT, DPVT, UDF, NSEV, NSTA, VAL, INP, RVAL, MASK
|
||||
@@ -392,27 +386,37 @@ support routines are primarily interested in the following fields:
|
||||
|
||||
Device support consists of the following routines:
|
||||
|
||||
=head2 C<report(FILE fp, paddr)>
|
||||
long report(int level);
|
||||
|
||||
Not currently used.
|
||||
This optional routine is called by the IOC command C<dbior> 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<level> 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.
|
||||
|
||||
=head2 C<init()>
|
||||
long init(int after);
|
||||
|
||||
This routine is called once during IOC initialization.
|
||||
This optional routine is called twice at IOC initialization time.
|
||||
The first call happens before any of the C<init_record()> calls are made, with
|
||||
the integer parameter C<after> set to 0.
|
||||
The second call happens after all of the C<init_record()> calls have been made,
|
||||
with C<after> set to 1.
|
||||
|
||||
=head2 C<init_record(precord)>
|
||||
long init_record(struct dbCommon *precord);
|
||||
|
||||
This routine is optional. If provided, it is called by the record support
|
||||
C<init_record> routine.
|
||||
C<init_record()> routine.
|
||||
|
||||
=head2 C<get_ioint_info(int cmd, struct dbCommon *precord, IOSCANPVT *ppvt)>
|
||||
long get_ioint_info(int cmd, struct dbCommon *precord, IOSCANPVT *ppvt);
|
||||
|
||||
This routine is called by the C<ioEventScan> system each time the record is
|
||||
This routine is called by the ioEventScan system each time the record is
|
||||
added or deleted from an I/O event scan list. C<cmd> has the value (0,1) if
|
||||
the record is being (added to, deleted from) and I/O event list. It must be
|
||||
provided for any device type that can use the ioEvent scanner.
|
||||
|
||||
=head2 C<read_bi(precord)>
|
||||
long read_bi(struct dbCommon *precord);
|
||||
|
||||
This routine must provide a new input value. It returns the following
|
||||
values:
|
||||
@@ -439,25 +443,25 @@ link type must be either CONSTANT, DB_LINK, or CA_LINK.
|
||||
|
||||
=head3 Soft Channel
|
||||
|
||||
C<read_bi> always returns a value of 2, which means that no conversion is
|
||||
C<read_bi()> always returns a value of 2, which means that no conversion is
|
||||
performed.
|
||||
|
||||
If the INP link type is CONSTANT, then the constant value is stored in VAL
|
||||
by C<init_record>, and the UDF is set to FALSE. VAL can be changed via
|
||||
C<dbPut> requests. If the INP link type is PV_LINK, the C<dbCaAddInlink> is
|
||||
called by C<init_record>.
|
||||
by C<init_record()>, and the UDF is set to FALSE. VAL can be changed via
|
||||
C<dbPut()> requests. If the INP link type is PV_LINK, the C<dbCaAddInlink()> is
|
||||
called by C<init_record()>.
|
||||
|
||||
C<read_bi> calls C<recGbleGetLinkValue> to read the current value of VAL.
|
||||
C<read_bi()> calls C<dbGetLinkValue> to read the current value of VAL.
|
||||
See L<Soft Input> for details.
|
||||
|
||||
If the return status of C<recGblGetLinkValue> is zero, then C<read_bi> sets
|
||||
UDF to FALSE. The status of C<recGblGetLinkValue> is returned.
|
||||
If the return status of C<dbGetLinkValue()> is zero, then C<read_bi()> sets
|
||||
UDF to FALSE. The status of C<dbGetLinkValue()> is returned.
|
||||
|
||||
=head3 Raw Soft Channel
|
||||
|
||||
This module is like the previous except that values are read into RVAL.
|
||||
|
||||
C<read_bi> returns a value of 0. Thus the record processing routine will
|
||||
C<read_bi()> returns a value of 0. Thus the record processing routine will
|
||||
force VAL to be 0 or 1.
|
||||
|
||||
=cut
|
||||
|
||||
@@ -98,7 +98,7 @@ struct bodset { /* binary output dset */
|
||||
|
||||
/* control block for callback*/
|
||||
typedef struct myCallback {
|
||||
CALLBACK callback;
|
||||
epicsCallback callback;
|
||||
struct dbCommon *precord;
|
||||
}myCallback;
|
||||
|
||||
@@ -106,7 +106,7 @@ static void checkAlarms(boRecord *);
|
||||
static void monitor(boRecord *);
|
||||
static long writeValue(boRecord *);
|
||||
|
||||
static void myCallbackFunc(CALLBACK *arg)
|
||||
static void myCallbackFunc(epicsCallback *arg)
|
||||
{
|
||||
myCallback *pcallback;
|
||||
boRecord *prec;
|
||||
|
||||
@@ -65,9 +65,9 @@ C<losed_loop> or C<supervisory>. If C<supervisory> is specified, the value
|
||||
in the VAL field can be set externally via dbPuts at run-time. If
|
||||
C<closed_loop> is specified, the VAL field's value is obtained from the
|
||||
address specified in the desired output location (DOL) field which can be a
|
||||
database link, a channel access link, or a constant. To achieve continuous
|
||||
control, a database link to a control algorithm record should be entered in
|
||||
the DOL field.
|
||||
database link or a channel access link, but not a constant. To achieve
|
||||
continuous control, a database link to a control algorithm record should be
|
||||
entered in the DOL field.
|
||||
|
||||
L<Address Specification> presents more information on database addresses
|
||||
and links. L<Scanning Specification> explaines the effect of database
|
||||
@@ -130,8 +130,7 @@ It must specify the address of an I/O card if the record sends its output
|
||||
to hardware, and the DTYP field must contain the corresponding device
|
||||
support module. Be aware that the address format differs according to the
|
||||
I/O bus used. See L<Address Specification> for information on the format of
|
||||
hardware addresses. You can see a list of device support modules currently
|
||||
supported at the user's local site by using the C<dbst> utility in R3.13.
|
||||
hardware addresses.
|
||||
|
||||
Otherwise, if the record is configured to use the soft device support
|
||||
modules, then it can be either a database link, a channel access link, or a
|
||||
@@ -143,9 +142,9 @@ this chapter for more on output to other records.
|
||||
=head3 Operator Display Parameters
|
||||
|
||||
These parameters are used to present meaningful data to the operator, The
|
||||
C<get_enum_str> record support routine can retrieve the state string
|
||||
corresponding to the VAL's state. So, if the value is 1, C<get_enum_str>
|
||||
will return the string in the ONAM field: and if 0, C<get_enum_str> will
|
||||
C<get_enum_str()> record support routine can retrieve the state string
|
||||
corresponding to the VAL's state. So, if the value is 1, C<get_enum_str()>
|
||||
will return the string in the ONAM field: and if 0, C<get_enum_str()> will
|
||||
return the ZNAM string.
|
||||
|
||||
See L<Fields Common to All Record Types> for more on the record name (NAME)
|
||||
@@ -194,7 +193,7 @@ The LALM field holds the value of the last occurrence of the change of
|
||||
state alarm. It is used to implement the change of state alarm, and thus
|
||||
only has meaning if COSV is MINOR or MAJOR.
|
||||
|
||||
The MLST is used by the C<process> record support routine to determine if
|
||||
The MLST is used by the C<process()> record support routine to determine if
|
||||
archive and value change monitors are invoked. They are if MLST is not
|
||||
equal to VAL.
|
||||
|
||||
@@ -373,17 +372,13 @@ exist, and error message is issued and processing is terminated.
|
||||
If DOL is a constant, then VAL is initialized to 1 if its value is nonzero
|
||||
or initialzed to 0 if DOL is zero, and UDF is set to FALSE.
|
||||
|
||||
If device support includes C<init_record>, it is called. VAL is set using
|
||||
If device support includes C<init_record()>, it is called. VAL is set using
|
||||
RVAL, and UDF is set to FALSE.
|
||||
|
||||
=head2 C<process>
|
||||
|
||||
See next section.
|
||||
|
||||
=head2 C<get_value>
|
||||
|
||||
Fills in the values of struct valueDes so that they refer to VAL.
|
||||
|
||||
=head2 C<get_enum_str>
|
||||
|
||||
Retrieves ASCII string corresponding to VAL.
|
||||
@@ -416,7 +411,7 @@ If PACT is FALSE
|
||||
=over
|
||||
|
||||
=item *
|
||||
If DOL is DB_LINK and OMSL is CLOSED_LOOP
|
||||
If DOL holds a link and OMSL is C<closed_loop>
|
||||
|
||||
=over
|
||||
|
||||
@@ -500,27 +495,37 @@ Scan forward link if necessary, set PACT FALSE, and return
|
||||
|
||||
Each binary 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 C<write_bo> is called. The device support routines
|
||||
write a new value whenever C<write_bo()> is called. The device support routines
|
||||
are primarily interested in the following fields:
|
||||
|
||||
=fields PACT, DPVT, NSEV, NSTA, VAL, OUT, RVAL, MASK, RBV
|
||||
|
||||
=head3 Decive Support Routines
|
||||
=head3 Device Support Routines
|
||||
|
||||
Device support consists of the following routines:
|
||||
|
||||
=head2 C<report(FILE fp, paddr)>
|
||||
=head4 long report(int level)
|
||||
|
||||
Not currently used.
|
||||
This optional routine is called by the IOC command C<dbior> 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<level> 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.
|
||||
|
||||
=head2 C<init()>
|
||||
=head4 long init(int after)
|
||||
|
||||
This routine is called once during IOC initialization.
|
||||
This optional routine is called twice at IOC initialization time.
|
||||
The first call happens before any of the C<init_record()> calls are made, with
|
||||
the integer parameter C<after> set to 0.
|
||||
The second call happens after all of the C<init_record()> calls have been made,
|
||||
with C<after> set to 1.
|
||||
|
||||
=head2 C<init_record(precord)>
|
||||
|
||||
This routine is optional. If provided, it is called by record support
|
||||
C<init_record> routine. It should determine MASK if it is needed.
|
||||
C<init_record()> routine. It should determine MASK if it is needed.
|
||||
|
||||
=over
|
||||
|
||||
@@ -566,10 +571,10 @@ link type must be either CONSTANT, DB_LINK, or CA_LINK.
|
||||
|
||||
This module writes the current value of VAL.
|
||||
|
||||
If the OUT link type is PV_LINK, then C<dbCaAddInlink> is called by
|
||||
C<init_record>. C<init_record> always returns a value of 2, which means
|
||||
that no conversion will ever be attempted. C<write_bo> calls
|
||||
C<recGblPutLinkValue> to write the current value of VAL. See L<Soft Output>
|
||||
If the OUT link type is PV_LINK, then C<dbCaAddInlink()> is called by
|
||||
C<init_record()>. C<init_record()> always returns a value of 2, which means
|
||||
that no conversion will ever be attempted. C<write_bo()> calls
|
||||
C<recGblPutLinkValue()> to write the current value of VAL. See L<Soft Output>
|
||||
for details.
|
||||
|
||||
=head3 Raw Soft Channel
|
||||
|
||||
@@ -261,22 +261,22 @@ ATAN: Arc tangent
|
||||
=over 1
|
||||
|
||||
=item *
|
||||
>= : Greater than or equal to
|
||||
C<<< >= >>> : Greater than or equal to
|
||||
|
||||
=item *
|
||||
> : Greater than
|
||||
C<<< > >>> : Greater than
|
||||
|
||||
=item *
|
||||
<= : Less than or equal to
|
||||
C<<< <= >>> : Less than or equal to
|
||||
|
||||
=item *
|
||||
< : Less than
|
||||
C<<< < >>> : Less than
|
||||
|
||||
=item *
|
||||
# : Not equal to
|
||||
C<<< # >>> : Not equal to
|
||||
|
||||
=item *
|
||||
= : Equal to
|
||||
C<<< = >>> : Equal to
|
||||
|
||||
=back
|
||||
|
||||
@@ -285,13 +285,13 @@ ATAN: Arc tangent
|
||||
=over 1
|
||||
|
||||
=item *
|
||||
&& : And
|
||||
C<&&> : And
|
||||
|
||||
=item *
|
||||
|| : Or
|
||||
C<||> : Or
|
||||
|
||||
=item *
|
||||
! : Not
|
||||
C<!> : Not
|
||||
|
||||
=back
|
||||
|
||||
@@ -300,10 +300,10 @@ ATAN: Arc tangent
|
||||
=over 1
|
||||
|
||||
=item *
|
||||
| : Bitwise Or
|
||||
C<|> : Bitwise Or
|
||||
|
||||
=item *
|
||||
& : Bitwise And
|
||||
C<&> : Bitwise And
|
||||
|
||||
=item *
|
||||
OR : Bitwise Or
|
||||
@@ -315,13 +315,13 @@ AND : Bitwise And
|
||||
XOR : Bitwise Exclusive Or
|
||||
|
||||
=item *
|
||||
~ : One's Complement
|
||||
C<~> : One's Complement
|
||||
|
||||
=item *
|
||||
<< : Left shift
|
||||
C<<< << >>> : Left shift
|
||||
|
||||
=item *
|
||||
>> : Right shift
|
||||
C<<< >> >>> : Right shift
|
||||
|
||||
=back
|
||||
|
||||
@@ -330,7 +330,7 @@ XOR : Bitwise Exclusive Or
|
||||
=over 1
|
||||
|
||||
=item *
|
||||
:= : assigns a value (right hand side) to a variable (i.e. field)
|
||||
C<:=> : assigns a value (right hand side) to a variable (i.e. field)
|
||||
|
||||
=back
|
||||
|
||||
@@ -360,35 +360,35 @@ C<A + B + 10>
|
||||
=over 1
|
||||
|
||||
=item *
|
||||
Result is A + B + 10
|
||||
Result is C<A + B + 10>
|
||||
|
||||
=back
|
||||
|
||||
=head3 Relational
|
||||
|
||||
C<(A + B) < (C + D)>
|
||||
C<<< (A + B) < (C + D) >>>
|
||||
|
||||
=over 1
|
||||
|
||||
=item *
|
||||
Result is 1 if (A + B) < (C + D)
|
||||
Result is 1 if C<<< (A + B) < (C + D) >>>
|
||||
|
||||
=item *
|
||||
Result is 0 if (A + B) >= (C + D)
|
||||
Result is 0 if C<<< (A + B) >= (C + D) >>>
|
||||
|
||||
=back
|
||||
|
||||
=head3 Question Mark
|
||||
|
||||
C<(A + B) < (C + D) ? E : F + L + 10>
|
||||
C<<< (A + B) < (C + D) ? E : F + L + 10 >>>
|
||||
|
||||
=over 1
|
||||
|
||||
=item *
|
||||
Result is E if (A + B) < (C + D)
|
||||
Result is C<E> if C<<< (A + B) < (C + D) >>>
|
||||
|
||||
=item *
|
||||
Result is F + L + 10 if (A + B) >= (C + D)
|
||||
Result is C<F + L + 10> if C<<< (A + B) >= (C + D) >>>
|
||||
|
||||
=back
|
||||
|
||||
@@ -412,7 +412,7 @@ C<(A + B) < (C + D) ? E : VAL>
|
||||
|
||||
=head3 Logical
|
||||
|
||||
C<A&B>
|
||||
C<A & B>
|
||||
|
||||
=over 1
|
||||
|
||||
@@ -851,10 +851,6 @@ See next section.
|
||||
|
||||
This is called if CALC is changed. C<special> calls postfix.
|
||||
|
||||
=head2 C<get_value>
|
||||
|
||||
Fills in the values of struct valueDes so that the refer to VAL.
|
||||
|
||||
=head2 C<get_units>
|
||||
|
||||
Retrieves EGU.
|
||||
|
||||
@@ -116,8 +116,8 @@ typedef struct calcoutDSET {
|
||||
#define CA_LINKS_NOT_OK 2
|
||||
|
||||
typedef struct rpvtStruct {
|
||||
CALLBACK doOutCb;
|
||||
CALLBACK checkLinkCb;
|
||||
epicsCallback doOutCb;
|
||||
epicsCallback checkLinkCb;
|
||||
short cbScheduled;
|
||||
short caLinkStat; /* NO_CA_LINKS, CA_LINKS_ALL_OK, CA_LINKS_NOT_OK */
|
||||
} rpvtStruct;
|
||||
@@ -127,7 +127,7 @@ static void monitor(calcoutRecord *prec);
|
||||
static int fetch_values(calcoutRecord *prec);
|
||||
static void execOutput(calcoutRecord *prec);
|
||||
static void checkLinks(calcoutRecord *prec);
|
||||
static void checkLinksCallback(CALLBACK *arg);
|
||||
static void checkLinksCallback(epicsCallback *arg);
|
||||
static long writeValue(calcoutRecord *prec);
|
||||
|
||||
int calcoutRecDebug;
|
||||
@@ -673,7 +673,7 @@ static int fetch_values(calcoutRecord *prec)
|
||||
return(status);
|
||||
}
|
||||
|
||||
static void checkLinksCallback(CALLBACK *arg)
|
||||
static void checkLinksCallback(epicsCallback *arg)
|
||||
{
|
||||
|
||||
calcoutRecord *prec;
|
||||
@@ -731,7 +731,7 @@ static void checkLinks(calcoutRecord *prec)
|
||||
prpvt->caLinkStat = NO_CA_LINKS;
|
||||
|
||||
if (!prpvt->cbScheduled && caLinkNc) {
|
||||
/* Schedule another CALLBACK */
|
||||
/* Schedule another epicsCallback */
|
||||
prpvt->cbScheduled = 1;
|
||||
callbackRequestDelayed(&prpvt->checkLinkCb, .5);
|
||||
}
|
||||
|
||||
@@ -293,22 +293,22 @@ ATAN: Arc tangent
|
||||
=over 1
|
||||
|
||||
=item *
|
||||
>= : Greater than or equal to
|
||||
C<<< >= >>> : Greater than or equal to
|
||||
|
||||
=item *
|
||||
> : Greater than
|
||||
C<<< > >>> : Greater than
|
||||
|
||||
=item *
|
||||
<= : Less than or equal to
|
||||
C<<< <= >>> : Less than or equal to
|
||||
|
||||
=item *
|
||||
< : Less than
|
||||
C<<< < >>> : Less than
|
||||
|
||||
=item *
|
||||
# : Not equal to
|
||||
C<<< # >>> : Not equal to
|
||||
|
||||
=item *
|
||||
= : Equal to
|
||||
C<<< = >>> : Equal to
|
||||
|
||||
=back
|
||||
|
||||
@@ -332,10 +332,10 @@ ATAN: Arc tangent
|
||||
=over 1
|
||||
|
||||
=item *
|
||||
| : Bitwise Or
|
||||
C<|> : Bitwise Or
|
||||
|
||||
=item *
|
||||
& : Bitwise And
|
||||
C<&> : Bitwise And
|
||||
|
||||
=item *
|
||||
OR : Bitwise Or
|
||||
@@ -347,13 +347,13 @@ AND : Bitwise And
|
||||
XOR : Bitwise Exclusive Or
|
||||
|
||||
=item *
|
||||
~ : One's Complement
|
||||
C<~> : One's Complement
|
||||
|
||||
=item *
|
||||
<< : Left shift
|
||||
C<<< << >>> : Left shift
|
||||
|
||||
=item *
|
||||
>> : Right shift
|
||||
C<<< >> >>> : Right shift
|
||||
|
||||
=back
|
||||
|
||||
@@ -362,11 +362,11 @@ XOR : Bitwise Exclusive Or
|
||||
=over 1
|
||||
|
||||
=item *
|
||||
:= : assigns a value (right hand side) to a variable (i.e. field)
|
||||
C<:=> : assigns a value (right hand side) to a variable (i.e. field)
|
||||
|
||||
=back
|
||||
|
||||
=head3 Parentheses and Comma
|
||||
=head3 Parantheses, Comma, and Semicolon
|
||||
|
||||
The open and close parentheses are supported. Nested parentheses are
|
||||
supported.
|
||||
@@ -374,6 +374,10 @@ supported.
|
||||
The comma is supported when used to separate the arguments of a binary
|
||||
function.
|
||||
|
||||
The semicolon is used to separate expressions. Although only one
|
||||
traditional calculation expression is allowed, multiple assignment
|
||||
expressions are allowed.
|
||||
|
||||
=head3 Conditional Expression
|
||||
|
||||
The C language's question mark operator is supported. The format is:
|
||||
@@ -388,41 +392,59 @@ C<A + B + 10>
|
||||
=over 1
|
||||
|
||||
=item *
|
||||
Result is A + B + 10
|
||||
Result is C<A + B + 10>
|
||||
|
||||
=back
|
||||
|
||||
=head3 Relational
|
||||
|
||||
C<(A + B) < (C + D)>
|
||||
C<<< (A + B) < (C + D) >>>
|
||||
|
||||
=over 1
|
||||
|
||||
=item *
|
||||
Result is 1 if (A + B) < (C + D)
|
||||
Result is 1 if C<<< (A + B) < (C + D) >>>
|
||||
|
||||
=item *
|
||||
Result is 0 if (A + B) >= (C + D)
|
||||
Result is 0 if C<<< (A + B) >= (C + D) >>>
|
||||
|
||||
=back
|
||||
|
||||
=head3 Question Mark
|
||||
|
||||
C<(A + B) < (C + D) ? E : F + L + 10>
|
||||
C<<< (A + B) < (C + D) ? E : F + L + 10 >>>
|
||||
|
||||
=over 1
|
||||
|
||||
=item *
|
||||
Result is E if (A + B) < (C + D)
|
||||
Result is C<E> if C<<< (A + B) < (C + D) >>>
|
||||
|
||||
=item *
|
||||
Result is F + L + 10 if (A + B) >= (C + D)
|
||||
Result is C<F + L + 10> if C<<< (A + B) >= (C + D) >>>
|
||||
|
||||
=back
|
||||
|
||||
Prior to Base 3.14.9 it was legal to omit the : and the second (else) part
|
||||
of the conditional, like this:
|
||||
|
||||
C<(A + B)<(C + D) ? E>
|
||||
|
||||
=over 1
|
||||
|
||||
=item
|
||||
Result is E if (A + B)<(C + D)
|
||||
|
||||
=item
|
||||
Result is unchanged if (A + B)>=(C + D)
|
||||
|
||||
From 3.14.9 onwards, this expresion must be written as
|
||||
C<(A + B) < (C + D) ? E : VAL>
|
||||
|
||||
=back
|
||||
|
||||
=head3 Logical
|
||||
|
||||
C<A&B>
|
||||
C<A & B>
|
||||
|
||||
=over 1
|
||||
|
||||
@@ -447,6 +469,18 @@ Convert result to floating point
|
||||
|
||||
=back
|
||||
|
||||
=head3 Assignment
|
||||
|
||||
C<sin(a); a:=a+D2R>
|
||||
|
||||
=over 1
|
||||
|
||||
=item *
|
||||
Causes the Calc record to output the successive values of a sine curve in
|
||||
1 degree intervals.
|
||||
|
||||
=back
|
||||
|
||||
=head3 Output Parameters
|
||||
|
||||
These parameters specify and control the output capabilities of the Calcout
|
||||
@@ -529,7 +563,7 @@ are also meant to represent the status of the record at run-time.
|
||||
|
||||
The EGU field contains a string of up to 16 characters which is supplied by
|
||||
the user and which describes the values being operated upon. The string is
|
||||
retrieved whenever the routine C<get_units> is called. The EGU string is
|
||||
retrieved whenever the routine C<get_units()> is called. The EGU string is
|
||||
solely for an operator's sake and does not have to be used.
|
||||
|
||||
The HOPR and LOPR fields on;y refer to the limits if the VAL, HIHI, HIGH,
|
||||
@@ -1146,10 +1180,6 @@ See next section.
|
||||
|
||||
This is called id CALC or OCAL is changed. C<special> calls postfix.
|
||||
|
||||
=head2 C<get_value>
|
||||
|
||||
Fills in the values of struct valueDes so that they refer to VAL.
|
||||
|
||||
=head2 C<get_units>
|
||||
|
||||
Retrieves EGU.
|
||||
|
||||
@@ -4,33 +4,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.
|
||||
#*************************************************************************
|
||||
|
||||
=title Compress Record (compress)
|
||||
=title Compression Record (compress)
|
||||
|
||||
...
|
||||
The data compression record is used to collect and compress data from arrays.
|
||||
When the INP field references a data array field, it immediately compresses the
|
||||
entire array into an element of an array using one of several algorithms,
|
||||
overwriting the previous element. If the INP field obtains its value from a
|
||||
scalar-value field, the compression record will collect a new sample each time
|
||||
the record is processed and add it to the compressed data array as a circular
|
||||
buffer.
|
||||
|
||||
=head2 Record-specific Menus
|
||||
|
||||
=head3 Menu compressALG
|
||||
|
||||
The ALG field which uses this menu controls the compression algorithm used.
|
||||
|
||||
...
|
||||
|
||||
=menu compressALG
|
||||
|
||||
...
|
||||
|
||||
=head2 Parameter Fields
|
||||
|
||||
The record-specific fields are described below.
|
||||
The INP link can also specify a constant; however, if this is the case, the
|
||||
compression algorithms are ignored, and the record support routines merely
|
||||
return after checking the FLNK field.
|
||||
|
||||
=recordtype compress
|
||||
|
||||
...
|
||||
|
||||
=cut
|
||||
|
||||
menu(compressALG) {
|
||||
@@ -43,11 +35,299 @@ menu(compressALG) {
|
||||
}
|
||||
recordtype(compress) {
|
||||
|
||||
=fields VAL
|
||||
=head2 Parameter Fields
|
||||
|
||||
The record-specific fields are described below, grouped by functionality.
|
||||
|
||||
=head3 Scanning Parameters
|
||||
|
||||
The compression record has the standard fields for specifying under what
|
||||
circumstances the record will be processed. These fields are listed in
|
||||
L<Scan Fields>. In addition, L<Scanning Specification>
|
||||
explains how these fields are used. Since the compression record supports no
|
||||
direct interfaces to hardware, its SCAN field cannot specify C<<< I/O Intr >>>.
|
||||
|
||||
=head3 Algorithms and Related Parameters
|
||||
|
||||
The user specifies the algorithm to be used in the ALG field. There are six possible
|
||||
algorithms which can be specified as follows:
|
||||
|
||||
=head4 Menu compressALG
|
||||
|
||||
=menu compressALG
|
||||
|
||||
The following fields determine what channel to read and how to compress the data:
|
||||
|
||||
=fields ALG, INP, NSAM, N, ILIL, IHIL, OFF, RES
|
||||
|
||||
As stated above, the ALG field specifies which algorithm to be performed on the data.
|
||||
|
||||
The INP should be a database or channel access link. Though INP can be a constant,
|
||||
the data compression algorithms are supported only when INP is a database link. See
|
||||
L<Address Specification> for information on specifying links.
|
||||
|
||||
|
||||
IHIL and ILIL can be set to provide an initial value filter on the input array.
|
||||
If ILIL E<lt> IHIL, the input elements will be skipped until a value is found
|
||||
that is in the range of ILIL to IHIL. Note that ILIL and IHIL are used only in
|
||||
C<<< N to 1 >>> algorithms.
|
||||
|
||||
OFF provides the offset to the current beginning of the array data.
|
||||
Note that OFF is used only in C<<< N to 1 >>> algorithms.
|
||||
|
||||
The RES field can be accessed at run time to cause the algorithm to reset
|
||||
itself before the maximum number of samples are reached.
|
||||
|
||||
=head4 Algorithms
|
||||
|
||||
B<Circular Buffer> algorithm keeps a circular buffer of length NSAM.
|
||||
Each time the record is processed, it gets the data referenced by INP and puts
|
||||
it into the circular buffer referenced by VAL. The INP can refer to both scalar or
|
||||
array data and VAL is just a time ordered circular buffer of values obtained
|
||||
from INP.
|
||||
Note that N, ILIL, IHIL and OFF are not used in C<<< Circular Buffer >>> algorithm.
|
||||
|
||||
B<Average> takes an average of every element of the array obtained from
|
||||
INP over time; that is, the entire array referenced by INP is retrieved, and for
|
||||
each element, the new average is calculated and placed in the corresponding
|
||||
element of the value buffer. The retrieved array is truncated to be of length
|
||||
NSAM. N successive arrays are averaged and placed in the buffer. Thus, VAL[0]
|
||||
holds the average of the first element of INP over N samples, VAL[1] holds the
|
||||
average of the next element of INP over N samples, and so on. The following
|
||||
shows the equation:
|
||||
|
||||
=for comment Latex form of equation bellow : VAL[i] \leftarrow \frac{1}{N}\sum_{n=1}^NINP_{n}[i]
|
||||
|
||||
=begin html
|
||||
|
||||
<img src="image/compress-1.png">
|
||||
|
||||
=end html
|
||||
|
||||
B<N to 1> If any of the C<<< N to 1 >>> algorithms are chosen, then VAL is a circular
|
||||
buffer of NSAM samples.
|
||||
The actual algorithm depends on whether INP references a scalar or an array.
|
||||
|
||||
If INP refers to a scalar, then N successive time ordered samples of INP are taken.
|
||||
After the Nth sample is obtained, a new value determined by the algorithm
|
||||
(Lowest, Highest, or Average), is written to the circular buffer referenced by
|
||||
VAL. If C<<< Low Value >>> the lowest value of all the samples is written; if
|
||||
C<<< High Value >>> the highest value is written; and if C<<< Average >>>, the
|
||||
average of all the samples are written. The C<<< Median >>> setting behaves
|
||||
like C<<< Average >>> with scalar input data.
|
||||
|
||||
If INP refers to an array, then the following applies:
|
||||
|
||||
=over
|
||||
|
||||
=item C<<< N to 1 Low Value >>>
|
||||
|
||||
Compress N to 1 samples, keeping the lowest value.
|
||||
|
||||
=item C<<< N to 1 High Value >>>
|
||||
|
||||
Compress N to 1 samples, keeping the highest value.
|
||||
|
||||
=item C<<< N to 1 Average >>>
|
||||
|
||||
Compress N to 1 samples, taking the average value.
|
||||
|
||||
=item C<<< N to 1 Median >>>
|
||||
|
||||
Compress N to 1 samples, taking the median value.
|
||||
|
||||
=back
|
||||
|
||||
The compression record keeps NSAM data samples.
|
||||
|
||||
The field N determines the number of elements to compress into each result.
|
||||
|
||||
Thus, if NSAM was 3, and N was also equal to 3, then the algorithms would work
|
||||
as in the following diagram:
|
||||
|
||||
=begin html
|
||||
|
||||
<img src="image/compress-2.png">
|
||||
|
||||
=end html
|
||||
|
||||
|
||||
=head3 Operator Display Parameters
|
||||
|
||||
These parameters are used to present meaningful data to the operator. They
|
||||
display the value and other parameters of the record either textually or
|
||||
graphically.
|
||||
|
||||
=fields EGU, HOPR, LOPR, PREC, NAME, DESC
|
||||
|
||||
The EGU field should be given a string that describes the value of VAL, but is
|
||||
used whenever the C<<< get_units >>> record support routine is called.
|
||||
|
||||
The HOPR and LOPR fields only specify the upper and lower display limits for
|
||||
VAL, HIHI, HIGH, LOLO and LOW fields.
|
||||
|
||||
PREC controls the floating-point precision whenever C<<< get_precision >>> is
|
||||
called, and the field being referenced is the VAL field (i.e., one of the values
|
||||
contained in the circular buffer).
|
||||
|
||||
See L<Fields Common to All Record Types>
|
||||
for more on the record name (NAME) and description (DESC) fields.
|
||||
|
||||
|
||||
=head3 Alarm Parameters
|
||||
|
||||
The compression record has the alarm parameters common to all record types
|
||||
described in L<Alarm Fields>.
|
||||
|
||||
=head3 Run-time Parameters
|
||||
|
||||
These parameters are used by the run-time code for processing the data
|
||||
compression algorithm. They are not configurable by the user, though some are
|
||||
accessible at run-time. They can represent the current state of the waveform or
|
||||
of the record whose field is referenced by the INP field.
|
||||
|
||||
=fields NUSE, OUSE, BPTR, SPTR, WPTR, CVB, INPN, INX
|
||||
|
||||
NUSE and OUSE hold the current and previous number of elements stored in VAL.
|
||||
|
||||
BPTR is a pointer that refers to the buffer referenced by VAL.
|
||||
|
||||
SPTR points to an array that is used for array averages.
|
||||
|
||||
WPTR is used by the dbGetlinks routines.
|
||||
|
||||
=head2 Record Support
|
||||
|
||||
=head3 Record Support Routines
|
||||
|
||||
long init_record(struct dbCommon *precord, int pass)
|
||||
|
||||
Space for all necessary arrays is allocated. The addresses are stored in the
|
||||
appropriate fields in the record.
|
||||
|
||||
long process(struct dbCommon *precord)
|
||||
|
||||
See L<Record Processing> below.
|
||||
|
||||
long special(struct dbAddr *paddr, int after)
|
||||
|
||||
This routine is called when RSET, ALG, or N are set. It performs a reset.
|
||||
|
||||
long cvt_dbaddr(struct dbAddr *paddr)
|
||||
|
||||
This is called by dbNameToAddr. It makes the dbAddr structure refer to the
|
||||
actual buffer holding the result.
|
||||
|
||||
long get_array_info(struct dbAddr *paddr, long *no_elements, long *offset)
|
||||
|
||||
Obtains values from the circular buffer referenced by VAL.
|
||||
|
||||
long put_array_info(struct dbAddr *paddr, long nNew);
|
||||
|
||||
Writes values into the circular buffer referenced by VAL.
|
||||
|
||||
long get_units(struct dbAddr *paddr, char *units);
|
||||
|
||||
Retrieves EGU.
|
||||
|
||||
long get_precision(const struct dbAddr *paddr, long *precision);
|
||||
|
||||
Retrieves PREC.
|
||||
|
||||
long get_graphic_double(struct dbAddr *paddr, struct dbr_grDouble *p);
|
||||
|
||||
Sets the upper display and lower display limits for a field. If the field is
|
||||
VAL, the limits are set to HOPR and LOPR, else if the field has upper and lower
|
||||
limits defined they will be used, else the upper and lower maximum values for
|
||||
the field type will be used.
|
||||
|
||||
long get_control_double(struct dbAddr *paddr, struct dbr_ctrlDouble *p);
|
||||
|
||||
Sets the upper control and the lower control limits for a field. If the field is
|
||||
VAL, the limits are set to HOPR and LOPR, else if the field has upper and lower
|
||||
limits defined they will be used, else the upper and lower maximum values for
|
||||
the field type will be used.
|
||||
|
||||
=head3 Record Processing
|
||||
|
||||
Routine process implements the following algorithm:
|
||||
|
||||
=over
|
||||
|
||||
=item 1.
|
||||
|
||||
If INP is not a database link, check monitors and the forward link and return.
|
||||
|
||||
=item 2.
|
||||
|
||||
Get the current data referenced by INP.
|
||||
|
||||
=item 3.
|
||||
|
||||
Perform the appropriate algorithm:
|
||||
|
||||
=over
|
||||
|
||||
=item *
|
||||
|
||||
Average: Read N successive instances of INP and perform an element by element
|
||||
average. Until N instances have been obtained it just return without checking
|
||||
monitors or the forward link. When N instances have been obtained complete the
|
||||
algorithm, store the result in the VAL array, check monitors and the forward
|
||||
link, and return.
|
||||
|
||||
=item *
|
||||
|
||||
Circular Buffer: Write the values obtained from INP into the VAL array as a
|
||||
circular buffer, check monitors and the forward link, and return.
|
||||
|
||||
=item *
|
||||
|
||||
N to 1 xxx when INP refers to a scalar: Obtain N successive values from INP and
|
||||
apply the N to 1 xxx algorithm to these values. Until N values are obtained
|
||||
monitors and forward links are not triggered. When N successive values have been
|
||||
obtained, complete the algorithm, check monitors and trigger the forward link,
|
||||
and return.
|
||||
|
||||
=item *
|
||||
|
||||
N to 1 xxx when INP refers to an array: The ILIL and IHIL are honored if ILIL
|
||||
E<lt> IHIL. The input array is divided into subarrays of length N. The specified
|
||||
N to 1 xxx compression algorithm is applied to each sub-array and the result
|
||||
stored in the array referenced by VAL. The monitors and forward link are
|
||||
checked.
|
||||
|
||||
=back
|
||||
|
||||
=item 4.
|
||||
|
||||
If success, set UDF to FALSE.
|
||||
|
||||
=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 *
|
||||
|
||||
NSEV and NSTA are reset to 0.
|
||||
|
||||
=back
|
||||
|
||||
=item 6.
|
||||
|
||||
Scan forward link if necessary, set PACT FALSE, and return.
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
include "dbCommon.dbd"
|
||||
include "dbCommon.dbd"
|
||||
field(VAL,DBF_NOACCESS) {
|
||||
prompt("Value")
|
||||
asl(ASL0)
|
||||
|
||||
@@ -379,11 +379,6 @@ and the DOL link, a non-zero value is returned if an error occurs.
|
||||
|
||||
See next section.
|
||||
|
||||
=head2 C<get_value()>
|
||||
|
||||
This routine fills in the members of C<struct valueDes> with the VAL fields
|
||||
value and characteristics.
|
||||
|
||||
=head2 C<get_units()>
|
||||
|
||||
The routine copies the string specified in the EGU field to the location
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
#*************************************************************************
|
||||
# Copyright (c) 2002 The University of Chicago, 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.
|
||||
#*************************************************************************
|
||||
recordtype(event) {
|
||||
include "dbCommon.dbd"
|
||||
field(VAL,DBF_STRING) {
|
||||
prompt("Event Name To Post")
|
||||
promptgroup("40 - Input")
|
||||
special(SPC_MOD)
|
||||
asl(ASL0)
|
||||
size(40)
|
||||
}
|
||||
%#include "dbScan.h"
|
||||
field(EPVT, DBF_NOACCESS) {
|
||||
prompt("Event private")
|
||||
special(SPC_NOMOD)
|
||||
interest(4)
|
||||
extra("EVENTPVT epvt")
|
||||
}
|
||||
field(INP,DBF_INLINK) {
|
||||
prompt("Input Specification")
|
||||
promptgroup("40 - Input")
|
||||
interest(1)
|
||||
}
|
||||
field(SIOL,DBF_INLINK) {
|
||||
prompt("Sim Input Specifctn")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(1)
|
||||
}
|
||||
field(SVAL,DBF_STRING) {
|
||||
prompt("Simulation Value")
|
||||
size(40)
|
||||
}
|
||||
field(SIML,DBF_INLINK) {
|
||||
prompt("Sim Mode Location")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(1)
|
||||
}
|
||||
field(SIMM,DBF_MENU) {
|
||||
prompt("Simulation Mode")
|
||||
interest(1)
|
||||
menu(menuYesNo)
|
||||
}
|
||||
field(SIMS,DBF_MENU) {
|
||||
prompt("Sim mode Alarm Svrty")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(2)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
}
|
||||
278
src/std/rec/eventRecord.dbd.pod
Normal file
278
src/std/rec/eventRecord.dbd.pod
Normal file
@@ -0,0 +1,278 @@
|
||||
#*************************************************************************
|
||||
# Copyright (c) 2002 The University of Chicago, 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.
|
||||
#*************************************************************************
|
||||
|
||||
=title Event Record (event)
|
||||
|
||||
The normal use for this record type is to post an event and/or process a
|
||||
forward link. Device support for this record can provide a hardware interrupt
|
||||
handler routine for I/O Event-scanned records.
|
||||
|
||||
=head2 Parameter Fields
|
||||
|
||||
The records in this field fall into the following groups of parameters:
|
||||
|
||||
=over
|
||||
|
||||
=item *
|
||||
|
||||
scan parameters
|
||||
|
||||
=item *
|
||||
|
||||
read parameters
|
||||
|
||||
=item *
|
||||
|
||||
event number parameters
|
||||
|
||||
=item *
|
||||
|
||||
simulation mode parameters
|
||||
|
||||
=back
|
||||
|
||||
=recordtype event
|
||||
|
||||
=cut
|
||||
|
||||
recordtype(event) {
|
||||
include "dbCommon.dbd"
|
||||
|
||||
=head3 Scan Parameters
|
||||
|
||||
The event record has the standard fields for specifying under what circumstances
|
||||
it will be processed. If the SCAN field specifies C<I/O Intr>, then device
|
||||
support will provide an interrupt handler, posting an event number when an I/O
|
||||
interrupt occurs. These fields are listed in L<Scan Fields>. In addition,
|
||||
L<Scanning Specification> explains how the scanning fields work. Note that I/O
|
||||
event scanning is only supported for those card types that interrupt.
|
||||
|
||||
=head3 Event Number Parameters
|
||||
|
||||
The VAL field contains the event number read by the device support routines. It
|
||||
is this number which is posted. For records that use C<Soft Channel> device
|
||||
support, it can be configured before run-time or set via dbPuts.
|
||||
|
||||
=fields VAL
|
||||
|
||||
=cut
|
||||
|
||||
field(VAL,DBF_STRING) {
|
||||
prompt("Event Name To Post")
|
||||
promptgroup("40 - Input")
|
||||
special(SPC_MOD)
|
||||
asl(ASL0)
|
||||
size(40)
|
||||
}
|
||||
%#include "dbScan.h"
|
||||
field(EPVT, DBF_NOACCESS) {
|
||||
prompt("Event private")
|
||||
special(SPC_NOMOD)
|
||||
interest(4)
|
||||
extra("EVENTPVT epvt")
|
||||
}
|
||||
|
||||
=head3 Input Specification
|
||||
|
||||
The device support routines use the address in this record to obtain input. For
|
||||
records that provide an interrupt handler, the INP field should specify the
|
||||
address of the I/O card, and the DTYP field should specify a valid device
|
||||
support module. Be aware that the address format differs according to the card
|
||||
type used. See L<Address Specification> for information on the format of
|
||||
hardware addresses and specifying links.
|
||||
|
||||
For soft records, the INP field can be a constant, a database link, or a channel
|
||||
access link. For soft records, the DTYP field should specify C<Soft Channel>.
|
||||
|
||||
=fields INP, DTYP
|
||||
|
||||
=cut
|
||||
|
||||
field(INP,DBF_INLINK) {
|
||||
prompt("Input Specification")
|
||||
promptgroup("40 - Input")
|
||||
interest(1)
|
||||
}
|
||||
|
||||
=head3 Operator Display Parameters
|
||||
|
||||
See L<Fields Common to All Record Types> for more on the record name (NAME) and
|
||||
description (DESC) fields.
|
||||
|
||||
=fields NAME, DESC
|
||||
|
||||
=head3 Alarm Parameters
|
||||
|
||||
The Event record has the alarm parameters common to all record types. L<Alarm
|
||||
Fields> lists other fields related to alarms that are common to all record
|
||||
types.
|
||||
|
||||
=head3 Simulation Mode Parameters
|
||||
|
||||
The following fields are used to operate the event record in the simulation
|
||||
mode. See L<Fields Common to Many Record Types> for more information on these
|
||||
fields.
|
||||
|
||||
=fields SIOL, SVAL, SIML, SIMM, SIMS
|
||||
|
||||
=cut
|
||||
|
||||
field(SIOL,DBF_INLINK) {
|
||||
prompt("Sim Input Specifctn")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(1)
|
||||
}
|
||||
field(SVAL,DBF_STRING) {
|
||||
prompt("Simulation Value")
|
||||
size(40)
|
||||
}
|
||||
field(SIML,DBF_INLINK) {
|
||||
prompt("Sim Mode Location")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(1)
|
||||
}
|
||||
field(SIMM,DBF_MENU) {
|
||||
prompt("Simulation Mode")
|
||||
interest(1)
|
||||
menu(menuYesNo)
|
||||
}
|
||||
field(SIMS,DBF_MENU) {
|
||||
prompt("Sim mode Alarm Svrty")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(2)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
|
||||
=head2 Record Support
|
||||
|
||||
=head3 Record Support Routines
|
||||
|
||||
=head4 init_record
|
||||
|
||||
This routine initializes SIMM with the value of SIML if SIML type is a 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.
|
||||
|
||||
If device support includes C<init_record()>, it is called.
|
||||
|
||||
=head4 process
|
||||
|
||||
See next section.
|
||||
|
||||
=head3 Record Processing
|
||||
|
||||
Routine process implements the following algorithm:
|
||||
|
||||
=over
|
||||
|
||||
=item 1.
|
||||
|
||||
readValue is called. See L<Input Records> for more information.
|
||||
|
||||
=item 2.
|
||||
|
||||
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 3.
|
||||
|
||||
If VAL E<gt> 0, post event number VAL.
|
||||
|
||||
=item 4.
|
||||
|
||||
Check to see if monitors should be invoked. Alarm monitors are invoked if the
|
||||
alarm status or severity has chanet to 0.
|
||||
|
||||
=item 5.
|
||||
|
||||
Scan forward link if necessary, set PACT FALSE, and return.
|
||||
|
||||
=back
|
||||
|
||||
=head2 Device Support
|
||||
|
||||
=head3 Fields of Interest To Device Support
|
||||
|
||||
Each record must have an associated set of device support routines. The device
|
||||
support routines are primarily interested in the following fields:
|
||||
|
||||
=fields PACT, DPVT, UDF, NSEV, NSTA, INP, PRIO
|
||||
|
||||
=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<dbior> 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<level> 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<init_record()> calls are made, with
|
||||
the integer parameter C<after> set to 0.
|
||||
The second call happens after all of the C<init_record()> calls have been made,
|
||||
with C<after> set to 1.
|
||||
|
||||
=head4 init_record
|
||||
|
||||
init_record(precord)
|
||||
|
||||
This routine is optional. If provided, it is called by the record support
|
||||
C<init_record()> routine.
|
||||
|
||||
=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 read_event
|
||||
|
||||
read_event(precord)
|
||||
|
||||
This routine returns the following values:
|
||||
|
||||
=over
|
||||
|
||||
=item *
|
||||
|
||||
0: Success.
|
||||
|
||||
=item *
|
||||
|
||||
Other: Error.
|
||||
|
||||
=back
|
||||
|
||||
=head3 Device Support For Soft Records
|
||||
|
||||
The C<Soft Channel> device support module is available. The INP link type must
|
||||
be either CONSTANT, DB_LINK, or CA_LINK.
|
||||
|
||||
If the INP link type is CONSTANT, then the constant value is stored into VAL by
|
||||
C<init_record()>, and UDF is set to FALSE. If the INP link type is PV_LINK, then
|
||||
dbCaAddInlink is called by C<init_record()>.
|
||||
|
||||
C<read_event> calls recGblGetLinkValue to read the current value of VAL. See
|
||||
L<Input Records> for details on soft input.
|
||||
|
||||
=cut
|
||||
|
||||
}
|
||||
@@ -1,129 +0,0 @@
|
||||
#*************************************************************************
|
||||
# Copyright (c) 2012 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.
|
||||
#*************************************************************************
|
||||
menu(fanoutSELM) {
|
||||
choice(fanoutSELM_All,"All")
|
||||
choice(fanoutSELM_Specified,"Specified")
|
||||
choice(fanoutSELM_Mask,"Mask")
|
||||
}
|
||||
recordtype(fanout) {
|
||||
include "dbCommon.dbd"
|
||||
field(VAL,DBF_LONG) {
|
||||
prompt("Used to trigger")
|
||||
asl(ASL0)
|
||||
pp(TRUE)
|
||||
}
|
||||
field(SELM,DBF_MENU) {
|
||||
prompt("Select Mechanism")
|
||||
promptgroup("30 - Action")
|
||||
interest(1)
|
||||
menu(fanoutSELM)
|
||||
}
|
||||
field(SELN,DBF_USHORT) {
|
||||
prompt("Link Selection")
|
||||
interest(1)
|
||||
initial("1")
|
||||
}
|
||||
field(SELL,DBF_INLINK) {
|
||||
prompt("Link Selection Loc")
|
||||
promptgroup("30 - Action")
|
||||
interest(1)
|
||||
}
|
||||
field(OFFS,DBF_SHORT) {
|
||||
prompt("Offset for Specified")
|
||||
promptgroup("30 - Action")
|
||||
interest(1)
|
||||
initial("0")
|
||||
}
|
||||
field(SHFT,DBF_SHORT) {
|
||||
prompt("Shift for Mask mode")
|
||||
promptgroup("30 - Action")
|
||||
interest(1)
|
||||
initial("-1")
|
||||
}
|
||||
field(LNK0,DBF_FWDLINK) {
|
||||
prompt("Forward Link 0")
|
||||
promptgroup("51 - Output 0-7")
|
||||
interest(1)
|
||||
}
|
||||
field(LNK1,DBF_FWDLINK) {
|
||||
prompt("Forward Link 1")
|
||||
promptgroup("51 - Output 0-7")
|
||||
interest(1)
|
||||
}
|
||||
field(LNK2,DBF_FWDLINK) {
|
||||
prompt("Forward Link 2")
|
||||
promptgroup("51 - Output 0-7")
|
||||
interest(1)
|
||||
}
|
||||
field(LNK3,DBF_FWDLINK) {
|
||||
prompt("Forward Link 3")
|
||||
promptgroup("51 - Output 0-7")
|
||||
interest(1)
|
||||
}
|
||||
field(LNK4,DBF_FWDLINK) {
|
||||
prompt("Forward Link 4")
|
||||
promptgroup("51 - Output 0-7")
|
||||
interest(1)
|
||||
}
|
||||
field(LNK5,DBF_FWDLINK) {
|
||||
prompt("Forward Link 5")
|
||||
promptgroup("51 - Output 0-7")
|
||||
interest(1)
|
||||
}
|
||||
field(LNK6,DBF_FWDLINK) {
|
||||
prompt("Forward Link 6")
|
||||
promptgroup("51 - Output 0-7")
|
||||
interest(1)
|
||||
}
|
||||
field(LNK7,DBF_FWDLINK) {
|
||||
prompt("Forward Link 7")
|
||||
promptgroup("51 - Output 0-7")
|
||||
interest(1)
|
||||
}
|
||||
field(LNK8,DBF_FWDLINK) {
|
||||
prompt("Forward Link 8")
|
||||
promptgroup("52 - Output 8-F")
|
||||
interest(1)
|
||||
}
|
||||
field(LNK9,DBF_FWDLINK) {
|
||||
prompt("Forward Link 9")
|
||||
promptgroup("52 - Output 8-F")
|
||||
interest(1)
|
||||
}
|
||||
field(LNKA,DBF_FWDLINK) {
|
||||
prompt("Forward Link 10")
|
||||
promptgroup("52 - Output 8-F")
|
||||
interest(1)
|
||||
}
|
||||
field(LNKB,DBF_FWDLINK) {
|
||||
prompt("Forward Link 11")
|
||||
promptgroup("52 - Output 8-F")
|
||||
interest(1)
|
||||
}
|
||||
field(LNKC,DBF_FWDLINK) {
|
||||
prompt("Forward Link 12")
|
||||
promptgroup("52 - Output 8-F")
|
||||
interest(1)
|
||||
}
|
||||
field(LNKD,DBF_FWDLINK) {
|
||||
prompt("Forward Link 13")
|
||||
promptgroup("52 - Output 8-F")
|
||||
interest(1)
|
||||
}
|
||||
field(LNKE,DBF_FWDLINK) {
|
||||
prompt("Forward Link 14")
|
||||
promptgroup("52 - Output 8-F")
|
||||
interest(1)
|
||||
}
|
||||
field(LNKF,DBF_FWDLINK) {
|
||||
prompt("Forward Link 15")
|
||||
promptgroup("52 - Output 8-F")
|
||||
interest(1)
|
||||
}
|
||||
}
|
||||
314
src/std/rec/fanoutRecord.dbd.pod
Normal file
314
src/std/rec/fanoutRecord.dbd.pod
Normal file
@@ -0,0 +1,314 @@
|
||||
#*************************************************************************
|
||||
# Copyright (c) 2012 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.
|
||||
#*************************************************************************
|
||||
|
||||
=title Fanout Record (fanout)
|
||||
|
||||
The fanout record uses several forward processing links to force multiple
|
||||
passive records to scan. When more than one record needs to be scanned as the
|
||||
result of a record being processed, the forward link of that record can specify
|
||||
a fanout record. The fanout record can specify up to sixteen other records to
|
||||
process. If more than sixteen are needed, one of the forward links in the fanout
|
||||
record (or its FLNK field) can point to another fanout record.
|
||||
|
||||
B<NOTE: Fanout records only propagate processing, not data.> The dfanout or
|
||||
data fanout record can, on the other hand, send data to other records.
|
||||
|
||||
=head2 Parameter Fields
|
||||
|
||||
The fanout record's fields fall into the following categories:
|
||||
|
||||
=over
|
||||
|
||||
=item *
|
||||
|
||||
scan parameters
|
||||
|
||||
=item *
|
||||
|
||||
operator display parameters
|
||||
|
||||
=item *
|
||||
|
||||
run-time parameters.
|
||||
|
||||
=back
|
||||
|
||||
=recordtype fanout
|
||||
|
||||
=cut
|
||||
|
||||
menu(fanoutSELM) {
|
||||
choice(fanoutSELM_All,"All")
|
||||
choice(fanoutSELM_Specified,"Specified")
|
||||
choice(fanoutSELM_Mask,"Mask")
|
||||
}
|
||||
|
||||
recordtype(fanout) {
|
||||
include "dbCommon.dbd"
|
||||
|
||||
=head3 Scan Parameters
|
||||
|
||||
The forward link fields of the fanout record (LNK0-LNK9, LNKA-LNKF) specify
|
||||
records to be scanned. The records to be processed must specify C<Passive> in
|
||||
their SCAN fields; otherwise the forward link will not cause them to process.
|
||||
Also when specifying database links for the fanout record, the user needs only
|
||||
to specify the record name. As no value is being sent or retrieved, a field name
|
||||
is only required when the link will be over Channel Access, in which case the
|
||||
field PROC must be named.
|
||||
|
||||
The SELM, SELN, and SELL fields specify the order of processing for the forward
|
||||
links. The select mechanism menu field (SELM) has three choices:
|
||||
|
||||
=menu fanoutSELM
|
||||
|
||||
How the SELM value affects which links to process and in which order is as
|
||||
follows:
|
||||
|
||||
=over
|
||||
|
||||
=item *
|
||||
|
||||
B<All>
|
||||
Links are processed in numerical order - LNK0, LNK1, etc.
|
||||
|
||||
=item *
|
||||
|
||||
B<Specified> The sum of the values in the SELN and OFFS fields is used as the
|
||||
specifier of which link to process. For instance, with OFFS=0 and SELN=1, the
|
||||
record targeted by LNK1 will be processed.
|
||||
|
||||
=item *
|
||||
|
||||
B<Mask> The individual bits in SELN are shifted by SHFT bits (negative means
|
||||
shift left) and the result used to select which links to process as follows:
|
||||
|
||||
=over
|
||||
|
||||
=item *
|
||||
|
||||
If bit 0 (LSB) is set, LNK0 is processed.
|
||||
|
||||
=item *
|
||||
|
||||
If bit 1 is set, LNK2 is processed.
|
||||
|
||||
=item *
|
||||
|
||||
If bit 2 is set, LNK3 is processed, etc.
|
||||
|
||||
=back
|
||||
|
||||
=back
|
||||
|
||||
SELN reads its value from SELL. SELL can be a constant, a database link, or a
|
||||
channel access link. If a constant, SELN is initialized with the constant value
|
||||
and can be changed via dbPuts. For database/channel access links, SELN is
|
||||
retrieved from SELL each time the record is processed and can also be changed
|
||||
via dbPuts.
|
||||
|
||||
The Fanout record also has the standard scanning fields common to all records.
|
||||
These fields are listed in L<Scan Fields>. In addition,
|
||||
L<Scanning Specification> explains in more detail how forward links and the
|
||||
scanning algorithms work.
|
||||
|
||||
=fields SELM, SELN, SELL, OFFS, SHFT, LNK0, LNK1, LNK2, LNK3, LNK4, LNK5, LNK6, LNK7, LNK8, LNK9, LNKA, LNKB, LNKC, LNKD, LNKE, LNKF
|
||||
|
||||
=cut
|
||||
|
||||
field(VAL,DBF_LONG) {
|
||||
prompt("Used to trigger")
|
||||
asl(ASL0)
|
||||
pp(TRUE)
|
||||
}
|
||||
field(SELM,DBF_MENU) {
|
||||
prompt("Select Mechanism")
|
||||
promptgroup("30 - Action")
|
||||
interest(1)
|
||||
menu(fanoutSELM)
|
||||
}
|
||||
field(SELN,DBF_USHORT) {
|
||||
prompt("Link Selection")
|
||||
interest(1)
|
||||
initial("1")
|
||||
}
|
||||
field(SELL,DBF_INLINK) {
|
||||
prompt("Link Selection Loc")
|
||||
promptgroup("30 - Action")
|
||||
interest(1)
|
||||
}
|
||||
field(OFFS,DBF_SHORT) {
|
||||
prompt("Offset for Specified")
|
||||
promptgroup("30 - Action")
|
||||
interest(1)
|
||||
initial("0")
|
||||
}
|
||||
field(SHFT,DBF_SHORT) {
|
||||
prompt("Shift for Mask mode")
|
||||
promptgroup("30 - Action")
|
||||
interest(1)
|
||||
initial("-1")
|
||||
}
|
||||
field(LNK0,DBF_FWDLINK) {
|
||||
prompt("Forward Link 0")
|
||||
promptgroup("51 - Output 0-7")
|
||||
interest(1)
|
||||
}
|
||||
field(LNK1,DBF_FWDLINK) {
|
||||
prompt("Forward Link 1")
|
||||
promptgroup("51 - Output 0-7")
|
||||
interest(1)
|
||||
}
|
||||
field(LNK2,DBF_FWDLINK) {
|
||||
prompt("Forward Link 2")
|
||||
promptgroup("51 - Output 0-7")
|
||||
interest(1)
|
||||
}
|
||||
field(LNK3,DBF_FWDLINK) {
|
||||
prompt("Forward Link 3")
|
||||
promptgroup("51 - Output 0-7")
|
||||
interest(1)
|
||||
}
|
||||
field(LNK4,DBF_FWDLINK) {
|
||||
prompt("Forward Link 4")
|
||||
promptgroup("51 - Output 0-7")
|
||||
interest(1)
|
||||
}
|
||||
field(LNK5,DBF_FWDLINK) {
|
||||
prompt("Forward Link 5")
|
||||
promptgroup("51 - Output 0-7")
|
||||
interest(1)
|
||||
}
|
||||
field(LNK6,DBF_FWDLINK) {
|
||||
prompt("Forward Link 6")
|
||||
promptgroup("51 - Output 0-7")
|
||||
interest(1)
|
||||
}
|
||||
field(LNK7,DBF_FWDLINK) {
|
||||
prompt("Forward Link 7")
|
||||
promptgroup("51 - Output 0-7")
|
||||
interest(1)
|
||||
}
|
||||
field(LNK8,DBF_FWDLINK) {
|
||||
prompt("Forward Link 8")
|
||||
promptgroup("52 - Output 8-F")
|
||||
interest(1)
|
||||
}
|
||||
field(LNK9,DBF_FWDLINK) {
|
||||
prompt("Forward Link 9")
|
||||
promptgroup("52 - Output 8-F")
|
||||
interest(1)
|
||||
}
|
||||
field(LNKA,DBF_FWDLINK) {
|
||||
prompt("Forward Link 10")
|
||||
promptgroup("52 - Output 8-F")
|
||||
interest(1)
|
||||
}
|
||||
field(LNKB,DBF_FWDLINK) {
|
||||
prompt("Forward Link 11")
|
||||
promptgroup("52 - Output 8-F")
|
||||
interest(1)
|
||||
}
|
||||
field(LNKC,DBF_FWDLINK) {
|
||||
prompt("Forward Link 12")
|
||||
promptgroup("52 - Output 8-F")
|
||||
interest(1)
|
||||
}
|
||||
field(LNKD,DBF_FWDLINK) {
|
||||
prompt("Forward Link 13")
|
||||
promptgroup("52 - Output 8-F")
|
||||
interest(1)
|
||||
}
|
||||
field(LNKE,DBF_FWDLINK) {
|
||||
prompt("Forward Link 14")
|
||||
promptgroup("52 - Output 8-F")
|
||||
interest(1)
|
||||
}
|
||||
field(LNKF,DBF_FWDLINK) {
|
||||
prompt("Forward Link 15")
|
||||
promptgroup("52 - Output 8-F")
|
||||
interest(1)
|
||||
}
|
||||
|
||||
=head3 Operator Display Parameters
|
||||
|
||||
These parameters are used to present meaningful data to the operator. See
|
||||
L<Fields Common to All Record Types> for more on these fields.
|
||||
|
||||
=fields NAME, DESC
|
||||
|
||||
=head3 Alarm Parameters
|
||||
|
||||
The Fanout record has the alarm parameters common to all record types.
|
||||
L<Alarm Fields> lists other fields related to a alarms that are common to all
|
||||
record types.
|
||||
|
||||
=head3 Run-time Parameters
|
||||
|
||||
The VAL field performs no specific function, but a Channel Access put to it will
|
||||
cause the record to process.
|
||||
|
||||
=fields VAL
|
||||
|
||||
=head2 Record Support
|
||||
|
||||
=head3 Record Support Routines
|
||||
|
||||
=head4 init_record
|
||||
|
||||
This routine initializes SELN with the value of SELL, if SELL type is CONSTANT
|
||||
link, or creates a channel access link if SELL type is PV_LINK.
|
||||
|
||||
=head4 process
|
||||
|
||||
See next section.
|
||||
|
||||
=head3 Record Processing
|
||||
|
||||
Routine process implements the following algorithm:
|
||||
|
||||
=over
|
||||
|
||||
=item 1.
|
||||
|
||||
PACT is set to TRUE.
|
||||
|
||||
=item 2.
|
||||
|
||||
The link selection SELN is fetched.
|
||||
|
||||
=item 3.
|
||||
|
||||
Depending on the selection mechanism, the link selection forward links are
|
||||
processed, and UDF is set to FALSE.
|
||||
|
||||
=item 4.
|
||||
|
||||
Check to see if monitors should be invoked:
|
||||
|
||||
=over
|
||||
|
||||
=item *
|
||||
|
||||
Alarm monitors are invoked if the alarm status or severity has changed.
|
||||
|
||||
=item *
|
||||
|
||||
NSEV and NSTA are reset to 0.
|
||||
|
||||
=back
|
||||
|
||||
=item 5.
|
||||
|
||||
Scan forward link field FLNK if used, set PACT FALSE, and return.
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
}
|
||||
@@ -100,7 +100,7 @@ struct histogramdset { /* histogram input dset */
|
||||
|
||||
/* control block for callback*/
|
||||
typedef struct myCallback {
|
||||
CALLBACK callback;
|
||||
epicsCallback callback;
|
||||
histogramRecord *prec;
|
||||
} myCallback;
|
||||
|
||||
@@ -110,7 +110,7 @@ static void monitor(histogramRecord *);
|
||||
static long readValue(histogramRecord *);
|
||||
|
||||
|
||||
static void wdogCallback(CALLBACK *arg)
|
||||
static void wdogCallback(epicsCallback *arg)
|
||||
{
|
||||
myCallback *pcallback;
|
||||
histogramRecord *prec;
|
||||
|
||||
BIN
src/std/rec/image/compress-1.png
Normal file
BIN
src/std/rec/image/compress-1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.1 KiB |
BIN
src/std/rec/image/compress-2.png
Normal file
BIN
src/std/rec/image/compress-2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.4 KiB |
@@ -1,161 +0,0 @@
|
||||
#*************************************************************************
|
||||
# Copyright (c) 2002 The University of Chicago, 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.
|
||||
#*************************************************************************
|
||||
recordtype(longin) {
|
||||
include "dbCommon.dbd"
|
||||
field(VAL,DBF_LONG) {
|
||||
prompt("Current value")
|
||||
promptgroup("40 - Input")
|
||||
asl(ASL0)
|
||||
pp(TRUE)
|
||||
}
|
||||
field(INP,DBF_INLINK) {
|
||||
prompt("Input Specification")
|
||||
promptgroup("40 - Input")
|
||||
interest(1)
|
||||
}
|
||||
field(EGU,DBF_STRING) {
|
||||
prompt("Engineering Units")
|
||||
promptgroup("80 - Display")
|
||||
interest(1)
|
||||
size(16)
|
||||
prop(YES)
|
||||
}
|
||||
field(HOPR,DBF_LONG) {
|
||||
prompt("High Operating Range")
|
||||
promptgroup("80 - Display")
|
||||
interest(1)
|
||||
prop(YES)
|
||||
}
|
||||
field(LOPR,DBF_LONG) {
|
||||
prompt("Low Operating Range")
|
||||
promptgroup("80 - Display")
|
||||
interest(1)
|
||||
prop(YES)
|
||||
}
|
||||
field(HIHI,DBF_LONG) {
|
||||
prompt("Hihi Alarm Limit")
|
||||
promptgroup("70 - Alarm")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
prop(YES)
|
||||
}
|
||||
field(LOLO,DBF_LONG) {
|
||||
prompt("Lolo Alarm Limit")
|
||||
promptgroup("70 - Alarm")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
prop(YES)
|
||||
}
|
||||
field(HIGH,DBF_LONG) {
|
||||
prompt("High Alarm Limit")
|
||||
promptgroup("70 - Alarm")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
prop(YES)
|
||||
}
|
||||
field(LOW,DBF_LONG) {
|
||||
prompt("Low Alarm Limit")
|
||||
promptgroup("70 - Alarm")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
prop(YES)
|
||||
}
|
||||
field(HHSV,DBF_MENU) {
|
||||
prompt("Hihi Severity")
|
||||
promptgroup("70 - Alarm")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(LLSV,DBF_MENU) {
|
||||
prompt("Lolo Severity")
|
||||
promptgroup("70 - Alarm")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(HSV,DBF_MENU) {
|
||||
prompt("High Severity")
|
||||
promptgroup("70 - Alarm")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(LSV,DBF_MENU) {
|
||||
prompt("Low Severity")
|
||||
promptgroup("70 - Alarm")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(HYST,DBF_LONG) {
|
||||
prompt("Alarm Deadband")
|
||||
promptgroup("70 - Alarm")
|
||||
interest(1)
|
||||
}
|
||||
field(AFTC, DBF_DOUBLE) {
|
||||
prompt("Alarm Filter Time Constant")
|
||||
promptgroup("70 - Alarm")
|
||||
interest(1)
|
||||
}
|
||||
field(AFVL, DBF_DOUBLE) {
|
||||
prompt("Alarm Filter Value")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(ADEL,DBF_LONG) {
|
||||
prompt("Archive Deadband")
|
||||
promptgroup("80 - Display")
|
||||
interest(1)
|
||||
}
|
||||
field(MDEL,DBF_LONG) {
|
||||
prompt("Monitor Deadband")
|
||||
promptgroup("80 - Display")
|
||||
interest(1)
|
||||
}
|
||||
field(LALM,DBF_LONG) {
|
||||
prompt("Last Value Alarmed")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(ALST,DBF_LONG) {
|
||||
prompt("Last Value Archived")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(MLST,DBF_LONG) {
|
||||
prompt("Last Val Monitored")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(SIOL,DBF_INLINK) {
|
||||
prompt("Sim Input Specifctn")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(1)
|
||||
}
|
||||
field(SVAL,DBF_LONG) {
|
||||
prompt("Simulation Value")
|
||||
}
|
||||
field(SIML,DBF_INLINK) {
|
||||
prompt("Sim Mode Location")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(1)
|
||||
}
|
||||
field(SIMM,DBF_MENU) {
|
||||
prompt("Simulation Mode")
|
||||
interest(1)
|
||||
menu(menuYesNo)
|
||||
}
|
||||
field(SIMS,DBF_MENU) {
|
||||
prompt("Sim mode Alarm Svrty")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(2)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
}
|
||||
458
src/std/rec/longinRecord.dbd.pod
Normal file
458
src/std/rec/longinRecord.dbd.pod
Normal file
@@ -0,0 +1,458 @@
|
||||
#*************************************************************************
|
||||
# Copyright (c) 2002 The University of Chicago, 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.
|
||||
#*************************************************************************
|
||||
|
||||
=title Long Input Record (longin)
|
||||
|
||||
The normal use for the long input record or "longin" record is to retrieve a
|
||||
long integer value of up to 32 bits. Device support routines are provided to
|
||||
support direct interfaces to hardware. In addition, the C<<< Soft Channel >>>
|
||||
device module is provided to obtain input via database or channel access links
|
||||
or via dbPutField or dbPutLink requests.
|
||||
|
||||
=recordtype longin
|
||||
|
||||
=cut
|
||||
|
||||
recordtype(longin) {
|
||||
|
||||
=head2 Parameter Fields
|
||||
|
||||
The record-specific fields are described below, grouped by functionality.
|
||||
|
||||
=head3 Scan Parameters
|
||||
|
||||
The long input record has the standard fields for specifying under what
|
||||
circumstances the record will be processed. These fields are listed in L<Scan
|
||||
Fields>. In addition, L<Scanning Specification> explains how these fields are
|
||||
used. Note that I/O event scanning is only supported for those card types
|
||||
that interrupt.
|
||||
|
||||
=head3 Read Parameters
|
||||
|
||||
The device support routines use the INP field to obtain the record's input. For
|
||||
records that obtain their input from devices, the INP field 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.
|
||||
|
||||
For soft records, the INP can be a constant, a database link, or a channel
|
||||
access link. The value is read directly into VAL. The C<<< Soft Channel >>>
|
||||
device support module is available for longin records. See L<Address
|
||||
Specification> for information on the format of hardware addresses and a
|
||||
database links.
|
||||
|
||||
=fields VAL, INP, DTYP
|
||||
|
||||
=head3 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 long input
|
||||
either textually or graphically.
|
||||
|
||||
EGU is a string of up to 16 characters describing the units that the long input
|
||||
measures. It is retrieved by the C<<< get_units >>> record support routine.
|
||||
|
||||
The HOPR and LOPR fields set the upper and lower display limits for the VAL,
|
||||
HIHI, HIGH, LOW, and LOLO fields. Both the C<<< get_graphic_double >>> and C<<<
|
||||
get_control_double >>> record support routines retrieve these fields.
|
||||
|
||||
See L<Fields Common to All Record Types> for more on the record name (NAME) and
|
||||
description (DESC) fields.
|
||||
|
||||
=fields EGU, HOPR, LOPR, NAME, DESC
|
||||
|
||||
=head3 Alarm Parameters
|
||||
|
||||
The possible alarm conditions for long inputs are the SCAN, READ, and limit
|
||||
alarms. The SCAN and READ alarms are called by the record or device support
|
||||
routines.
|
||||
|
||||
The limit alarms are configured by the user in the HIHI, LOLO, HIGH, and LOW
|
||||
fields using numerical values. For each of these fields, there is a
|
||||
corresponding severity field which can be either NO_ALARM, MINOR, or MAJOR. The
|
||||
HYST field can be used to specify a deadband around each limit. See L<Alarm
|
||||
Specification> for a complete explanation of alarms and these fields. L<Alarm
|
||||
Fields> lists other fields related to a alarms that are common to all record
|
||||
types.
|
||||
|
||||
=fields HIHI, HIGH, LOW, LOLO, HHSV, HSV, LSV, LLSV, HYST
|
||||
|
||||
=head3 Monitor Parameters
|
||||
|
||||
These parameters are used to determine when to send monitors placed on the value
|
||||
field. The monitors are sent when the value field exceeds the last monitored
|
||||
field (see the next section) by the appropriate deadband. If these fields have a
|
||||
value of zero, everytime the value changes, a monitor will be triggered; if they
|
||||
have a value of -1, everytime the record is scanned, monitors are triggered. The
|
||||
ADEL field is used by archive monitors and the MDEL field for all other types of
|
||||
monitors. See L<Monitor Specification> for a complete explanation of monitors.
|
||||
|
||||
=fields ADEL, MDEL
|
||||
|
||||
=head3 Run-time and Simulation Mode Parameters
|
||||
|
||||
The LALM, MLST, and ALST fields are used to implement the hysteresis factors for
|
||||
monitor callbacks. Only if the difference between these fields and the
|
||||
corresponding value field is greater than the appropriate delta (MDEL, ADEL,
|
||||
HYST)--only then are monitors triggered. For instance, only if the difference
|
||||
between VAL and MLST is greater than MDEL are the monitors triggered for VAL.
|
||||
|
||||
=fields LALM, ALST, MLST
|
||||
|
||||
The following fields are used to operate the long input in the simulation mode.
|
||||
See L<Fields Common to Many Record Types> for more information on these fields.
|
||||
|
||||
=fields SIOL, SVAL, SIML, SIMM, SIMS
|
||||
|
||||
=head2 Record Support
|
||||
|
||||
=head3 Record Support Routines
|
||||
|
||||
=head4 init_record
|
||||
|
||||
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 device
|
||||
support read routine is defined. If either does not exist, an error message is
|
||||
issued and processing is terminated.
|
||||
|
||||
If device support includes C<init_record()>, it is called.
|
||||
|
||||
=head4 process
|
||||
|
||||
See next section.
|
||||
|
||||
=head4 get_units
|
||||
|
||||
Retrieves EGU.
|
||||
|
||||
=head4 get_graphic_double
|
||||
|
||||
Sets the upper display and lower display limits for a field. If the field is
|
||||
VAL, HIHI, HIGH, LOW, or LOLO, the limits are set to HOPR and LOPR, else if the
|
||||
field has upper and lower limits defined they will be used, else the upper and
|
||||
lower maximum values for the field type will be used.
|
||||
|
||||
=head4 get_control_double
|
||||
|
||||
Sets the upper control and the lower control limits for a field. If the field is
|
||||
VAL, HIHI, HIGH, LOW, or LOLO, the limits are set to HOPR and LOPR, else if the
|
||||
field has upper and lower limits defined they will be used, else the upper and
|
||||
lower maximum values for the field type will be used.
|
||||
|
||||
=head4 get_alarm_double
|
||||
|
||||
Sets the following values:
|
||||
|
||||
upper_alarm_limit = HIHI
|
||||
upper_warning_limit = HIGH
|
||||
lower_warning_limit = LOW
|
||||
lower_alarm_limit = LOLO
|
||||
|
||||
=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<Input Records> for more information.
|
||||
|
||||
=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.
|
||||
|
||||
Check alarms. This routine checks to see if the new VAL causes the alarm status
|
||||
and severity to change. If so, NSEV, NSTA and LALM are set. It also honors the
|
||||
alarm hysteresis factor (HYST). Thus the value must change by more than HYST
|
||||
before the alarm status and severity is lowered.
|
||||
|
||||
=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 ADEL and MDEL conditions are
|
||||
met.
|
||||
|
||||
=item *
|
||||
|
||||
NSEV and NSTA are reset to 0.
|
||||
|
||||
=back
|
||||
|
||||
=item 6.
|
||||
|
||||
Scan forward link if necessary, set PACT FALSE, and return.
|
||||
|
||||
=back
|
||||
|
||||
=begin html
|
||||
|
||||
<br><hr><br>
|
||||
|
||||
=end html
|
||||
|
||||
=head2 Device Support
|
||||
|
||||
=head3 Fields Of Interest To Device Support
|
||||
|
||||
Each long input record must have an associated set of device support routines.
|
||||
The primary responsibility of the device support routines is to obtain a new
|
||||
input value whenever read_longin is called. The device support routines are
|
||||
primarily interested in the following fields:
|
||||
|
||||
=fields PACT, DPVT, UDF, NSEV, NSTA, VAL, INP
|
||||
|
||||
=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<dbior> 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<level> 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<init_record()> calls are made, with
|
||||
the integer parameter C<after> set to 0.
|
||||
The second call happens after all of the C<init_record()> calls have been made,
|
||||
with C<after> set to 1.
|
||||
|
||||
=head4 init_record
|
||||
|
||||
init_record(precord)
|
||||
|
||||
This routine is optional. If provided, it is called by the record support
|
||||
C<init_record()> routine.
|
||||
|
||||
=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 read_longin
|
||||
|
||||
read_longin(precord)
|
||||
|
||||
This routine must provide a new input value. It returns the following values:
|
||||
|
||||
=over
|
||||
|
||||
=item *
|
||||
|
||||
0: Success. A new value is placed in VAL.
|
||||
|
||||
=item *
|
||||
|
||||
Other: Error.
|
||||
|
||||
=back
|
||||
|
||||
=head3 Device Support For Soft Records
|
||||
|
||||
The C<<< Soft Channel >>> device support module places a value directly in VAL.
|
||||
|
||||
If the INP link type is constant, then the constant value is stored into VAL by
|
||||
C<init_record()>, and UDF is set to FALSE. If the INP link type is PV_LINK, then
|
||||
dbCaAddInlink is called by C<init_record()>.
|
||||
|
||||
C<<< read_longin >>> calls recGblGetLinkValue to read the current value of VAL.
|
||||
See L<Soft Input> for more information
|
||||
|
||||
If the return status of C<<< recGblGetLinkValue >>> is zero then read_longin
|
||||
sets UDF to FALSE. read_longin returns the status of C<recGblGetLinkValue>.
|
||||
|
||||
|
||||
=cut
|
||||
|
||||
include "dbCommon.dbd"
|
||||
field(VAL,DBF_LONG) {
|
||||
prompt("Current value")
|
||||
promptgroup("40 - Input")
|
||||
asl(ASL0)
|
||||
pp(TRUE)
|
||||
}
|
||||
field(INP,DBF_INLINK) {
|
||||
prompt("Input Specification")
|
||||
promptgroup("40 - Input")
|
||||
interest(1)
|
||||
}
|
||||
field(EGU,DBF_STRING) {
|
||||
prompt("Engineering Units")
|
||||
promptgroup("80 - Display")
|
||||
interest(1)
|
||||
size(16)
|
||||
prop(YES)
|
||||
}
|
||||
field(HOPR,DBF_LONG) {
|
||||
prompt("High Operating Range")
|
||||
promptgroup("80 - Display")
|
||||
interest(1)
|
||||
prop(YES)
|
||||
}
|
||||
field(LOPR,DBF_LONG) {
|
||||
prompt("Low Operating Range")
|
||||
promptgroup("80 - Display")
|
||||
interest(1)
|
||||
prop(YES)
|
||||
}
|
||||
field(HIHI,DBF_LONG) {
|
||||
prompt("Hihi Alarm Limit")
|
||||
promptgroup("70 - Alarm")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
prop(YES)
|
||||
}
|
||||
field(LOLO,DBF_LONG) {
|
||||
prompt("Lolo Alarm Limit")
|
||||
promptgroup("70 - Alarm")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
prop(YES)
|
||||
}
|
||||
field(HIGH,DBF_LONG) {
|
||||
prompt("High Alarm Limit")
|
||||
promptgroup("70 - Alarm")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
prop(YES)
|
||||
}
|
||||
field(LOW,DBF_LONG) {
|
||||
prompt("Low Alarm Limit")
|
||||
promptgroup("70 - Alarm")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
prop(YES)
|
||||
}
|
||||
field(HHSV,DBF_MENU) {
|
||||
prompt("Hihi Severity")
|
||||
promptgroup("70 - Alarm")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(LLSV,DBF_MENU) {
|
||||
prompt("Lolo Severity")
|
||||
promptgroup("70 - Alarm")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(HSV,DBF_MENU) {
|
||||
prompt("High Severity")
|
||||
promptgroup("70 - Alarm")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(LSV,DBF_MENU) {
|
||||
prompt("Low Severity")
|
||||
promptgroup("70 - Alarm")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(HYST,DBF_LONG) {
|
||||
prompt("Alarm Deadband")
|
||||
promptgroup("70 - Alarm")
|
||||
interest(1)
|
||||
}
|
||||
field(AFTC, DBF_DOUBLE) {
|
||||
prompt("Alarm Filter Time Constant")
|
||||
promptgroup("70 - Alarm")
|
||||
interest(1)
|
||||
}
|
||||
field(AFVL, DBF_DOUBLE) {
|
||||
prompt("Alarm Filter Value")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(ADEL,DBF_LONG) {
|
||||
prompt("Archive Deadband")
|
||||
promptgroup("80 - Display")
|
||||
interest(1)
|
||||
}
|
||||
field(MDEL,DBF_LONG) {
|
||||
prompt("Monitor Deadband")
|
||||
promptgroup("80 - Display")
|
||||
interest(1)
|
||||
}
|
||||
field(LALM,DBF_LONG) {
|
||||
prompt("Last Value Alarmed")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(ALST,DBF_LONG) {
|
||||
prompt("Last Value Archived")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(MLST,DBF_LONG) {
|
||||
prompt("Last Val Monitored")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(SIOL,DBF_INLINK) {
|
||||
prompt("Sim Input Specifctn")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(1)
|
||||
}
|
||||
field(SVAL,DBF_LONG) {
|
||||
prompt("Simulation Value")
|
||||
}
|
||||
field(SIML,DBF_INLINK) {
|
||||
prompt("Sim Mode Location")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(1)
|
||||
}
|
||||
field(SIMM,DBF_MENU) {
|
||||
prompt("Simulation Mode")
|
||||
interest(1)
|
||||
menu(menuYesNo)
|
||||
}
|
||||
field(SIMS,DBF_MENU) {
|
||||
prompt("Sim mode Alarm Svrty")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(2)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
}
|
||||
@@ -1,184 +0,0 @@
|
||||
#*************************************************************************
|
||||
# Copyright (c) 2002 The University of Chicago, 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.
|
||||
#*************************************************************************
|
||||
recordtype(longout) {
|
||||
include "dbCommon.dbd"
|
||||
field(VAL,DBF_LONG) {
|
||||
prompt("Desired Output")
|
||||
promptgroup("50 - Output")
|
||||
asl(ASL0)
|
||||
pp(TRUE)
|
||||
}
|
||||
field(OUT,DBF_OUTLINK) {
|
||||
prompt("Output Specification")
|
||||
promptgroup("50 - Output")
|
||||
interest(1)
|
||||
}
|
||||
field(DOL,DBF_INLINK) {
|
||||
prompt("Desired Output Loc")
|
||||
promptgroup("40 - Input")
|
||||
interest(1)
|
||||
}
|
||||
field(OMSL,DBF_MENU) {
|
||||
prompt("Output Mode Select")
|
||||
promptgroup("50 - Output")
|
||||
interest(1)
|
||||
menu(menuOmsl)
|
||||
}
|
||||
field(EGU,DBF_STRING) {
|
||||
prompt("Engineering Units")
|
||||
promptgroup("80 - Display")
|
||||
interest(1)
|
||||
size(16)
|
||||
prop(YES)
|
||||
}
|
||||
field(DRVH,DBF_LONG) {
|
||||
prompt("Drive High Limit")
|
||||
promptgroup("30 - Action")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
prop(YES)
|
||||
}
|
||||
field(DRVL,DBF_LONG) {
|
||||
prompt("Drive Low Limit")
|
||||
promptgroup("30 - Action")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
prop(YES)
|
||||
}
|
||||
field(HOPR,DBF_LONG) {
|
||||
prompt("High Operating Range")
|
||||
promptgroup("80 - Display")
|
||||
interest(1)
|
||||
prop(YES)
|
||||
}
|
||||
field(LOPR,DBF_LONG) {
|
||||
prompt("Low Operating Range")
|
||||
promptgroup("80 - Display")
|
||||
interest(1)
|
||||
prop(YES)
|
||||
}
|
||||
field(HIHI,DBF_LONG) {
|
||||
prompt("Hihi Alarm Limit")
|
||||
promptgroup("70 - Alarm")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
prop(YES)
|
||||
}
|
||||
field(LOLO,DBF_LONG) {
|
||||
prompt("Lolo Alarm Limit")
|
||||
promptgroup("70 - Alarm")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
prop(YES)
|
||||
}
|
||||
field(HIGH,DBF_LONG) {
|
||||
prompt("High Alarm Limit")
|
||||
promptgroup("70 - Alarm")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
prop(YES)
|
||||
}
|
||||
field(LOW,DBF_LONG) {
|
||||
prompt("Low Alarm Limit")
|
||||
promptgroup("70 - Alarm")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
prop(YES)
|
||||
}
|
||||
field(HHSV,DBF_MENU) {
|
||||
prompt("Hihi Severity")
|
||||
promptgroup("70 - Alarm")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(LLSV,DBF_MENU) {
|
||||
prompt("Lolo Severity")
|
||||
promptgroup("70 - Alarm")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(HSV,DBF_MENU) {
|
||||
prompt("High Severity")
|
||||
promptgroup("70 - Alarm")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(LSV,DBF_MENU) {
|
||||
prompt("Low Severity")
|
||||
promptgroup("70 - Alarm")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(HYST,DBF_LONG) {
|
||||
prompt("Alarm Deadband")
|
||||
promptgroup("70 - Alarm")
|
||||
interest(1)
|
||||
}
|
||||
field(ADEL,DBF_LONG) {
|
||||
prompt("Archive Deadband")
|
||||
promptgroup("80 - Display")
|
||||
interest(1)
|
||||
}
|
||||
field(MDEL,DBF_LONG) {
|
||||
prompt("Monitor Deadband")
|
||||
promptgroup("80 - Display")
|
||||
interest(1)
|
||||
}
|
||||
field(LALM,DBF_LONG) {
|
||||
prompt("Last Value Alarmed")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(ALST,DBF_LONG) {
|
||||
prompt("Last Value Archived")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(MLST,DBF_LONG) {
|
||||
prompt("Last Val Monitored")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(SIOL,DBF_OUTLINK) {
|
||||
prompt("Sim Output Specifctn")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(1)
|
||||
}
|
||||
field(SIML,DBF_INLINK) {
|
||||
prompt("Sim Mode Location")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(1)
|
||||
}
|
||||
field(SIMM,DBF_MENU) {
|
||||
prompt("Simulation Mode")
|
||||
interest(1)
|
||||
menu(menuYesNo)
|
||||
}
|
||||
field(SIMS,DBF_MENU) {
|
||||
prompt("Sim mode Alarm Svrty")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(2)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(IVOA,DBF_MENU) {
|
||||
prompt("INVALID output action")
|
||||
promptgroup("50 - Output")
|
||||
interest(2)
|
||||
menu(menuIvoa)
|
||||
}
|
||||
field(IVOV,DBF_LONG) {
|
||||
prompt("INVALID output value")
|
||||
promptgroup("50 - Output")
|
||||
interest(2)
|
||||
}
|
||||
}
|
||||
562
src/std/rec/longoutRecord.dbd.pod
Normal file
562
src/std/rec/longoutRecord.dbd.pod
Normal file
@@ -0,0 +1,562 @@
|
||||
#*************************************************************************
|
||||
# Copyright (c) 2002 The University of Chicago, 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.
|
||||
#*************************************************************************
|
||||
|
||||
=title Long Output Record (longout)
|
||||
|
||||
The normal use for the long output or "longout" record type is to store long
|
||||
integer values of up to 32 bits and write them to hardware devices. The C<<<
|
||||
Soft Channel >>> device support layer can also be used to write values to
|
||||
other records via database or channel access links. The OUT field determines how
|
||||
the record is used. The record supports alarm limits and graphics and control
|
||||
limits.
|
||||
|
||||
=recordtype longout
|
||||
|
||||
=cut
|
||||
|
||||
recordtype(longout) {
|
||||
|
||||
=head2 Parameter Fields
|
||||
|
||||
The fields in this record fall into the following categories:
|
||||
|
||||
=over
|
||||
|
||||
=item * L<Scan Parameters>
|
||||
|
||||
=item * L<Desired Output Parameters>
|
||||
|
||||
=item * L<Write Parameters>
|
||||
|
||||
=item * L<Operator Display Parameters>
|
||||
|
||||
=item * L<Alarm Parameters>
|
||||
|
||||
=item * L<Monitor Parameters>
|
||||
|
||||
=item * L<Simulation Mode Parameters>
|
||||
|
||||
=back
|
||||
|
||||
=head3 Scan Parameters
|
||||
|
||||
The longout record has the standard fields for specifying under what
|
||||
circumstances it will be processed. These fields are listed in L<Scan Fields>.
|
||||
In addition, L<Scanning Specification> 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 record must specify where the desired output originates, i.e., the 32 bit
|
||||
integer value it is to write. The output mode select (OMSL) field 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 desired output can be written into the VAL field via dpPuts
|
||||
at run-time.
|
||||
|
||||
A third type of value for the DOL field is a constant in which case, when the
|
||||
record is initialized, the VAL field will be initialized with this constant
|
||||
value.
|
||||
|
||||
The VAL field's value will be clipped within limits specified in the fields DRVH
|
||||
and DRVL if these have been configured by the database designer:
|
||||
|
||||
DRVL <= VAL <= DRVH
|
||||
|
||||
Note: These limits are only enforced as long as DRVH E<gt> DRVL. If they are not
|
||||
set or DRVH E<lt>= DRVL they will not be used.
|
||||
|
||||
=fields DOL, OMSL, DRVH, DRVL, VAL
|
||||
|
||||
=head3 Write Parameters
|
||||
|
||||
The OUT link field determines where the record is to send its output. For
|
||||
records that write values to hardware devices, the OUT output link field must
|
||||
specify the address of the I/O card, and the DTYP field must specify the
|
||||
name of the corresponding device support module.
|
||||
|
||||
For soft records, the OUT output link can be a constant, a database link, or a
|
||||
channel access link. If the link is a constant, the result is no output. The
|
||||
DTYP field must then specify the C<<< Soft Channel >>> device support routine.
|
||||
|
||||
See L<Address Specification> for information on the format of hardware addresses
|
||||
and database links.
|
||||
|
||||
=fields OUT, DTYP
|
||||
|
||||
=cut
|
||||
|
||||
include "dbCommon.dbd"
|
||||
field(VAL,DBF_LONG) {
|
||||
prompt("Desired Output")
|
||||
promptgroup("50 - Output")
|
||||
asl(ASL0)
|
||||
pp(TRUE)
|
||||
}
|
||||
field(OUT,DBF_OUTLINK) {
|
||||
prompt("Output Specification")
|
||||
promptgroup("50 - Output")
|
||||
interest(1)
|
||||
}
|
||||
field(DOL,DBF_INLINK) {
|
||||
prompt("Desired Output Loc")
|
||||
promptgroup("40 - Input")
|
||||
interest(1)
|
||||
}
|
||||
field(OMSL,DBF_MENU) {
|
||||
prompt("Output Mode Select")
|
||||
promptgroup("50 - Output")
|
||||
interest(1)
|
||||
menu(menuOmsl)
|
||||
}
|
||||
|
||||
=head3 Operator Display Parameters
|
||||
|
||||
These parameters are used to present meaningful data to the operator. They
|
||||
display the value and other parameters of the long output either textually or
|
||||
graphically.
|
||||
|
||||
EGU is a string of up to 16 characters describing the units that the long output
|
||||
measures. It is retrieved by the C<<< get_units >>> record support routine.
|
||||
|
||||
The HOPR and LOPR fields set the upper and lower display limits for the VAL,
|
||||
HIHI, HIGH, LOW, and LOLO fields. Both the C<<< get_graphic_double >>> and C<<<
|
||||
get_control_double >>> record support routines retrieve these fields.
|
||||
|
||||
See L<Fields Common to All Record Types> for more on the record name (NAME) and
|
||||
description (DESC) fields.
|
||||
|
||||
=fields EGU, HOPR, LOPR, NAME, DESC
|
||||
|
||||
=cut
|
||||
|
||||
field(EGU,DBF_STRING) {
|
||||
prompt("Engineering Units")
|
||||
promptgroup("80 - Display")
|
||||
interest(1)
|
||||
size(16)
|
||||
prop(YES)
|
||||
}
|
||||
field(DRVH,DBF_LONG) {
|
||||
prompt("Drive High Limit")
|
||||
promptgroup("30 - Action")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
prop(YES)
|
||||
}
|
||||
field(DRVL,DBF_LONG) {
|
||||
prompt("Drive Low Limit")
|
||||
promptgroup("30 - Action")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
prop(YES)
|
||||
}
|
||||
field(HOPR,DBF_LONG) {
|
||||
prompt("High Operating Range")
|
||||
promptgroup("80 - Display")
|
||||
interest(1)
|
||||
prop(YES)
|
||||
}
|
||||
field(LOPR,DBF_LONG) {
|
||||
prompt("Low Operating Range")
|
||||
promptgroup("80 - Display")
|
||||
interest(1)
|
||||
prop(YES)
|
||||
}
|
||||
|
||||
=head3 Alarm Parameters
|
||||
|
||||
The possible alarm conditions for long inputs are the SCAN, READ, INVALID, and
|
||||
limit alarms. The SCAN and READ alarms are not configurable by the user because
|
||||
their severity is always MAJOR. The INVALID alarm is called by the record
|
||||
support routine when the record or device support routines cannot write the
|
||||
record's output. The IVOA field specifies the action to take in this case.
|
||||
|
||||
The limit alarms are configured by the user in the HIHI, LOLO, HIGH, and LOW
|
||||
fields using floating-point values. For each of these fields, there is a
|
||||
corresponding severity field which can be either NO_ALARM, MINOR, or MAJOR. The
|
||||
HYST field contains the alarm deadband around each limit alarm.
|
||||
|
||||
See the See L<Alarm Specification> for a complete explanation of alarms and
|
||||
these fields. For an explanation of the IVOA and IVOV fields, see L<Output
|
||||
Records>. L<Alarm Fields> lists other fields related to a alarms that are common
|
||||
to all record types.
|
||||
|
||||
=fields HIHI, HIGH, LOW, LOLO, HHSV, HSV, LSV, LLSV, HYST, IVOA, IVOV
|
||||
|
||||
=cut
|
||||
|
||||
field(HIHI,DBF_LONG) {
|
||||
prompt("Hihi Alarm Limit")
|
||||
promptgroup("70 - Alarm")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
prop(YES)
|
||||
}
|
||||
field(LOLO,DBF_LONG) {
|
||||
prompt("Lolo Alarm Limit")
|
||||
promptgroup("70 - Alarm")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
prop(YES)
|
||||
}
|
||||
field(HIGH,DBF_LONG) {
|
||||
prompt("High Alarm Limit")
|
||||
promptgroup("70 - Alarm")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
prop(YES)
|
||||
}
|
||||
field(LOW,DBF_LONG) {
|
||||
prompt("Low Alarm Limit")
|
||||
promptgroup("70 - Alarm")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
prop(YES)
|
||||
}
|
||||
field(HHSV,DBF_MENU) {
|
||||
prompt("Hihi Severity")
|
||||
promptgroup("70 - Alarm")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(LLSV,DBF_MENU) {
|
||||
prompt("Lolo Severity")
|
||||
promptgroup("70 - Alarm")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(HSV,DBF_MENU) {
|
||||
prompt("High Severity")
|
||||
promptgroup("70 - Alarm")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(LSV,DBF_MENU) {
|
||||
prompt("Low Severity")
|
||||
promptgroup("70 - Alarm")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(HYST,DBF_LONG) {
|
||||
prompt("Alarm Deadband")
|
||||
promptgroup("70 - Alarm")
|
||||
interest(1)
|
||||
}
|
||||
|
||||
=head3 Monitor Parameters
|
||||
|
||||
These parameters are used to determine when to send monitors placed on the value
|
||||
field. The monitors are sent when the value field exceeds the last monitored
|
||||
field by the appropriate delta. If these fields have a value of zero, everytime
|
||||
the value changes, a monitor will be triggered; if they have a value of -1,
|
||||
everytime the record is scanned, monitors are triggered. The ADEL field is the
|
||||
delta for archive monitors, and the MDEL field is the delta for all other types
|
||||
of monitors. See L<Monitor Specification> for a complete explanation of
|
||||
monitors.
|
||||
|
||||
=fields ADEL, MDEL
|
||||
|
||||
=cut
|
||||
|
||||
field(ADEL,DBF_LONG) {
|
||||
prompt("Archive Deadband")
|
||||
promptgroup("80 - Display")
|
||||
interest(1)
|
||||
}
|
||||
field(MDEL,DBF_LONG) {
|
||||
prompt("Monitor Deadband")
|
||||
promptgroup("80 - Display")
|
||||
interest(1)
|
||||
}
|
||||
field(LALM,DBF_LONG) {
|
||||
prompt("Last Value Alarmed")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(ALST,DBF_LONG) {
|
||||
prompt("Last Value Archived")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(MLST,DBF_LONG) {
|
||||
prompt("Last Val Monitored")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
|
||||
=head3 Run-time and Simulation Mode Parameters
|
||||
|
||||
The LALM, MLST, and ALST fields are used to implement the hysteresis factors for
|
||||
monitor callbacks. Only if the difference between these fields and the
|
||||
corresponding value field is greater than the appropriate delta (MDEL, ADEL,
|
||||
HYST)--only then are monitors triggered. For instance, only if the difference
|
||||
between VAL and MLST is greater than MDEL are the monitors triggered for VAL.
|
||||
|
||||
=fields LALM, ALST, MLST
|
||||
|
||||
The following fields are used to operate the long output in the simulation mode.
|
||||
See L<Fields Common to Many Record Types> for more information on the simulation
|
||||
mode fields
|
||||
|
||||
=fields SIOL, SIML, SIMM, SIMS
|
||||
|
||||
=cut
|
||||
|
||||
field(SIOL,DBF_OUTLINK) {
|
||||
prompt("Sim Output Specifctn")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(1)
|
||||
}
|
||||
field(SIML,DBF_INLINK) {
|
||||
prompt("Sim Mode Location")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(1)
|
||||
}
|
||||
field(SIMM,DBF_MENU) {
|
||||
prompt("Simulation Mode")
|
||||
interest(1)
|
||||
menu(menuYesNo)
|
||||
}
|
||||
field(SIMS,DBF_MENU) {
|
||||
prompt("Sim mode Alarm Svrty")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(2)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(IVOA,DBF_MENU) {
|
||||
prompt("INVALID output action")
|
||||
promptgroup("50 - Output")
|
||||
interest(2)
|
||||
menu(menuIvoa)
|
||||
}
|
||||
field(IVOV,DBF_LONG) {
|
||||
prompt("INVALID output value")
|
||||
promptgroup("50 - Output")
|
||||
interest(2)
|
||||
}
|
||||
|
||||
|
||||
=begin html
|
||||
|
||||
<br><hr><br>
|
||||
|
||||
=end html
|
||||
|
||||
=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. If DOL type is a PV_LINK then dbCaAddInlink is called to create a channel
|
||||
access link.
|
||||
|
||||
If device support includes C<init_record()>, it is called.
|
||||
|
||||
=head4 process
|
||||
|
||||
See next section.
|
||||
|
||||
=head4 get_units
|
||||
|
||||
Retrieves EGU.
|
||||
|
||||
=head4 get_graphic_double
|
||||
|
||||
Sets the upper display and lower display limits for a field. If the field is
|
||||
VAL, HIHI, HIGH, LOW, or LOLO, the limits are set to HOPR and LOPR, else if the
|
||||
field has upper and lower limits defined they will be used, else the upper and
|
||||
lower maximum values for the field type will be used.
|
||||
|
||||
=head4 get_control_double
|
||||
|
||||
Sets the upper control and the lower control limits for a field. If the field is
|
||||
VAL, HIHI, HIGH, LOW, or LOLO, the limits are set to HOPR and LOPR, else if the
|
||||
field has upper and lower limits defined they will be used, else the upper and
|
||||
lower maximum values for the field type will be used.
|
||||
|
||||
=head4 get_alarm_double
|
||||
|
||||
Sets the following values:
|
||||
|
||||
upper_alarm_limit = HIHI
|
||||
upper_warning_limit = HIGH
|
||||
lower_warning_limit = LOW
|
||||
lower_alarm_limit = LOLO
|
||||
|
||||
|
||||
=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 and OMSL is CLOSED_LOOP recGblGetLinkValue is called to read
|
||||
the current value of VAL. See L<Output Records> for more information. If the
|
||||
return status of recGblGetLinkValue is zero then UDF is set to FALSE.
|
||||
|
||||
=item 3.
|
||||
|
||||
Check alarms. This routine checks to see if the new VAL causes the alarm status
|
||||
and severity to change. If so, NSEV, NSTA and LALM are set. It also honors the
|
||||
alarm hysteresis factor (HYST). Thus the value must change by more than HYST
|
||||
before the alarm status and severity is lowered.
|
||||
|
||||
=item 4.
|
||||
|
||||
Check severity and write the new value. See L<Invalid Alarm Output Action> for
|
||||
information on how INVALID alarms affect output records.
|
||||
|
||||
=item 5.
|
||||
|
||||
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 6.
|
||||
|
||||
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 ADEL and MDEL conditions are
|
||||
met.
|
||||
|
||||
=item *
|
||||
|
||||
NSEV and NSTA are reset to 0.
|
||||
|
||||
=back
|
||||
|
||||
=item 7.
|
||||
|
||||
Scan forward link if necessary, set PACT FALSE, and return.
|
||||
|
||||
=back
|
||||
|
||||
=begin html
|
||||
|
||||
<br><hr><br>
|
||||
|
||||
=end html
|
||||
|
||||
=head2 Device Support
|
||||
|
||||
=head3 Fields Of Interest To Device Support
|
||||
|
||||
Each long output record must have an associated set of device support routines.
|
||||
The primary responsibility of the device support routines is to output a new
|
||||
value whenever write_longout is called. The device support routines are
|
||||
primarily interested in the following fields:
|
||||
|
||||
=fields PACT, DPVT, NSEV, NSTA, OUT
|
||||
|
||||
=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<dbior> 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<level> 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<init_record()> calls are made, with
|
||||
the integer parameter C<after> set to 0.
|
||||
The second call happens after all of the C<init_record()> calls have been made,
|
||||
with C<after> set to 1.
|
||||
|
||||
=head4 init_record
|
||||
|
||||
init_record(precord)
|
||||
|
||||
This routine is optional. If provided, it is called by the record support
|
||||
C<init_record()> routine.
|
||||
|
||||
=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_longout
|
||||
|
||||
write_longout(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
|
||||
|
||||
The C<<< Soft Channel >>> module writes the current value of VAL.
|
||||
|
||||
If the OUT link type is PV_LINK, then dbCaAddInlink is called by
|
||||
C<init_record()>.
|
||||
|
||||
write_longout calls recGblPutLinkValue to write the current value of VAL.
|
||||
|
||||
See L<Soft Output> for a further explanation.
|
||||
|
||||
=cut
|
||||
|
||||
} #end of the DBD file
|
||||
@@ -1,156 +0,0 @@
|
||||
#*************************************************************************
|
||||
# Copyright (c) 2002 The University of Chicago, 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.
|
||||
#*************************************************************************
|
||||
recordtype(mbbiDirect) {
|
||||
include "dbCommon.dbd"
|
||||
field(VAL,DBF_USHORT) {
|
||||
prompt("Current Value")
|
||||
promptgroup("40 - Input")
|
||||
asl(ASL0)
|
||||
pp(TRUE)
|
||||
}
|
||||
field(NOBT,DBF_SHORT) {
|
||||
prompt("Number of Bits")
|
||||
promptgroup("40 - Input")
|
||||
special(SPC_NOMOD)
|
||||
interest(1)
|
||||
}
|
||||
field(INP,DBF_INLINK) {
|
||||
prompt("Input Specification")
|
||||
promptgroup("40 - Input")
|
||||
interest(1)
|
||||
}
|
||||
field(RVAL,DBF_ULONG) {
|
||||
prompt("Raw Value")
|
||||
pp(TRUE)
|
||||
}
|
||||
field(ORAW,DBF_ULONG) {
|
||||
prompt("Prev Raw Value")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(MASK,DBF_ULONG) {
|
||||
prompt("Hardware Mask")
|
||||
special(SPC_NOMOD)
|
||||
interest(1)
|
||||
}
|
||||
field(MLST,DBF_USHORT) {
|
||||
prompt("Last Value Monitored")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(SHFT,DBF_USHORT) {
|
||||
prompt("Shift")
|
||||
promptgroup("40 - Input")
|
||||
interest(1)
|
||||
}
|
||||
field(SIOL,DBF_INLINK) {
|
||||
prompt("Sim Input Specifctn")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(1)
|
||||
}
|
||||
field(SVAL,DBF_ULONG) {
|
||||
prompt("Simulation Value")
|
||||
}
|
||||
field(SIML,DBF_INLINK) {
|
||||
prompt("Sim Mode Location")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(1)
|
||||
}
|
||||
field(SIMM,DBF_MENU) {
|
||||
prompt("Simulation Mode")
|
||||
interest(1)
|
||||
menu(menuSimm)
|
||||
}
|
||||
field(SIMS,DBF_MENU) {
|
||||
prompt("Sim mode Alarm Svrty")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(2)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(B0,DBF_UCHAR) {
|
||||
prompt("Bit 0")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
}
|
||||
field(B1,DBF_UCHAR) {
|
||||
prompt("Bit 1")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
}
|
||||
field(B2,DBF_UCHAR) {
|
||||
prompt("Bit 2")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
}
|
||||
field(B3,DBF_UCHAR) {
|
||||
prompt("Bit 3")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
}
|
||||
field(B4,DBF_UCHAR) {
|
||||
prompt("Bit 4")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
}
|
||||
field(B5,DBF_UCHAR) {
|
||||
prompt("Bit 5")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
}
|
||||
field(B6,DBF_UCHAR) {
|
||||
prompt("Bit 6")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
}
|
||||
field(B7,DBF_UCHAR) {
|
||||
prompt("Bit 7")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
}
|
||||
field(B8,DBF_UCHAR) {
|
||||
prompt("Bit 8")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
}
|
||||
field(B9,DBF_UCHAR) {
|
||||
prompt("Bit 9")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
}
|
||||
field(BA,DBF_UCHAR) {
|
||||
prompt("Bit A")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
}
|
||||
field(BB,DBF_UCHAR) {
|
||||
prompt("Bit B")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
}
|
||||
field(BC,DBF_UCHAR) {
|
||||
prompt("Bit C")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
}
|
||||
field(BD,DBF_UCHAR) {
|
||||
prompt("Bit D")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
}
|
||||
field(BE,DBF_UCHAR) {
|
||||
prompt("Bit E")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
}
|
||||
field(BF,DBF_UCHAR) {
|
||||
prompt("Bit F")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
}
|
||||
}
|
||||
480
src/std/rec/mbbiDirectRecord.dbd.pod
Normal file
480
src/std/rec/mbbiDirectRecord.dbd.pod
Normal file
@@ -0,0 +1,480 @@
|
||||
#*************************************************************************
|
||||
# Copyright (c) 2002 The University of Chicago, 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.
|
||||
#*************************************************************************
|
||||
|
||||
=title Multi-Bit Binary Input Direct Record (mbbiDirect)
|
||||
|
||||
The mbbiDirect record retrieves a sixteen-bit hardware value and converts it to
|
||||
an array of sixteen unsigned characters, each representing a bit of the word.
|
||||
These fields (B0-B9, BA-BF) are set to 1 if a bit is set, and 0 if not.
|
||||
|
||||
This record's operation is similar to that of the multi-bit binary input record,
|
||||
and it has many fields in common with it. This record also has two available
|
||||
soft device support modules: C<Soft Channel> and C<Raw Soft Channel>.
|
||||
|
||||
=recordtype mbbiDirect
|
||||
|
||||
=cut
|
||||
|
||||
recordtype(mbbiDirect) {
|
||||
|
||||
=head2 Parameter Fields
|
||||
|
||||
The record-specific fields are described below, grouped by functionality.
|
||||
|
||||
=head3 Scan Parameters
|
||||
|
||||
The mbbiDirect record has the standard fields for specifying under what
|
||||
circumstances the record will be processed. These fields are listed in L<Scan
|
||||
Fields>. In addition, L<Scanning Specification> explains how these fields are
|
||||
used. Note that I/O event scanning is only supported for those card types
|
||||
that interrupt.
|
||||
|
||||
=head3 Read and Convert Parameters
|
||||
|
||||
The device support routines obtain the record's input from the device or link
|
||||
specified in the INP field. For records that obtain their input from devices,
|
||||
the INP field 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<Address Specification> for
|
||||
information on the format of hardware addresses.
|
||||
|
||||
Two soft device support modules can be specified in DTYP C<Soft Channel> and
|
||||
C<<< Raw Soft Channel >>>.
|
||||
|
||||
C<<< Raw Soft Channel >>> reads the value into RVAL,
|
||||
upon which the normal conversion process is undergone. C<<< Soft Channel >>>
|
||||
reads any unsigned integer directly into VAL. For a soft mbbiDirect record, the
|
||||
INP field can be a constant, a database, or a channel access link. If INP is a
|
||||
constant, then the VAL is initialized to the INP value but can be changed at
|
||||
run-time via dbPutField or dbPutLink. See L<Address Specification> for
|
||||
information on how to database links.
|
||||
|
||||
For records that don't use C<<< Soft Channel >>> device support, RVAL is used to
|
||||
determine VAL as follows:
|
||||
|
||||
=over
|
||||
|
||||
=item 1. RVAL is assigned to a temporary variable I<rval> = RVAL
|
||||
|
||||
=item 2. I<rval> is shifted right SHFT number of bits.
|
||||
|
||||
=item 3. VAL is set equal to I<rval>.
|
||||
|
||||
=back
|
||||
|
||||
Each of the fields, B0-BF, represents one bit of the word.
|
||||
|
||||
=fields VAL, INP, RVAL, SHFT, B0, B1, B2, B3, B4, B5, B6, B7, B8, B9, BA, BB, BC, BD, BE, BF
|
||||
|
||||
=head3 Operator Display Parameters
|
||||
|
||||
These parameters are used to present meaningful data to the operator.
|
||||
|
||||
See L<Fields Common to All Record Types> for more on the record name (NAME) and
|
||||
description (DESC) fields.
|
||||
|
||||
=fields NAME, DESC
|
||||
|
||||
=cut
|
||||
|
||||
include "dbCommon.dbd"
|
||||
field(VAL,DBF_USHORT) {
|
||||
prompt("Current Value")
|
||||
promptgroup("40 - Input")
|
||||
asl(ASL0)
|
||||
pp(TRUE)
|
||||
}
|
||||
field(NOBT,DBF_SHORT) {
|
||||
prompt("Number of Bits")
|
||||
promptgroup("40 - Input")
|
||||
special(SPC_NOMOD)
|
||||
interest(1)
|
||||
}
|
||||
field(INP,DBF_INLINK) {
|
||||
prompt("Input Specification")
|
||||
promptgroup("40 - Input")
|
||||
interest(1)
|
||||
}
|
||||
field(RVAL,DBF_ULONG) {
|
||||
prompt("Raw Value")
|
||||
pp(TRUE)
|
||||
}
|
||||
field(ORAW,DBF_ULONG) {
|
||||
prompt("Prev Raw Value")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(MASK,DBF_ULONG) {
|
||||
prompt("Hardware Mask")
|
||||
special(SPC_NOMOD)
|
||||
interest(1)
|
||||
}
|
||||
field(MLST,DBF_USHORT) {
|
||||
prompt("Last Value Monitored")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(SHFT,DBF_USHORT) {
|
||||
prompt("Shift")
|
||||
promptgroup("40 - Input")
|
||||
interest(1)
|
||||
}
|
||||
|
||||
=head3 Run-time and Simulation Mode Parameters
|
||||
|
||||
These parameters are used by the run-time code for processing the mbbi direct
|
||||
record. They are not configurable prior to run-time.
|
||||
|
||||
MASK is used by device support routine to read hardware register. Record support
|
||||
sets low order NOBT bits in MASK. 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 mbbiDirect record in the simulation
|
||||
mode. See L<Fields Common to Many Record Types> for more information on these
|
||||
fields.
|
||||
|
||||
=fields SIOL, SVAL, SIML, SIMM, SIMS
|
||||
|
||||
=cut
|
||||
|
||||
field(SIOL,DBF_INLINK) {
|
||||
prompt("Sim Input Specifctn")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(1)
|
||||
}
|
||||
field(SVAL,DBF_ULONG) {
|
||||
prompt("Simulation Value")
|
||||
}
|
||||
field(SIML,DBF_INLINK) {
|
||||
prompt("Sim Mode Location")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(1)
|
||||
}
|
||||
field(SIMM,DBF_MENU) {
|
||||
prompt("Simulation Mode")
|
||||
interest(1)
|
||||
menu(menuSimm)
|
||||
}
|
||||
|
||||
=head3 Alarm Parameters
|
||||
|
||||
The possible alarm conditions for multi-bit binary input direct records are the
|
||||
SCAN and READ alarms. These alarms are not configurable by the user since they
|
||||
are always of MAJOR severity. See L<Alarm Specification> for a complete
|
||||
explanation of Scan and Read alarms. No fields exist for the mbbi direct record
|
||||
to have state alarms.
|
||||
|
||||
L<Alarm Fields> lists other fields related to a alarms that are common to all
|
||||
record types.
|
||||
|
||||
=cut
|
||||
|
||||
field(SIMS,DBF_MENU) {
|
||||
prompt("Sim mode Alarm Svrty")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(2)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(B0,DBF_UCHAR) {
|
||||
prompt("Bit 0")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
}
|
||||
field(B1,DBF_UCHAR) {
|
||||
prompt("Bit 1")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
}
|
||||
field(B2,DBF_UCHAR) {
|
||||
prompt("Bit 2")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
}
|
||||
field(B3,DBF_UCHAR) {
|
||||
prompt("Bit 3")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
}
|
||||
field(B4,DBF_UCHAR) {
|
||||
prompt("Bit 4")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
}
|
||||
field(B5,DBF_UCHAR) {
|
||||
prompt("Bit 5")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
}
|
||||
field(B6,DBF_UCHAR) {
|
||||
prompt("Bit 6")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
}
|
||||
field(B7,DBF_UCHAR) {
|
||||
prompt("Bit 7")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
}
|
||||
field(B8,DBF_UCHAR) {
|
||||
prompt("Bit 8")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
}
|
||||
field(B9,DBF_UCHAR) {
|
||||
prompt("Bit 9")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
}
|
||||
field(BA,DBF_UCHAR) {
|
||||
prompt("Bit A")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
}
|
||||
field(BB,DBF_UCHAR) {
|
||||
prompt("Bit B")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
}
|
||||
field(BC,DBF_UCHAR) {
|
||||
prompt("Bit C")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
}
|
||||
field(BD,DBF_UCHAR) {
|
||||
prompt("Bit D")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
}
|
||||
field(BE,DBF_UCHAR) {
|
||||
prompt("Bit E")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
}
|
||||
field(BF,DBF_UCHAR) {
|
||||
prompt("Bit F")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
}
|
||||
|
||||
=head2 Record Support
|
||||
|
||||
=head3 Record Support Routines
|
||||
|
||||
=head4 init_record
|
||||
|
||||
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 device
|
||||
support read routine is defined. If either does not exist, an error message is
|
||||
issued and processing is terminated.
|
||||
|
||||
Clears MASK and then sets the NOBT low order bits.
|
||||
|
||||
If device support includes C<init_record()>, it is called.
|
||||
|
||||
refresh_bits is then called to refresh all the bit fields based on a hardware
|
||||
value.
|
||||
|
||||
=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.
|
||||
|
||||
readValue is called. See L<Output Records> for information.
|
||||
|
||||
=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.
|
||||
|
||||
Convert.
|
||||
|
||||
=over
|
||||
|
||||
=item * status = read_mbbiDirect
|
||||
|
||||
=item * PACT = TRUE
|
||||
|
||||
=item * C<recGblGetTimeStamp()> is called.
|
||||
|
||||
=item * If status is 0, then determine VAL
|
||||
|
||||
=over
|
||||
|
||||
=item * Set rval = RVAL
|
||||
|
||||
=item * Shift rval right SHFT bits
|
||||
|
||||
=item * Set VAL = RVAL
|
||||
|
||||
=back
|
||||
|
||||
=item * If status is 1, return 0
|
||||
|
||||
=item * If status is 2, set status = 0
|
||||
|
||||
=back
|
||||
|
||||
=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 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
|
||||
|
||||
<br><hr><br>
|
||||
|
||||
=end html
|
||||
|
||||
=head2 Device Support
|
||||
|
||||
=head3 Fields Of Interest To Device Support
|
||||
|
||||
Each input record must have an associated set of device support routines.
|
||||
|
||||
The primary responsibility of the device support routines is to obtain a new raw
|
||||
input value whenever read_mbbiDirect is called. The device support routines are
|
||||
primarily interested in the following fields:
|
||||
|
||||
=fields PACT, DPVT, UDF, NSEV, NSTA, NOBT, VAL, INP, RVAL, 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<dbior> 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<level> 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<init_record()> calls are made, with
|
||||
the integer parameter C<after> set to 0.
|
||||
The second call happens after all of the C<init_record()> calls have been made,
|
||||
with C<after> set to 1.
|
||||
|
||||
=head4 init_record
|
||||
|
||||
init_record(precord)
|
||||
|
||||
This routine is optional. If provided, it is called by the record support
|
||||
C<init_record()> routine. If it uses MASK, it should shift it as necessary and
|
||||
also give SHFT 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 IE<sol>O event scan list. cmd has the value (0,1) if the
|
||||
record is being (added to, deleted from) an IE<sol>O event list. It must be
|
||||
provided for any device type that can use the ioEvent scanner.
|
||||
|
||||
=head4 read_mbbiDirect
|
||||
|
||||
read_mbbiDirect(precord)
|
||||
|
||||
This routine must provide a new input value. It returns the following values:
|
||||
|
||||
=over
|
||||
|
||||
=item *
|
||||
|
||||
0: Success. A new raw value is placed in RVAL. The record support module
|
||||
determines VAL from RVAL and SHFT.
|
||||
|
||||
=item *
|
||||
|
||||
2: Success, but don't modify VAL.
|
||||
|
||||
=item *
|
||||
|
||||
Other: Error.
|
||||
|
||||
=back
|
||||
|
||||
=head3 Device Support For Soft Records
|
||||
|
||||
Two soft device support modules, C<<< Soft Channel >>> and C<<< Raw Soft Channel
|
||||
>>>, are provided for multi-bit binary input direct records not related to
|
||||
actual hardware devices. The INP link type must be either CONSTANT, DB_LINK, or
|
||||
CA_LINK.
|
||||
|
||||
=head4 Soft Channel
|
||||
|
||||
For this module, read_mbbiDirect always returns a value of 2, which means that
|
||||
no conversion is performed.
|
||||
|
||||
If the INP link type is constant, then the constant value is stored into VAL by
|
||||
C<init_record()>, and UDF is set to FALSE. VAL can be changed via dbPut
|
||||
requests. If the INP link type is PV_LINK, then dbCaAddInlink is called by
|
||||
C<init_record()>.
|
||||
|
||||
read_mbbiDirect calls recGblGetLinkValue to read the current value of VAL.
|
||||
|
||||
See L<Input Records> for a further explanation.
|
||||
|
||||
If the return status of recGblGetLinkValue is zero, then read_mbbi sets UDF to
|
||||
FALSE. The status of recGblGetLinkValue is returned.
|
||||
|
||||
=head4 Raw Soft Channel
|
||||
|
||||
This module is like the previous except that values are read into RVAL, VAL is
|
||||
computed from RVAL, and read_mbbiDirect returns a value of 0. Thus the record
|
||||
processing routine will determine VAL in the normal way.
|
||||
|
||||
=cut
|
||||
|
||||
}
|
||||
@@ -1,478 +0,0 @@
|
||||
#*************************************************************************
|
||||
# Copyright (c) 2002 The University of Chicago, 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.
|
||||
#*************************************************************************
|
||||
recordtype(mbbi) {
|
||||
include "dbCommon.dbd"
|
||||
field(VAL,DBF_ENUM) {
|
||||
prompt("Current Value")
|
||||
promptgroup("40 - Input")
|
||||
asl(ASL0)
|
||||
pp(TRUE)
|
||||
}
|
||||
field(NOBT,DBF_USHORT) {
|
||||
prompt("Number of Bits")
|
||||
promptgroup("40 - Input")
|
||||
special(SPC_NOMOD)
|
||||
interest(1)
|
||||
}
|
||||
field(INP,DBF_INLINK) {
|
||||
prompt("Input Specification")
|
||||
promptgroup("40 - Input")
|
||||
interest(1)
|
||||
}
|
||||
field(ZRVL,DBF_ULONG) {
|
||||
prompt("Zero Value")
|
||||
promptgroup("41 - Input 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
base(HEX)
|
||||
interest(1)
|
||||
}
|
||||
field(ONVL,DBF_ULONG) {
|
||||
prompt("One Value")
|
||||
promptgroup("41 - Input 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
base(HEX)
|
||||
interest(1)
|
||||
}
|
||||
field(TWVL,DBF_ULONG) {
|
||||
prompt("Two Value")
|
||||
promptgroup("41 - Input 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
base(HEX)
|
||||
interest(1)
|
||||
}
|
||||
field(THVL,DBF_ULONG) {
|
||||
prompt("Three Value")
|
||||
promptgroup("41 - Input 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
base(HEX)
|
||||
interest(1)
|
||||
}
|
||||
field(FRVL,DBF_ULONG) {
|
||||
prompt("Four Value")
|
||||
promptgroup("41 - Input 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
base(HEX)
|
||||
interest(1)
|
||||
}
|
||||
field(FVVL,DBF_ULONG) {
|
||||
prompt("Five Value")
|
||||
promptgroup("41 - Input 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
base(HEX)
|
||||
interest(1)
|
||||
}
|
||||
field(SXVL,DBF_ULONG) {
|
||||
prompt("Six Value")
|
||||
promptgroup("41 - Input 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
base(HEX)
|
||||
interest(1)
|
||||
}
|
||||
field(SVVL,DBF_ULONG) {
|
||||
prompt("Seven Value")
|
||||
promptgroup("41 - Input 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
base(HEX)
|
||||
interest(1)
|
||||
}
|
||||
field(EIVL,DBF_ULONG) {
|
||||
prompt("Eight Value")
|
||||
promptgroup("42 - Input 8-15")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
base(HEX)
|
||||
interest(1)
|
||||
}
|
||||
field(NIVL,DBF_ULONG) {
|
||||
prompt("Nine Value")
|
||||
promptgroup("42 - Input 8-15")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
base(HEX)
|
||||
interest(1)
|
||||
}
|
||||
field(TEVL,DBF_ULONG) {
|
||||
prompt("Ten Value")
|
||||
promptgroup("42 - Input 8-15")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
base(HEX)
|
||||
interest(1)
|
||||
}
|
||||
field(ELVL,DBF_ULONG) {
|
||||
prompt("Eleven Value")
|
||||
promptgroup("42 - Input 8-15")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
base(HEX)
|
||||
interest(1)
|
||||
}
|
||||
field(TVVL,DBF_ULONG) {
|
||||
prompt("Twelve Value")
|
||||
promptgroup("42 - Input 8-15")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
base(HEX)
|
||||
interest(1)
|
||||
}
|
||||
field(TTVL,DBF_ULONG) {
|
||||
prompt("Thirteen Value")
|
||||
promptgroup("42 - Input 8-15")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
base(HEX)
|
||||
interest(1)
|
||||
}
|
||||
field(FTVL,DBF_ULONG) {
|
||||
prompt("Fourteen Value")
|
||||
promptgroup("42 - Input 8-15")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
base(HEX)
|
||||
interest(1)
|
||||
}
|
||||
field(FFVL,DBF_ULONG) {
|
||||
prompt("Fifteen Value")
|
||||
promptgroup("42 - Input 8-15")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
base(HEX)
|
||||
interest(1)
|
||||
}
|
||||
field(ZRST,DBF_STRING) {
|
||||
prompt("Zero String")
|
||||
promptgroup("81 - Display 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
}
|
||||
field(ONST,DBF_STRING) {
|
||||
prompt("One String")
|
||||
promptgroup("81 - Display 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
}
|
||||
field(TWST,DBF_STRING) {
|
||||
prompt("Two String")
|
||||
promptgroup("81 - Display 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
}
|
||||
field(THST,DBF_STRING) {
|
||||
prompt("Three String")
|
||||
promptgroup("81 - Display 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
}
|
||||
field(FRST,DBF_STRING) {
|
||||
prompt("Four String")
|
||||
promptgroup("81 - Display 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
}
|
||||
field(FVST,DBF_STRING) {
|
||||
prompt("Five String")
|
||||
promptgroup("81 - Display 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
}
|
||||
field(SXST,DBF_STRING) {
|
||||
prompt("Six String")
|
||||
promptgroup("81 - Display 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
}
|
||||
field(SVST,DBF_STRING) {
|
||||
prompt("Seven String")
|
||||
promptgroup("81 - Display 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
}
|
||||
field(EIST,DBF_STRING) {
|
||||
prompt("Eight String")
|
||||
promptgroup("82 - Display 8-15")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
}
|
||||
field(NIST,DBF_STRING) {
|
||||
prompt("Nine String")
|
||||
promptgroup("82 - Display 8-15")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
}
|
||||
field(TEST,DBF_STRING) {
|
||||
prompt("Ten String")
|
||||
promptgroup("82 - Display 8-15")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
}
|
||||
field(ELST,DBF_STRING) {
|
||||
prompt("Eleven String")
|
||||
promptgroup("82 - Display 8-15")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
}
|
||||
field(TVST,DBF_STRING) {
|
||||
prompt("Twelve String")
|
||||
promptgroup("82 - Display 8-15")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
}
|
||||
field(TTST,DBF_STRING) {
|
||||
prompt("Thirteen String")
|
||||
promptgroup("82 - Display 8-15")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
}
|
||||
field(FTST,DBF_STRING) {
|
||||
prompt("Fourteen String")
|
||||
promptgroup("82 - Display 8-15")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
}
|
||||
field(FFST,DBF_STRING) {
|
||||
prompt("Fifteen String")
|
||||
promptgroup("82 - Display 8-15")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
}
|
||||
field(ZRSV,DBF_MENU) {
|
||||
prompt("State Zero Severity")
|
||||
promptgroup("71 - Alarm 0-7")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(ONSV,DBF_MENU) {
|
||||
prompt("State One Severity")
|
||||
promptgroup("71 - Alarm 0-7")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(TWSV,DBF_MENU) {
|
||||
prompt("State Two Severity")
|
||||
promptgroup("71 - Alarm 0-7")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(THSV,DBF_MENU) {
|
||||
prompt("State Three Severity")
|
||||
promptgroup("71 - Alarm 0-7")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(FRSV,DBF_MENU) {
|
||||
prompt("State Four Severity")
|
||||
promptgroup("71 - Alarm 0-7")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(FVSV,DBF_MENU) {
|
||||
prompt("State Five Severity")
|
||||
promptgroup("71 - Alarm 0-7")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(SXSV,DBF_MENU) {
|
||||
prompt("State Six Severity")
|
||||
promptgroup("71 - Alarm 0-7")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(SVSV,DBF_MENU) {
|
||||
prompt("State Seven Severity")
|
||||
promptgroup("71 - Alarm 0-7")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(EISV,DBF_MENU) {
|
||||
prompt("State Eight Severity")
|
||||
promptgroup("72 - Alarm 8-15")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(NISV,DBF_MENU) {
|
||||
prompt("State Nine Severity")
|
||||
promptgroup("72 - Alarm 8-15")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(TESV,DBF_MENU) {
|
||||
prompt("State Ten Severity")
|
||||
promptgroup("72 - Alarm 8-15")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(ELSV,DBF_MENU) {
|
||||
prompt("State Eleven Severity")
|
||||
promptgroup("72 - Alarm 8-15")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(TVSV,DBF_MENU) {
|
||||
prompt("State Twelve Severity")
|
||||
promptgroup("72 - Alarm 8-15")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(TTSV,DBF_MENU) {
|
||||
prompt("State Thirteen Sevr")
|
||||
promptgroup("72 - Alarm 8-15")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(FTSV,DBF_MENU) {
|
||||
prompt("State Fourteen Sevr")
|
||||
promptgroup("72 - Alarm 8-15")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(FFSV,DBF_MENU) {
|
||||
prompt("State Fifteen Severity")
|
||||
promptgroup("72 - Alarm 8-15")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(AFTC, DBF_DOUBLE) {
|
||||
prompt("Alarm Filter Time Constant")
|
||||
promptgroup("70 - Alarm")
|
||||
interest(1)
|
||||
}
|
||||
field(AFVL, DBF_DOUBLE) {
|
||||
prompt("Alarm Filter Value")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(UNSV,DBF_MENU) {
|
||||
prompt("Unknown State Severity")
|
||||
promptgroup("70 - Alarm")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(COSV,DBF_MENU) {
|
||||
prompt("Change of State Svr")
|
||||
promptgroup("70 - Alarm")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(RVAL,DBF_ULONG) {
|
||||
prompt("Raw Value")
|
||||
pp(TRUE)
|
||||
}
|
||||
field(ORAW,DBF_ULONG) {
|
||||
prompt("Prev Raw Value")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(MASK,DBF_ULONG) {
|
||||
prompt("Hardware Mask")
|
||||
special(SPC_NOMOD)
|
||||
interest(1)
|
||||
}
|
||||
field(MLST,DBF_USHORT) {
|
||||
prompt("Last Value Monitored")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(LALM,DBF_USHORT) {
|
||||
prompt("Last Value Alarmed")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(SDEF,DBF_SHORT) {
|
||||
prompt("States Defined")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(SHFT,DBF_USHORT) {
|
||||
prompt("Shift")
|
||||
promptgroup("40 - Input")
|
||||
interest(1)
|
||||
}
|
||||
field(SIOL,DBF_INLINK) {
|
||||
prompt("Sim Input Specifctn")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(1)
|
||||
}
|
||||
field(SVAL,DBF_ULONG) {
|
||||
prompt("Simulation Value")
|
||||
}
|
||||
field(SIML,DBF_INLINK) {
|
||||
prompt("Sim Mode Location")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(1)
|
||||
}
|
||||
field(SIMM,DBF_MENU) {
|
||||
prompt("Simulation Mode")
|
||||
interest(1)
|
||||
menu(menuSimm)
|
||||
}
|
||||
field(SIMS,DBF_MENU) {
|
||||
prompt("Sim mode Alarm Svrty")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(2)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
}
|
||||
901
src/std/rec/mbbiRecord.dbd.pod
Normal file
901
src/std/rec/mbbiRecord.dbd.pod
Normal file
@@ -0,0 +1,901 @@
|
||||
#*************************************************************************
|
||||
# Copyright (c) 2002 The University of Chicago, 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.
|
||||
#*************************************************************************
|
||||
|
||||
=title Multi-Bit Binary Input Record (mbbi)
|
||||
|
||||
The normal use for the multi-bit binary input record is to read contiguous,
|
||||
multiple bit inputs from hardware. The binary value represents a state from a
|
||||
range of up to 16 states. The multi-bit input record interfaces with devices
|
||||
that use more than one bit.
|
||||
|
||||
Most device support modules obtain values from hardware and place the value in
|
||||
RVAL. For these device support modules record processing uses RVAL to determine
|
||||
the current state (VAL is given a value between 0 and 15). Device support
|
||||
modules may optionally read a value directly into VAL.
|
||||
|
||||
Soft device modules are provided to obtain input via database or channel access
|
||||
links or via dbPutField or dbPutLink requests. Two soft device support modules
|
||||
are provided: C<<< Soft Channel >>> allows VAL to be an arbitrary unsigned short
|
||||
integer. C<<< Raw Soft Channel >>> reads the value into RVAL just like normal
|
||||
device support modules.
|
||||
|
||||
=recordtype mbbi
|
||||
|
||||
=cut
|
||||
|
||||
recordtype(mbbi) {
|
||||
|
||||
=head2 Parameter Fields
|
||||
|
||||
The record-specific fields are described below, grouped by functionality.
|
||||
|
||||
=head3 Scan Parameters
|
||||
|
||||
The multi-bit binary input record has the standard fields for specifying under
|
||||
what circumstances it will be processed. These fields are listed in L<Scan
|
||||
Fields>. In addition, L<Scanning Specification> explains how these fields are
|
||||
used. Note that I/O event scanning is only supported for those card types that
|
||||
interrupt.
|
||||
|
||||
=head3 Read and Convert Parameters
|
||||
|
||||
The device support routines obtain the record's input from the device or link
|
||||
specified in the INP field. For records that obtain their input from devices,
|
||||
the INP field 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<Address Specification> for
|
||||
information on the format of hardware addresses.
|
||||
|
||||
Two soft device support modules can be specified in DTYP C<Soft Channel> and
|
||||
C<<< Raw Soft Channel >>>.
|
||||
|
||||
C<<< Raw Soft Channel >>> reads the value into RVAL,
|
||||
upon which the normal conversion process is undergone. C<<< Soft Channel >>>
|
||||
reads any unsigned integer directly into VAL. For a soft mbbi record, the INP
|
||||
field can be a constant, a database, or a channel access link. If INP is a
|
||||
constant, then the VAL is initialized to the constant value but can be changed
|
||||
at run-time via dbPutField or dbPutLink. See L<Address Specification> for
|
||||
information on the format of database addresses.
|
||||
|
||||
MASK is used by the raw soft channel read routine, and by typical device support
|
||||
read routines, to select only the desired bits when reading the hardware
|
||||
register. It is initialized to ((1 E<lt>E<lt> NOBT) - 1) by record
|
||||
initialization. The user can configure the NOBT field, but the device support
|
||||
routines may set it, in which case the value given to it by the user is simply
|
||||
overridden. The device support routines may also override MASK or shift it
|
||||
left by SHFT bits. If MASK is non-zero, only the bits specified by MASK will
|
||||
appear in RVAL.
|
||||
|
||||
Unless the device support routine specifies no conversion, RVAL is used to
|
||||
determine VAL as follows:
|
||||
|
||||
=over
|
||||
|
||||
=item 1.
|
||||
|
||||
RVAL is assigned to a temporary variable -- rval = RVAL
|
||||
|
||||
=item 2.
|
||||
|
||||
rval is shifted right SHFT number of bits.
|
||||
|
||||
=item 3.
|
||||
|
||||
A match is sought between rval and one of the state value fields, ZRVL-FFVL.
|
||||
|
||||
=back
|
||||
|
||||
Each of the fields, ZRVL-FFVL, represents one of the possible sixteen states
|
||||
(not all sixteen have to be used).
|
||||
|
||||
Alternatively, the input value can be read as a string, in which case, a match
|
||||
is sought with one of the strings specified in the ZRST-FFST fields. Then RVAL
|
||||
is set equal to the corresponding value for that string, and the conversion
|
||||
process occurs.
|
||||
|
||||
=fields VAL, INP, MASK, NOBT, RVAL, SHFT, ZRVL, ONVL, TWVL, THVL, FRVL, FVVL, SXVL, SVVL, EIVL, NIVL, TEVL, ELVL, TVVL, TTVL, FTVL, FFVL
|
||||
|
||||
=head3 Operator Display Parameters
|
||||
|
||||
These parameters are used to present meaningful data to the operator. They
|
||||
display the value and other parameters of the mbbi record either textually or
|
||||
graphically. The ZRST-FFST fields contain strings describing one of the possible
|
||||
states of the record. The C<<< get_enum_str >>> and C<<< get_enum_strs >>>
|
||||
record routines retrieve these strings for the operator. C<<< Get_enum_str >>>
|
||||
gets the string corresponding to the value set in VAL, and C<<< get_enum_strs
|
||||
>>> retrieves all the strings.
|
||||
|
||||
See L<Fields Common to All Record Types> for more on the record name (NAME) and
|
||||
description (DESC) fields.
|
||||
|
||||
=fields NAME, DESC, ZRST, ONST, TWST, THST, FRST, FVST, SXST, SVST, EIST, NIST, TEST, ELST, TVST, TTST, FTST, FFST
|
||||
|
||||
=cut
|
||||
|
||||
include "dbCommon.dbd"
|
||||
field(VAL,DBF_ENUM) {
|
||||
prompt("Current Value")
|
||||
promptgroup("40 - Input")
|
||||
asl(ASL0)
|
||||
pp(TRUE)
|
||||
}
|
||||
field(NOBT,DBF_USHORT) {
|
||||
prompt("Number of Bits")
|
||||
promptgroup("40 - Input")
|
||||
special(SPC_NOMOD)
|
||||
interest(1)
|
||||
}
|
||||
field(INP,DBF_INLINK) {
|
||||
prompt("Input Specification")
|
||||
promptgroup("40 - Input")
|
||||
interest(1)
|
||||
}
|
||||
field(ZRVL,DBF_ULONG) {
|
||||
prompt("Zero Value")
|
||||
promptgroup("41 - Input 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
base(HEX)
|
||||
interest(1)
|
||||
}
|
||||
field(ONVL,DBF_ULONG) {
|
||||
prompt("One Value")
|
||||
promptgroup("41 - Input 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
base(HEX)
|
||||
interest(1)
|
||||
}
|
||||
field(TWVL,DBF_ULONG) {
|
||||
prompt("Two Value")
|
||||
promptgroup("41 - Input 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
base(HEX)
|
||||
interest(1)
|
||||
}
|
||||
field(THVL,DBF_ULONG) {
|
||||
prompt("Three Value")
|
||||
promptgroup("41 - Input 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
base(HEX)
|
||||
interest(1)
|
||||
}
|
||||
field(FRVL,DBF_ULONG) {
|
||||
prompt("Four Value")
|
||||
promptgroup("41 - Input 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
base(HEX)
|
||||
interest(1)
|
||||
}
|
||||
field(FVVL,DBF_ULONG) {
|
||||
prompt("Five Value")
|
||||
promptgroup("41 - Input 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
base(HEX)
|
||||
interest(1)
|
||||
}
|
||||
field(SXVL,DBF_ULONG) {
|
||||
prompt("Six Value")
|
||||
promptgroup("41 - Input 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
base(HEX)
|
||||
interest(1)
|
||||
}
|
||||
field(SVVL,DBF_ULONG) {
|
||||
prompt("Seven Value")
|
||||
promptgroup("41 - Input 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
base(HEX)
|
||||
interest(1)
|
||||
}
|
||||
field(EIVL,DBF_ULONG) {
|
||||
prompt("Eight Value")
|
||||
promptgroup("42 - Input 8-15")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
base(HEX)
|
||||
interest(1)
|
||||
}
|
||||
field(NIVL,DBF_ULONG) {
|
||||
prompt("Nine Value")
|
||||
promptgroup("42 - Input 8-15")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
base(HEX)
|
||||
interest(1)
|
||||
}
|
||||
field(TEVL,DBF_ULONG) {
|
||||
prompt("Ten Value")
|
||||
promptgroup("42 - Input 8-15")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
base(HEX)
|
||||
interest(1)
|
||||
}
|
||||
field(ELVL,DBF_ULONG) {
|
||||
prompt("Eleven Value")
|
||||
promptgroup("42 - Input 8-15")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
base(HEX)
|
||||
interest(1)
|
||||
}
|
||||
field(TVVL,DBF_ULONG) {
|
||||
prompt("Twelve Value")
|
||||
promptgroup("42 - Input 8-15")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
base(HEX)
|
||||
interest(1)
|
||||
}
|
||||
field(TTVL,DBF_ULONG) {
|
||||
prompt("Thirteen Value")
|
||||
promptgroup("42 - Input 8-15")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
base(HEX)
|
||||
interest(1)
|
||||
}
|
||||
field(FTVL,DBF_ULONG) {
|
||||
prompt("Fourteen Value")
|
||||
promptgroup("42 - Input 8-15")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
base(HEX)
|
||||
interest(1)
|
||||
}
|
||||
field(FFVL,DBF_ULONG) {
|
||||
prompt("Fifteen Value")
|
||||
promptgroup("42 - Input 8-15")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
base(HEX)
|
||||
interest(1)
|
||||
}
|
||||
field(ZRST,DBF_STRING) {
|
||||
prompt("Zero String")
|
||||
promptgroup("81 - Display 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
}
|
||||
field(ONST,DBF_STRING) {
|
||||
prompt("One String")
|
||||
promptgroup("81 - Display 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
}
|
||||
field(TWST,DBF_STRING) {
|
||||
prompt("Two String")
|
||||
promptgroup("81 - Display 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
}
|
||||
field(THST,DBF_STRING) {
|
||||
prompt("Three String")
|
||||
promptgroup("81 - Display 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
}
|
||||
field(FRST,DBF_STRING) {
|
||||
prompt("Four String")
|
||||
promptgroup("81 - Display 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
}
|
||||
field(FVST,DBF_STRING) {
|
||||
prompt("Five String")
|
||||
promptgroup("81 - Display 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
}
|
||||
field(SXST,DBF_STRING) {
|
||||
prompt("Six String")
|
||||
promptgroup("81 - Display 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
}
|
||||
field(SVST,DBF_STRING) {
|
||||
prompt("Seven String")
|
||||
promptgroup("81 - Display 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
}
|
||||
field(EIST,DBF_STRING) {
|
||||
prompt("Eight String")
|
||||
promptgroup("82 - Display 8-15")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
}
|
||||
field(NIST,DBF_STRING) {
|
||||
prompt("Nine String")
|
||||
promptgroup("82 - Display 8-15")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
}
|
||||
field(TEST,DBF_STRING) {
|
||||
prompt("Ten String")
|
||||
promptgroup("82 - Display 8-15")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
}
|
||||
field(ELST,DBF_STRING) {
|
||||
prompt("Eleven String")
|
||||
promptgroup("82 - Display 8-15")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
}
|
||||
field(TVST,DBF_STRING) {
|
||||
prompt("Twelve String")
|
||||
promptgroup("82 - Display 8-15")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
}
|
||||
field(TTST,DBF_STRING) {
|
||||
prompt("Thirteen String")
|
||||
promptgroup("82 - Display 8-15")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
}
|
||||
field(FTST,DBF_STRING) {
|
||||
prompt("Fourteen String")
|
||||
promptgroup("82 - Display 8-15")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
}
|
||||
field(FFST,DBF_STRING) {
|
||||
prompt("Fifteen String")
|
||||
promptgroup("82 - Display 8-15")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
}
|
||||
|
||||
=head3 Alarm Parameters
|
||||
|
||||
The possible alarm conditions for multi-bit binary inputs are the SCAN, READ,
|
||||
and state alarms. The state alarms are configured in the below severity fields.
|
||||
These fields have the usual possible values for severity fields: NO_ALARM,
|
||||
MINOR, and MAJOR.
|
||||
|
||||
The unknown state severity (UNSV) field, if set to MINOR or MAJOR, triggers an
|
||||
alarm when the record support routine cannot find a matching value in the state
|
||||
value fields for C<<< rval >>>.
|
||||
|
||||
The change of state severity (COSV) field triggers an alarm when any change of
|
||||
state occurs, if set to MAJOR or MINOR.
|
||||
|
||||
The other fields, when set to MAJOR or MINOR, trigger an alarm when VAL equals
|
||||
the corresponding state. See the See L<Alarm Specification> for a complete
|
||||
explanation of discrete alarms and these fields. L<Alarm Fields> lists other
|
||||
fields related to a alarms that are common to all record types.
|
||||
|
||||
=fields UNSV, COSV, ZRSV, ONSV, TWSV, THSV, FRSV, FVSV, SXSV, SVSV, EISV, NISV, TESV, ELSV, TVSV, TTSV, FTSV, FFSV
|
||||
|
||||
=cut
|
||||
|
||||
field(ZRSV,DBF_MENU) {
|
||||
prompt("State Zero Severity")
|
||||
promptgroup("71 - Alarm 0-7")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(ONSV,DBF_MENU) {
|
||||
prompt("State One Severity")
|
||||
promptgroup("71 - Alarm 0-7")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(TWSV,DBF_MENU) {
|
||||
prompt("State Two Severity")
|
||||
promptgroup("71 - Alarm 0-7")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(THSV,DBF_MENU) {
|
||||
prompt("State Three Severity")
|
||||
promptgroup("71 - Alarm 0-7")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(FRSV,DBF_MENU) {
|
||||
prompt("State Four Severity")
|
||||
promptgroup("71 - Alarm 0-7")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(FVSV,DBF_MENU) {
|
||||
prompt("State Five Severity")
|
||||
promptgroup("71 - Alarm 0-7")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(SXSV,DBF_MENU) {
|
||||
prompt("State Six Severity")
|
||||
promptgroup("71 - Alarm 0-7")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(SVSV,DBF_MENU) {
|
||||
prompt("State Seven Severity")
|
||||
promptgroup("71 - Alarm 0-7")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(EISV,DBF_MENU) {
|
||||
prompt("State Eight Severity")
|
||||
promptgroup("72 - Alarm 8-15")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(NISV,DBF_MENU) {
|
||||
prompt("State Nine Severity")
|
||||
promptgroup("72 - Alarm 8-15")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(TESV,DBF_MENU) {
|
||||
prompt("State Ten Severity")
|
||||
promptgroup("72 - Alarm 8-15")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(ELSV,DBF_MENU) {
|
||||
prompt("State Eleven Severity")
|
||||
promptgroup("72 - Alarm 8-15")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(TVSV,DBF_MENU) {
|
||||
prompt("State Twelve Severity")
|
||||
promptgroup("72 - Alarm 8-15")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(TTSV,DBF_MENU) {
|
||||
prompt("State Thirteen Sevr")
|
||||
promptgroup("72 - Alarm 8-15")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(FTSV,DBF_MENU) {
|
||||
prompt("State Fourteen Sevr")
|
||||
promptgroup("72 - Alarm 8-15")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(FFSV,DBF_MENU) {
|
||||
prompt("State Fifteen Severity")
|
||||
promptgroup("72 - Alarm 8-15")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(AFTC, DBF_DOUBLE) {
|
||||
prompt("Alarm Filter Time Constant")
|
||||
promptgroup("70 - Alarm")
|
||||
interest(1)
|
||||
}
|
||||
field(AFVL, DBF_DOUBLE) {
|
||||
prompt("Alarm Filter Value")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(UNSV,DBF_MENU) {
|
||||
prompt("Unknown State Severity")
|
||||
promptgroup("70 - Alarm")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(COSV,DBF_MENU) {
|
||||
prompt("Change of State Svr")
|
||||
promptgroup("70 - Alarm")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
|
||||
=head3 Run-time Parameters
|
||||
|
||||
These parameters are used by the run-time code for processing the multi-bit
|
||||
binary input.
|
||||
|
||||
ORAW is used by record processing to hold the prior RVAL for use in determining
|
||||
when to post a monitor event for the RVAL field.
|
||||
|
||||
The LALM field implements the change of state alarm severity by holding the
|
||||
value of VAL when the previous change of state alarm was issued.
|
||||
|
||||
MLST holds the value when the last monitor for value change was triggered.
|
||||
|
||||
SDEF is used by record support to save time if no states are defined.
|
||||
|
||||
=fields ORAW, LALM, MLST, SDEF
|
||||
|
||||
=cut
|
||||
|
||||
field(RVAL,DBF_ULONG) {
|
||||
prompt("Raw Value")
|
||||
pp(TRUE)
|
||||
}
|
||||
field(ORAW,DBF_ULONG) {
|
||||
prompt("Prev Raw Value")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(MASK,DBF_ULONG) {
|
||||
prompt("Hardware Mask")
|
||||
special(SPC_NOMOD)
|
||||
interest(1)
|
||||
}
|
||||
field(MLST,DBF_USHORT) {
|
||||
prompt("Last Value Monitored")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(LALM,DBF_USHORT) {
|
||||
prompt("Last Value Alarmed")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(SDEF,DBF_SHORT) {
|
||||
prompt("States Defined")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(SHFT,DBF_USHORT) {
|
||||
prompt("Shift")
|
||||
promptgroup("40 - Input")
|
||||
interest(1)
|
||||
}
|
||||
|
||||
=head3 Simulation Mode Parameters
|
||||
|
||||
The following fields are used to operate the mbbi record in the simulation mode.
|
||||
See L<Fields Common to Many Record Types> for more information on these fields.
|
||||
|
||||
=fields SIOL, SVAL, SIML, SIMM, SIMS
|
||||
|
||||
=cut
|
||||
|
||||
field(SIOL,DBF_INLINK) {
|
||||
prompt("Sim Input Specifctn")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(1)
|
||||
}
|
||||
field(SVAL,DBF_ULONG) {
|
||||
prompt("Simulation Value")
|
||||
}
|
||||
field(SIML,DBF_INLINK) {
|
||||
prompt("Sim Mode Location")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(1)
|
||||
}
|
||||
field(SIMM,DBF_MENU) {
|
||||
prompt("Simulation Mode")
|
||||
interest(1)
|
||||
menu(menuSimm)
|
||||
}
|
||||
field(SIMS,DBF_MENU) {
|
||||
prompt("Sim mode Alarm Svrty")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(2)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
|
||||
=head2 Record Support
|
||||
|
||||
=head3 Record Support Routines
|
||||
|
||||
=head4 init_record
|
||||
|
||||
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 device
|
||||
support read routine is defined. If either does not exist, an error message is
|
||||
issued and processing is terminated.
|
||||
|
||||
Clears MASK and then sets the NOBT low order bits.
|
||||
|
||||
If device support includes C<init_record()>, it is called.
|
||||
|
||||
init_common is then called to determine if any states are defined. If states are
|
||||
defined, SDEF is set to TRUE.
|
||||
|
||||
=head4 process
|
||||
|
||||
See next section.
|
||||
|
||||
=head4 special
|
||||
|
||||
Calls init_common to compute SDEF when any of the fields ZRVL, ... FFVL change
|
||||
value.
|
||||
|
||||
=head4 get_enum_str
|
||||
|
||||
Retrieves ASCII string corresponding to VAL.
|
||||
|
||||
=head4 get_enum_strs
|
||||
|
||||
Retrieves ASCII strings for ZRST,...FFST.
|
||||
|
||||
=head4 put_enum_str
|
||||
|
||||
Checks if string matches ZRST,...FFST and if it does, sets VAL.
|
||||
|
||||
=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<Input Records> for more information.
|
||||
|
||||
=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.
|
||||
|
||||
Convert:
|
||||
|
||||
=over
|
||||
|
||||
=item * status=read_mbbi
|
||||
|
||||
=item * PACT = TRUE
|
||||
|
||||
=item * C<recGblGetTimeStamp()> is called.
|
||||
|
||||
=item * If status is 0, then determine VAL
|
||||
|
||||
=over
|
||||
|
||||
=item * Set rval = RVAL
|
||||
|
||||
=item * Shift rval right SHFT bits
|
||||
|
||||
=back
|
||||
|
||||
=item * If at least one state value is defined
|
||||
|
||||
=over
|
||||
|
||||
=item * Set UDF to TRUE
|
||||
|
||||
=back
|
||||
|
||||
=item * If RVAL is ZRVL,...,FFVL then set
|
||||
|
||||
=over
|
||||
|
||||
=item * VAL equals index of state
|
||||
|
||||
=item * UDF set to FALSE
|
||||
|
||||
=back
|
||||
|
||||
=item * Else set VAL = undefined
|
||||
|
||||
=over
|
||||
|
||||
=item * Else set VAL = RVAL
|
||||
|
||||
=back
|
||||
|
||||
=item * Set UDF to FALSE
|
||||
|
||||
=over
|
||||
|
||||
=item * If status is 1, return 0
|
||||
|
||||
=item * If status is 2, set status = 0
|
||||
|
||||
=back
|
||||
|
||||
=back
|
||||
|
||||
=item 5.
|
||||
|
||||
Check alarms. This routine checks to see if the new VAL causes the alarm status
|
||||
and severity to change. If so, NSEV, NSTA and LALM are set.
|
||||
|
||||
=item 6.
|
||||
|
||||
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 are checked whenever other monitors are invoked.
|
||||
|
||||
=item * NSEV and NSTA are reset to 0.
|
||||
|
||||
=back
|
||||
|
||||
=item 7.
|
||||
|
||||
Scan forward link if necessary, set PACT FALSE, and return.
|
||||
|
||||
=back
|
||||
|
||||
=head2 Device Support
|
||||
|
||||
=head3 Fields Of Interest To Device Support
|
||||
|
||||
Each input record must have an associated set of device support routines.
|
||||
|
||||
The primary responsibility of the device support routines is to obtain a new raw
|
||||
input value whenever read_mbbi is called. The device support routines are
|
||||
primarily interested in the following fields:
|
||||
|
||||
=fields PACT, DPVT, UDF, NSEV, NSTA, NOBT, VAL, INP, RVAL, 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<dbior> 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<level> 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<init_record()> calls are made, with
|
||||
the integer parameter C<after> set to 0.
|
||||
The second call happens after all of the C<init_record()> calls have been made,
|
||||
with C<after> set to 1.
|
||||
|
||||
=head4 init_record
|
||||
|
||||
init_record(precord)
|
||||
|
||||
This routine is optional. If provided, it is called by the record support
|
||||
C<init_record()> routine. If it uses MASK, it should shift it as necessary and
|
||||
also give SHFT 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 I/O Event scanner.
|
||||
|
||||
=head4 read_mbbi
|
||||
|
||||
read_mbbi(precord)
|
||||
|
||||
This routine must provide a new input value. It returns the following values:
|
||||
|
||||
=over
|
||||
|
||||
=item *
|
||||
|
||||
0: Success. A new raw value is placed in RVAL. The record support module
|
||||
determines VAL from RVAL, SHFT, and ZEVL ... FFVL.
|
||||
|
||||
=item *
|
||||
|
||||
2: Success, but don't modify VAL.
|
||||
|
||||
=item *
|
||||
|
||||
Other: Error.
|
||||
|
||||
=back
|
||||
|
||||
=head3 Device Support For Soft Records
|
||||
|
||||
Two soft device support modules C<<< Soft Channel >>> and C<<< Raw Soft Channel
|
||||
>>> are provided for multi-bit binary input records not related to actual
|
||||
hardware devices. The INP link type must be either CONSTANT, DB_LINK, or
|
||||
CA_LINK.
|
||||
|
||||
=head4 Soft Channel
|
||||
|
||||
read_mbbi always returns a value of 2, which means that no conversion is
|
||||
performed.
|
||||
|
||||
If the INP link type is constant, then the constant value is stored into VAL by
|
||||
C<init_record()>, and UDF is set to FALSE. VAL can be changed via dbPut
|
||||
requests. If the INP link type is PV_LINK, then dbCaAddInlink is called by
|
||||
C<init_record()>.
|
||||
|
||||
read_mbbi calls recGblGetLinkValue to read the current value of VAL. See L<Soft
|
||||
Input>.
|
||||
|
||||
If the return status of recGblGetLinkValue is zero, then read_mbbi sets UDF to
|
||||
FALSE. The status of recGblGetLinkValue is returned.
|
||||
|
||||
=head4 Raw Soft Channel
|
||||
|
||||
This module is like the previous except that values are read into RVAL, VAL is
|
||||
computed from RVAL, and read_mbbi returns a value of 0. Thus the record
|
||||
processing routine will determine VAL in the normal way.
|
||||
|
||||
=cut
|
||||
|
||||
}
|
||||
@@ -1,219 +0,0 @@
|
||||
#*************************************************************************
|
||||
# Copyright (c) 2002 The University of Chicago, 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.
|
||||
#*************************************************************************
|
||||
recordtype(mbboDirect) {
|
||||
include "dbCommon.dbd"
|
||||
field(VAL,DBF_USHORT) {
|
||||
prompt("Word")
|
||||
promptgroup("50 - Output")
|
||||
asl(ASL0)
|
||||
pp(TRUE)
|
||||
}
|
||||
field(OMSL,DBF_MENU) {
|
||||
prompt("Output Mode Select")
|
||||
promptgroup("50 - Output")
|
||||
special(SPC_RESET)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuOmsl)
|
||||
}
|
||||
field(NOBT,DBF_SHORT) {
|
||||
prompt("Number of Bits")
|
||||
promptgroup("50 - Output")
|
||||
special(SPC_NOMOD)
|
||||
interest(1)
|
||||
}
|
||||
field(DOL,DBF_INLINK) {
|
||||
prompt("Desired Output Loc")
|
||||
promptgroup("40 - Input")
|
||||
interest(1)
|
||||
}
|
||||
field(OUT,DBF_OUTLINK) {
|
||||
prompt("Output Specification")
|
||||
promptgroup("50 - Output")
|
||||
interest(1)
|
||||
}
|
||||
field(B0,DBF_UCHAR) {
|
||||
prompt("Bit 0")
|
||||
promptgroup("51 - Output 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
}
|
||||
field(B1,DBF_UCHAR) {
|
||||
prompt("Bit 1")
|
||||
promptgroup("51 - Output 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
}
|
||||
field(B2,DBF_UCHAR) {
|
||||
prompt("Bit 2")
|
||||
promptgroup("51 - Output 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
}
|
||||
field(B3,DBF_UCHAR) {
|
||||
prompt("Bit 3")
|
||||
promptgroup("51 - Output 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
}
|
||||
field(B4,DBF_UCHAR) {
|
||||
prompt("Bit 4")
|
||||
promptgroup("51 - Output 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
}
|
||||
field(B5,DBF_UCHAR) {
|
||||
prompt("Bit 5")
|
||||
promptgroup("51 - Output 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
}
|
||||
field(B6,DBF_UCHAR) {
|
||||
prompt("Bit 6")
|
||||
promptgroup("51 - Output 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
}
|
||||
field(B7,DBF_UCHAR) {
|
||||
prompt("Bit 7")
|
||||
promptgroup("51 - Output 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
}
|
||||
field(B8,DBF_UCHAR) {
|
||||
prompt("Bit 8")
|
||||
promptgroup("52 - Output 9-F")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
}
|
||||
field(B9,DBF_UCHAR) {
|
||||
prompt("Bit 9")
|
||||
promptgroup("52 - Output 9-F")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
}
|
||||
field(BA,DBF_UCHAR) {
|
||||
prompt("Bit 10")
|
||||
promptgroup("52 - Output 9-F")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
}
|
||||
field(BB,DBF_UCHAR) {
|
||||
prompt("Bit 11")
|
||||
promptgroup("52 - Output 9-F")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
}
|
||||
field(BC,DBF_UCHAR) {
|
||||
prompt("Bit 12")
|
||||
promptgroup("52 - Output 9-F")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
}
|
||||
field(BD,DBF_UCHAR) {
|
||||
prompt("Bit 13")
|
||||
promptgroup("52 - Output 9-F")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
}
|
||||
field(BE,DBF_UCHAR) {
|
||||
prompt("Bit 14")
|
||||
promptgroup("52 - Output 9-F")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
}
|
||||
field(BF,DBF_UCHAR) {
|
||||
prompt("Bit 15")
|
||||
promptgroup("52 - Output 9-F")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
}
|
||||
field(RVAL,DBF_ULONG) {
|
||||
prompt("Raw Value")
|
||||
special(SPC_NOMOD)
|
||||
pp(TRUE)
|
||||
}
|
||||
field(ORAW,DBF_ULONG) {
|
||||
prompt("Prev Raw Value")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(RBV,DBF_ULONG) {
|
||||
prompt("Readback Value")
|
||||
special(SPC_NOMOD)
|
||||
}
|
||||
field(ORBV,DBF_ULONG) {
|
||||
prompt("Prev Readback Value")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(MASK,DBF_ULONG) {
|
||||
prompt("Hardware Mask")
|
||||
special(SPC_NOMOD)
|
||||
interest(1)
|
||||
}
|
||||
field(MLST,DBF_ULONG) {
|
||||
prompt("Last Value Monitored")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(SHFT,DBF_ULONG) {
|
||||
prompt("Shift")
|
||||
promptgroup("50 - Output")
|
||||
interest(1)
|
||||
}
|
||||
field(SIOL,DBF_OUTLINK) {
|
||||
prompt("Sim Output Specifctn")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(1)
|
||||
}
|
||||
field(SIML,DBF_INLINK) {
|
||||
prompt("Sim Mode Location")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(1)
|
||||
}
|
||||
field(SIMM,DBF_MENU) {
|
||||
prompt("Simulation Mode")
|
||||
interest(1)
|
||||
menu(menuYesNo)
|
||||
}
|
||||
field(SIMS,DBF_MENU) {
|
||||
prompt("Sim mode Alarm Svrty")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(2)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(IVOA,DBF_MENU) {
|
||||
prompt("INVALID outpt action")
|
||||
promptgroup("50 - Output")
|
||||
interest(2)
|
||||
menu(menuIvoa)
|
||||
}
|
||||
field(IVOV,DBF_USHORT) {
|
||||
prompt("INVALID output value")
|
||||
promptgroup("50 - Output")
|
||||
interest(2)
|
||||
}
|
||||
}
|
||||
535
src/std/rec/mbboDirectRecord.dbd.pod
Normal file
535
src/std/rec/mbboDirectRecord.dbd.pod
Normal file
@@ -0,0 +1,535 @@
|
||||
#*************************************************************************
|
||||
# Copyright (c) 2002 The University of Chicago, 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.
|
||||
#*************************************************************************
|
||||
|
||||
=title Multi-Bit Binary Output Direct Record (mbboDirect)
|
||||
|
||||
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.
|
||||
|
||||
=recordtype mbboDirect
|
||||
|
||||
=cut
|
||||
|
||||
recordtype(mbboDirect) {
|
||||
|
||||
=head2 Parameter Fields
|
||||
|
||||
The record-specific fields are described below, grouped by functionality.
|
||||
|
||||
=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<Scan Fields>.
|
||||
In addition, L<Scanning Specification> 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<Address Specification> 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<Address Specification> 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<Address Specification> 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<Fields Common to All Record Types> for more on the record name (NAME) and
|
||||
description (DESC) fields.
|
||||
|
||||
=fields NAME, DESC
|
||||
|
||||
=cut
|
||||
|
||||
include "dbCommon.dbd"
|
||||
field(VAL,DBF_USHORT) {
|
||||
prompt("Word")
|
||||
promptgroup("50 - Output")
|
||||
asl(ASL0)
|
||||
pp(TRUE)
|
||||
}
|
||||
field(OMSL,DBF_MENU) {
|
||||
prompt("Output Mode Select")
|
||||
promptgroup("50 - Output")
|
||||
special(SPC_RESET)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuOmsl)
|
||||
}
|
||||
field(NOBT,DBF_SHORT) {
|
||||
prompt("Number of Bits")
|
||||
promptgroup("50 - Output")
|
||||
special(SPC_NOMOD)
|
||||
interest(1)
|
||||
}
|
||||
field(DOL,DBF_INLINK) {
|
||||
prompt("Desired Output Loc")
|
||||
promptgroup("40 - Input")
|
||||
interest(1)
|
||||
}
|
||||
field(OUT,DBF_OUTLINK) {
|
||||
prompt("Output Specification")
|
||||
promptgroup("50 - Output")
|
||||
interest(1)
|
||||
}
|
||||
field(B0,DBF_UCHAR) {
|
||||
prompt("Bit 0")
|
||||
promptgroup("51 - Output 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
}
|
||||
field(B1,DBF_UCHAR) {
|
||||
prompt("Bit 1")
|
||||
promptgroup("51 - Output 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
}
|
||||
field(B2,DBF_UCHAR) {
|
||||
prompt("Bit 2")
|
||||
promptgroup("51 - Output 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
}
|
||||
field(B3,DBF_UCHAR) {
|
||||
prompt("Bit 3")
|
||||
promptgroup("51 - Output 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
}
|
||||
field(B4,DBF_UCHAR) {
|
||||
prompt("Bit 4")
|
||||
promptgroup("51 - Output 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
}
|
||||
field(B5,DBF_UCHAR) {
|
||||
prompt("Bit 5")
|
||||
promptgroup("51 - Output 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
}
|
||||
field(B6,DBF_UCHAR) {
|
||||
prompt("Bit 6")
|
||||
promptgroup("51 - Output 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
}
|
||||
field(B7,DBF_UCHAR) {
|
||||
prompt("Bit 7")
|
||||
promptgroup("51 - Output 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
}
|
||||
field(B8,DBF_UCHAR) {
|
||||
prompt("Bit 8")
|
||||
promptgroup("52 - Output 9-F")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
}
|
||||
field(B9,DBF_UCHAR) {
|
||||
prompt("Bit 9")
|
||||
promptgroup("52 - Output 9-F")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
}
|
||||
field(BA,DBF_UCHAR) {
|
||||
prompt("Bit 10")
|
||||
promptgroup("52 - Output 9-F")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
}
|
||||
field(BB,DBF_UCHAR) {
|
||||
prompt("Bit 11")
|
||||
promptgroup("52 - Output 9-F")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
}
|
||||
field(BC,DBF_UCHAR) {
|
||||
prompt("Bit 12")
|
||||
promptgroup("52 - Output 9-F")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
}
|
||||
field(BD,DBF_UCHAR) {
|
||||
prompt("Bit 13")
|
||||
promptgroup("52 - Output 9-F")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
}
|
||||
field(BE,DBF_UCHAR) {
|
||||
prompt("Bit 14")
|
||||
promptgroup("52 - Output 9-F")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
}
|
||||
field(BF,DBF_UCHAR) {
|
||||
prompt("Bit 15")
|
||||
promptgroup("52 - Output 9-F")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
}
|
||||
field(RVAL,DBF_ULONG) {
|
||||
prompt("Raw Value")
|
||||
special(SPC_NOMOD)
|
||||
pp(TRUE)
|
||||
}
|
||||
field(ORAW,DBF_ULONG) {
|
||||
prompt("Prev Raw Value")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(RBV,DBF_ULONG) {
|
||||
prompt("Readback Value")
|
||||
special(SPC_NOMOD)
|
||||
}
|
||||
field(ORBV,DBF_ULONG) {
|
||||
prompt("Prev Readback Value")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(MASK,DBF_ULONG) {
|
||||
prompt("Hardware Mask")
|
||||
special(SPC_NOMOD)
|
||||
interest(1)
|
||||
}
|
||||
field(MLST,DBF_ULONG) {
|
||||
prompt("Last Value Monitored")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(SHFT,DBF_ULONG) {
|
||||
prompt("Shift")
|
||||
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<Alarm Specification> 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<Invalid Alarm Output Action> for more
|
||||
information. L<Alarm Fields> 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<Simulation Mode> for more information on the simulation mode fields.
|
||||
|
||||
=fields SIOL, SIML, SIMM, SIMS
|
||||
|
||||
=begin html
|
||||
|
||||
<br><hr><br>
|
||||
|
||||
=end html
|
||||
|
||||
=cut
|
||||
|
||||
field(SIOL,DBF_OUTLINK) {
|
||||
prompt("Sim Output Specifctn")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(1)
|
||||
}
|
||||
field(SIML,DBF_INLINK) {
|
||||
prompt("Sim Mode Location")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(1)
|
||||
}
|
||||
field(SIMM,DBF_MENU) {
|
||||
prompt("Simulation Mode")
|
||||
interest(1)
|
||||
menu(menuYesNo)
|
||||
}
|
||||
field(SIMS,DBF_MENU) {
|
||||
prompt("Sim mode Alarm Svrty")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(2)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(IVOA,DBF_MENU) {
|
||||
prompt("INVALID outpt action")
|
||||
promptgroup("50 - Output")
|
||||
interest(2)
|
||||
menu(menuIvoa)
|
||||
}
|
||||
field(IVOV,DBF_USHORT) {
|
||||
prompt("INVALID output value")
|
||||
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<init_record()>, 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
|
||||
|
||||
<br><hr><br>
|
||||
|
||||
=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<dbior> 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<level> 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<init_record()> calls are made, with
|
||||
the integer parameter C<after> set to 0.
|
||||
The second call happens after all of the C<init_record()> calls have been made,
|
||||
with C<after> set to 1.
|
||||
|
||||
=head4 init_record
|
||||
|
||||
init_record(precord)
|
||||
|
||||
This routine is optional. If provided, it is called by the record support
|
||||
C<init_record()> 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<init_record()>.
|
||||
|
||||
write_mbboDirect calls recGblPutLinkValue to write the current value of VAL.
|
||||
|
||||
See L<Soft Output|Soft_Output>.
|
||||
|
||||
=cut
|
||||
|
||||
}
|
||||
@@ -1,499 +0,0 @@
|
||||
#*************************************************************************
|
||||
# Copyright (c) 2002 The University of Chicago, 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.
|
||||
#*************************************************************************
|
||||
recordtype(mbbo) {
|
||||
include "dbCommon.dbd"
|
||||
field(VAL,DBF_ENUM) {
|
||||
prompt("Desired Value")
|
||||
promptgroup("50 - Output")
|
||||
special(SPC_DBADDR)
|
||||
asl(ASL0)
|
||||
pp(TRUE)
|
||||
#=read Yes
|
||||
#=write Yes
|
||||
}
|
||||
field(DOL,DBF_INLINK) {
|
||||
prompt("Desired Output Loc")
|
||||
promptgroup("40 - Input")
|
||||
interest(1)
|
||||
}
|
||||
field(OMSL,DBF_MENU) {
|
||||
prompt("Output Mode Select")
|
||||
promptgroup("50 - Output")
|
||||
interest(1)
|
||||
menu(menuOmsl)
|
||||
}
|
||||
field(NOBT,DBF_USHORT) {
|
||||
prompt("Number of Bits")
|
||||
promptgroup("50 - Output")
|
||||
special(SPC_NOMOD)
|
||||
interest(1)
|
||||
}
|
||||
field(OUT,DBF_OUTLINK) {
|
||||
prompt("Output Specification")
|
||||
promptgroup("50 - Output")
|
||||
interest(1)
|
||||
}
|
||||
field(ZRVL,DBF_ULONG) {
|
||||
prompt("Zero Value")
|
||||
promptgroup("51 - Output 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
base(HEX)
|
||||
interest(1)
|
||||
}
|
||||
field(ONVL,DBF_ULONG) {
|
||||
prompt("One Value")
|
||||
promptgroup("51 - Output 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
base(HEX)
|
||||
interest(1)
|
||||
}
|
||||
field(TWVL,DBF_ULONG) {
|
||||
prompt("Two Value")
|
||||
promptgroup("51 - Output 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
base(HEX)
|
||||
interest(1)
|
||||
}
|
||||
field(THVL,DBF_ULONG) {
|
||||
prompt("Three Value")
|
||||
promptgroup("51 - Output 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
base(HEX)
|
||||
interest(1)
|
||||
}
|
||||
field(FRVL,DBF_ULONG) {
|
||||
prompt("Four Value")
|
||||
promptgroup("51 - Output 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
base(HEX)
|
||||
interest(1)
|
||||
}
|
||||
field(FVVL,DBF_ULONG) {
|
||||
prompt("Five Value")
|
||||
promptgroup("51 - Output 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
base(HEX)
|
||||
interest(1)
|
||||
}
|
||||
field(SXVL,DBF_ULONG) {
|
||||
prompt("Six Value")
|
||||
promptgroup("51 - Output 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
base(HEX)
|
||||
interest(1)
|
||||
}
|
||||
field(SVVL,DBF_ULONG) {
|
||||
prompt("Seven Value")
|
||||
promptgroup("51 - Output 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
base(HEX)
|
||||
interest(1)
|
||||
}
|
||||
field(EIVL,DBF_ULONG) {
|
||||
prompt("Eight Value")
|
||||
promptgroup("52 - Output 8-15")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
base(HEX)
|
||||
interest(1)
|
||||
}
|
||||
field(NIVL,DBF_ULONG) {
|
||||
prompt("Nine Value")
|
||||
promptgroup("52 - Output 8-15")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
base(HEX)
|
||||
interest(1)
|
||||
}
|
||||
field(TEVL,DBF_ULONG) {
|
||||
prompt("Ten Value")
|
||||
promptgroup("52 - Output 8-15")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
base(HEX)
|
||||
interest(1)
|
||||
}
|
||||
field(ELVL,DBF_ULONG) {
|
||||
prompt("Eleven Value")
|
||||
promptgroup("52 - Output 8-15")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
base(HEX)
|
||||
interest(1)
|
||||
}
|
||||
field(TVVL,DBF_ULONG) {
|
||||
prompt("Twelve Value")
|
||||
promptgroup("52 - Output 8-15")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
base(HEX)
|
||||
interest(1)
|
||||
}
|
||||
field(TTVL,DBF_ULONG) {
|
||||
prompt("Thirteen Value")
|
||||
promptgroup("52 - Output 8-15")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
base(HEX)
|
||||
interest(1)
|
||||
}
|
||||
field(FTVL,DBF_ULONG) {
|
||||
prompt("Fourteen Value")
|
||||
promptgroup("52 - Output 8-15")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
base(HEX)
|
||||
interest(1)
|
||||
}
|
||||
field(FFVL,DBF_ULONG) {
|
||||
prompt("Fifteen Value")
|
||||
promptgroup("52 - Output 8-15")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
base(HEX)
|
||||
interest(1)
|
||||
}
|
||||
field(ZRST,DBF_STRING) {
|
||||
prompt("Zero String")
|
||||
promptgroup("81 - Display 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
}
|
||||
field(ONST,DBF_STRING) {
|
||||
prompt("One String")
|
||||
promptgroup("81 - Display 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
}
|
||||
field(TWST,DBF_STRING) {
|
||||
prompt("Two String")
|
||||
promptgroup("81 - Display 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
}
|
||||
field(THST,DBF_STRING) {
|
||||
prompt("Three String")
|
||||
promptgroup("81 - Display 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
}
|
||||
field(FRST,DBF_STRING) {
|
||||
prompt("Four String")
|
||||
promptgroup("81 - Display 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
}
|
||||
field(FVST,DBF_STRING) {
|
||||
prompt("Five String")
|
||||
promptgroup("81 - Display 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
}
|
||||
field(SXST,DBF_STRING) {
|
||||
prompt("Six String")
|
||||
promptgroup("81 - Display 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
}
|
||||
field(SVST,DBF_STRING) {
|
||||
prompt("Seven String")
|
||||
promptgroup("81 - Display 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
}
|
||||
field(EIST,DBF_STRING) {
|
||||
prompt("Eight String")
|
||||
promptgroup("82 - Display 8-15")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
}
|
||||
field(NIST,DBF_STRING) {
|
||||
prompt("Nine String")
|
||||
promptgroup("82 - Display 8-15")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
}
|
||||
field(TEST,DBF_STRING) {
|
||||
prompt("Ten String")
|
||||
promptgroup("82 - Display 8-15")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
}
|
||||
field(ELST,DBF_STRING) {
|
||||
prompt("Eleven String")
|
||||
promptgroup("82 - Display 8-15")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
}
|
||||
field(TVST,DBF_STRING) {
|
||||
prompt("Twelve String")
|
||||
promptgroup("82 - Display 8-15")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
}
|
||||
field(TTST,DBF_STRING) {
|
||||
prompt("Thirteen String")
|
||||
promptgroup("82 - Display 8-15")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
}
|
||||
field(FTST,DBF_STRING) {
|
||||
prompt("Fourteen String")
|
||||
promptgroup("82 - Display 8-15")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
}
|
||||
field(FFST,DBF_STRING) {
|
||||
prompt("Fifteen String")
|
||||
promptgroup("82 - Display 8-15")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
}
|
||||
field(ZRSV,DBF_MENU) {
|
||||
prompt("State Zero Severity")
|
||||
promptgroup("71 - Alarm 0-7")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(ONSV,DBF_MENU) {
|
||||
prompt("State One Severity")
|
||||
promptgroup("71 - Alarm 0-7")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(TWSV,DBF_MENU) {
|
||||
prompt("State Two Severity")
|
||||
promptgroup("71 - Alarm 0-7")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(THSV,DBF_MENU) {
|
||||
prompt("State Three Severity")
|
||||
promptgroup("71 - Alarm 0-7")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(FRSV,DBF_MENU) {
|
||||
prompt("State Four Severity")
|
||||
promptgroup("71 - Alarm 0-7")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(FVSV,DBF_MENU) {
|
||||
prompt("State Five Severity")
|
||||
promptgroup("71 - Alarm 0-7")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(SXSV,DBF_MENU) {
|
||||
prompt("State Six Severity")
|
||||
promptgroup("71 - Alarm 0-7")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(SVSV,DBF_MENU) {
|
||||
prompt("State Seven Severity")
|
||||
promptgroup("71 - Alarm 0-7")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(EISV,DBF_MENU) {
|
||||
prompt("State Eight Severity")
|
||||
promptgroup("72 - Alarm 8-15")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(NISV,DBF_MENU) {
|
||||
prompt("State Nine Severity")
|
||||
promptgroup("72 - Alarm 8-15")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(TESV,DBF_MENU) {
|
||||
prompt("State Ten Severity")
|
||||
promptgroup("72 - Alarm 8-15")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(ELSV,DBF_MENU) {
|
||||
prompt("State Eleven Severity")
|
||||
promptgroup("72 - Alarm 8-15")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(TVSV,DBF_MENU) {
|
||||
prompt("State Twelve Severity")
|
||||
promptgroup("72 - Alarm 8-15")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(TTSV,DBF_MENU) {
|
||||
prompt("State Thirteen Sevr")
|
||||
promptgroup("72 - Alarm 8-15")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(FTSV,DBF_MENU) {
|
||||
prompt("State Fourteen Sevr")
|
||||
promptgroup("72 - Alarm 8-15")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(FFSV,DBF_MENU) {
|
||||
prompt("State Fifteen Sevr")
|
||||
promptgroup("72 - Alarm 8-15")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(UNSV,DBF_MENU) {
|
||||
prompt("Unknown State Sevr")
|
||||
promptgroup("70 - Alarm")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(COSV,DBF_MENU) {
|
||||
prompt("Change of State Sevr")
|
||||
promptgroup("70 - Alarm")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(RVAL,DBF_ULONG) {
|
||||
prompt("Raw Value")
|
||||
pp(TRUE)
|
||||
}
|
||||
field(ORAW,DBF_ULONG) {
|
||||
prompt("Prev Raw Value")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(RBV,DBF_ULONG) {
|
||||
prompt("Readback Value")
|
||||
special(SPC_NOMOD)
|
||||
}
|
||||
field(ORBV,DBF_ULONG) {
|
||||
prompt("Prev Readback Value")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(MASK,DBF_ULONG) {
|
||||
prompt("Hardware Mask")
|
||||
special(SPC_NOMOD)
|
||||
interest(1)
|
||||
}
|
||||
field(MLST,DBF_USHORT) {
|
||||
prompt("Last Value Monitored")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(LALM,DBF_USHORT) {
|
||||
prompt("Last Value Alarmed")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(SDEF,DBF_SHORT) {
|
||||
prompt("States Defined")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(SHFT,DBF_USHORT) {
|
||||
prompt("Shift")
|
||||
promptgroup("50 - Output")
|
||||
interest(1)
|
||||
}
|
||||
field(SIOL,DBF_OUTLINK) {
|
||||
prompt("Sim Output Specifctn")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(1)
|
||||
}
|
||||
field(SIML,DBF_INLINK) {
|
||||
prompt("Sim Mode Location")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(1)
|
||||
}
|
||||
field(SIMM,DBF_MENU) {
|
||||
prompt("Simulation Mode")
|
||||
interest(1)
|
||||
menu(menuYesNo)
|
||||
}
|
||||
field(SIMS,DBF_MENU) {
|
||||
prompt("Sim mode Alarm Svrty")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(2)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(IVOA,DBF_MENU) {
|
||||
prompt("INVALID outpt action")
|
||||
promptgroup("50 - Output")
|
||||
interest(2)
|
||||
menu(menuIvoa)
|
||||
}
|
||||
field(IVOV,DBF_USHORT) {
|
||||
prompt("INVALID output value")
|
||||
promptgroup("50 - Output")
|
||||
interest(2)
|
||||
}
|
||||
}
|
||||
942
src/std/rec/mbboRecord.dbd.pod
Normal file
942
src/std/rec/mbboRecord.dbd.pod
Normal file
@@ -0,0 +1,942 @@
|
||||
#*************************************************************************
|
||||
# Copyright (c) 2002 The University of Chicago, 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.
|
||||
#*************************************************************************
|
||||
|
||||
=title Multi-Bit Binary Output Record (mbbo)
|
||||
|
||||
The normal use for the mbbo record type is to send a binary value (representing
|
||||
one of up to 16 states) to a Digital Output module. It is used for any device
|
||||
that uses more than one contiguous bit to control it. The mbbo record can also
|
||||
be used to write discrete values to other records via database or channel access
|
||||
links.
|
||||
|
||||
=recordtype mbbo
|
||||
|
||||
=cut
|
||||
|
||||
recordtype(mbbo) {
|
||||
|
||||
=head2 Parameter Fields
|
||||
|
||||
The record-specific fields are described below, grouped by functionality.
|
||||
|
||||
=head3 Scan Parameters
|
||||
|
||||
The mbbo record has the standard fields for specifying under what circumstances
|
||||
it will be processed. These fields are listed in L<Scan Fields>. In addition,
|
||||
L<Scanning Specification> 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 multi-bit binary output record, like all output records, must specify where
|
||||
its output originates. The output mode select (OMSL) field determines whether
|
||||
the output originates from another record or from database access (i.e., the
|
||||
operator). 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 simply written. VAL can be changed via dpPuts at run-time when OMSL is
|
||||
C<<< supervisory >>>. The DOL field can also be a constant, in which case the
|
||||
VAL field is initialized to the constant value. If DOL is a constant, OMSL
|
||||
cannot be set to C<<< closed_loop >>>.
|
||||
|
||||
The VAL field itself usually consists of an index that specifies one of the
|
||||
states. The actual output written is the value of RVAL, which is converted from
|
||||
VAL following the routine explained in the next section. However, records that
|
||||
use the C<<< Soft Channel >>> device support module write the VAL field's value
|
||||
without any conversion.
|
||||
|
||||
=fields OMSL, DOL, VAL
|
||||
|
||||
=head3 Convert and Write Parameters
|
||||
|
||||
The device support routines write the desired output to the location specified
|
||||
in the OUT field. If the record uses soft device support, OUT can contain a
|
||||
constant, a database link, or a channel access link; however, if OUT is a
|
||||
constant, no value will be written.
|
||||
|
||||
For records that write their values to hardware devices, the OUT output link
|
||||
must specify the address of the I/O card, and the DTYP field must specify
|
||||
the corresponding device support module. Be aware that the address format
|
||||
differs according to the I/O bus used. See L<Address Specification> for
|
||||
information on the format of hardware addresses.
|
||||
|
||||
For mbbo records that write to hardware, the value written to the output
|
||||
location is the value contained in RVAL, which is converted from VAL, VAL
|
||||
containing an index of one of the 16 states (0-15). RVAL is then set to the
|
||||
corresponding state value, the value in one of the fields ZRVL through FFVL.
|
||||
Then this value is shifted left according to the number in the SHFT field so
|
||||
that the value is in the correct position for the bits being used (the SHFT
|
||||
value is set by device support and is not configurable by the user).
|
||||
|
||||
The state value fields ZRVL through FFVL must be configured by the user before
|
||||
run-time. When the state values are not defined, the states defined (SDEF) field
|
||||
is set to FALSE at initialization time by the record routines. When SDEF is
|
||||
FALSE, then the record processing routine does not try to find a match, RVAL is
|
||||
set equal to VAL, the bits are shifted using the number in SHFT, and the value
|
||||
is written thus.
|
||||
|
||||
If the OUT output link specifies a database link, channel access link, or
|
||||
constant, then the DTYP field must specify either one of the two soft device
|
||||
support modules-- C<<< Soft Channel >>> or C<<< Raw Soft Channel >>>. C<<< Soft
|
||||
>>> C<<< Channel >>> writes the value of VAL to the output link, without any
|
||||
conversion, while C<<< Raw Soft Channel >>> writes the value from RVAL after it
|
||||
has undergone the above conversion. See L<Address Specification> for information
|
||||
on specifying links.
|
||||
|
||||
Note also that when a string is retrieved as the desired output, a record
|
||||
support routine is provided (C<<< put_enum_str() >>>) that will check to see
|
||||
if the string matches one of the strings in the ZRST through FFST fields. If a
|
||||
match is found, RVAL is set equal to the corresponding state value of that
|
||||
string.
|
||||
|
||||
=fields OUT, DTYP, RVAL, SHFT, SDEF, ZRVL, ONVL, TWVL, THVL, FRVL, FVVL, SXVL, SVVL, EIVL, NIVL, TEVL, ELVL, TVVL, TTVL, FTVL, FFVL
|
||||
|
||||
=head3 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 mbbo record
|
||||
either textually or graphically. The ZRST-FFST fields contain strings describing
|
||||
each of the corresponding states. The C<<< get_enum_str() >>> and
|
||||
C<<< get_enum_strs() >>> record routines retrieve these strings for the
|
||||
operator. C<<< get_enum_str() >>> gets the string corresponding to the value in
|
||||
VAL, and C<<< get_enum_strs() >>> retrieves all the strings.
|
||||
|
||||
See L<Fields Common to All Record Types> for more on the record name (NAME) and
|
||||
description (DESC) fields.
|
||||
|
||||
=fields NAME, DESC, ZRST, ONST, TWST, THST, FRST, FVST, SXST, SVST, EIST, NIST, TEST, ELST, TVST, TTST, FTST, FFST
|
||||
|
||||
=head3 Alarm Parameters
|
||||
|
||||
The possible alarm conditions for multi-bit binary outputs are the SCAN, READ,
|
||||
INVALID, and state alarms. The SCAN and READ alarms are called by the support
|
||||
modules and are not configurable by the user, as their severity is always MAJOR.
|
||||
|
||||
The IVOA field specifies an action to take from a number of possible choices
|
||||
when the INVALID alarm is triggered. The IVOV field contains a value to be
|
||||
written once the INVALID alarm has been triggered if C<<< Set output to IVOV >>>
|
||||
has been chosen in the IVOA field. The severity of the INVALID alarm is not
|
||||
configurable by the user.
|
||||
|
||||
The state alarms are configured in the below severity fields. These fields have
|
||||
the usual possible values for severity fields: NO_ALARM, MINOR, and MAJOR.
|
||||
|
||||
The unknown state severity field (UNSV), if set to MINOR or MAJOR, triggers an
|
||||
alarm when the record support routine cannot find a matching value in the state
|
||||
value fields for VAL or when VAL is out of range.
|
||||
|
||||
The change of state severity field (COSV) triggers an alarm when the record's
|
||||
state changes, if set to MAJOR or MINOR.
|
||||
|
||||
The state severity (ZRSV-FFSV) fields, when set to MAJOR or MINOR, trigger an
|
||||
alarm when VAL equals the corresponding field.
|
||||
|
||||
See L<Alarm Specification> for a complete explanation of discrete alarms and
|
||||
these fields. See L<Invalid Alarm Output Action> for an explanation of the IVOA
|
||||
and IVOV fields. L<Alarm Fields> lists other fields related to a alarms that are
|
||||
common to all record types.
|
||||
|
||||
=fields UNSV, COSV, IVOA, IVOV, ZRSV, ONSV, TWSV, THSV, FRSV, FVSV, SXSV, SVSV, EISV, NISV, TESV, ELSV, TVSV, TTSV, FTSV, FFSV
|
||||
|
||||
=head3 Run-Time and Simulation Mode Parameters
|
||||
|
||||
These parameters are used by the run-time code for processing the multi-bit
|
||||
binary output.
|
||||
|
||||
MASK is used by device support routine to read the hardware register. Record
|
||||
support sets low order of MASK the number of bits specified in NOBT. Device
|
||||
support can shift this value.
|
||||
|
||||
The LALM field implements the change of state alarm severity by holding the
|
||||
value of VAL when the previous change of state alarm was issued.
|
||||
|
||||
MLST holds the value when the last monitor for value change was triggered.
|
||||
|
||||
SDEF is used by record support to save time if no states are defined; it is used
|
||||
for converting VAL to RVAL.
|
||||
|
||||
=fields NOBT, ORAW, MASK, LALM, MLST, SDEF
|
||||
|
||||
The following fields are used to operate the mbbo record in the simulation mode.
|
||||
See L<Fields Common to Many Record Types> for more information on the simulation
|
||||
mode fields.
|
||||
|
||||
=fields SIOL, SIML, SIMM, SIMS
|
||||
|
||||
=cut
|
||||
|
||||
include "dbCommon.dbd"
|
||||
field(VAL,DBF_ENUM) {
|
||||
prompt("Desired Value")
|
||||
promptgroup("50 - Output")
|
||||
special(SPC_DBADDR)
|
||||
asl(ASL0)
|
||||
pp(TRUE)
|
||||
#=read Yes
|
||||
#=write Yes
|
||||
}
|
||||
field(DOL,DBF_INLINK) {
|
||||
prompt("Desired Output Loc")
|
||||
promptgroup("40 - Input")
|
||||
interest(1)
|
||||
}
|
||||
field(OMSL,DBF_MENU) {
|
||||
prompt("Output Mode Select")
|
||||
promptgroup("50 - Output")
|
||||
interest(1)
|
||||
menu(menuOmsl)
|
||||
}
|
||||
field(NOBT,DBF_USHORT) {
|
||||
prompt("Number of Bits")
|
||||
promptgroup("50 - Output")
|
||||
special(SPC_NOMOD)
|
||||
interest(1)
|
||||
}
|
||||
field(OUT,DBF_OUTLINK) {
|
||||
prompt("Output Specification")
|
||||
promptgroup("50 - Output")
|
||||
interest(1)
|
||||
}
|
||||
field(ZRVL,DBF_ULONG) {
|
||||
prompt("Zero Value")
|
||||
promptgroup("51 - Output 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
base(HEX)
|
||||
interest(1)
|
||||
}
|
||||
field(ONVL,DBF_ULONG) {
|
||||
prompt("One Value")
|
||||
promptgroup("51 - Output 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
base(HEX)
|
||||
interest(1)
|
||||
}
|
||||
field(TWVL,DBF_ULONG) {
|
||||
prompt("Two Value")
|
||||
promptgroup("51 - Output 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
base(HEX)
|
||||
interest(1)
|
||||
}
|
||||
field(THVL,DBF_ULONG) {
|
||||
prompt("Three Value")
|
||||
promptgroup("51 - Output 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
base(HEX)
|
||||
interest(1)
|
||||
}
|
||||
field(FRVL,DBF_ULONG) {
|
||||
prompt("Four Value")
|
||||
promptgroup("51 - Output 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
base(HEX)
|
||||
interest(1)
|
||||
}
|
||||
field(FVVL,DBF_ULONG) {
|
||||
prompt("Five Value")
|
||||
promptgroup("51 - Output 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
base(HEX)
|
||||
interest(1)
|
||||
}
|
||||
field(SXVL,DBF_ULONG) {
|
||||
prompt("Six Value")
|
||||
promptgroup("51 - Output 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
base(HEX)
|
||||
interest(1)
|
||||
}
|
||||
field(SVVL,DBF_ULONG) {
|
||||
prompt("Seven Value")
|
||||
promptgroup("51 - Output 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
base(HEX)
|
||||
interest(1)
|
||||
}
|
||||
field(EIVL,DBF_ULONG) {
|
||||
prompt("Eight Value")
|
||||
promptgroup("52 - Output 8-15")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
base(HEX)
|
||||
interest(1)
|
||||
}
|
||||
field(NIVL,DBF_ULONG) {
|
||||
prompt("Nine Value")
|
||||
promptgroup("52 - Output 8-15")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
base(HEX)
|
||||
interest(1)
|
||||
}
|
||||
field(TEVL,DBF_ULONG) {
|
||||
prompt("Ten Value")
|
||||
promptgroup("52 - Output 8-15")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
base(HEX)
|
||||
interest(1)
|
||||
}
|
||||
field(ELVL,DBF_ULONG) {
|
||||
prompt("Eleven Value")
|
||||
promptgroup("52 - Output 8-15")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
base(HEX)
|
||||
interest(1)
|
||||
}
|
||||
field(TVVL,DBF_ULONG) {
|
||||
prompt("Twelve Value")
|
||||
promptgroup("52 - Output 8-15")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
base(HEX)
|
||||
interest(1)
|
||||
}
|
||||
field(TTVL,DBF_ULONG) {
|
||||
prompt("Thirteen Value")
|
||||
promptgroup("52 - Output 8-15")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
base(HEX)
|
||||
interest(1)
|
||||
}
|
||||
field(FTVL,DBF_ULONG) {
|
||||
prompt("Fourteen Value")
|
||||
promptgroup("52 - Output 8-15")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
base(HEX)
|
||||
interest(1)
|
||||
}
|
||||
field(FFVL,DBF_ULONG) {
|
||||
prompt("Fifteen Value")
|
||||
promptgroup("52 - Output 8-15")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
base(HEX)
|
||||
interest(1)
|
||||
}
|
||||
field(ZRST,DBF_STRING) {
|
||||
prompt("Zero String")
|
||||
promptgroup("81 - Display 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
}
|
||||
field(ONST,DBF_STRING) {
|
||||
prompt("One String")
|
||||
promptgroup("81 - Display 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
}
|
||||
field(TWST,DBF_STRING) {
|
||||
prompt("Two String")
|
||||
promptgroup("81 - Display 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
}
|
||||
field(THST,DBF_STRING) {
|
||||
prompt("Three String")
|
||||
promptgroup("81 - Display 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
}
|
||||
field(FRST,DBF_STRING) {
|
||||
prompt("Four String")
|
||||
promptgroup("81 - Display 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
}
|
||||
field(FVST,DBF_STRING) {
|
||||
prompt("Five String")
|
||||
promptgroup("81 - Display 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
}
|
||||
field(SXST,DBF_STRING) {
|
||||
prompt("Six String")
|
||||
promptgroup("81 - Display 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
}
|
||||
field(SVST,DBF_STRING) {
|
||||
prompt("Seven String")
|
||||
promptgroup("81 - Display 0-7")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
}
|
||||
field(EIST,DBF_STRING) {
|
||||
prompt("Eight String")
|
||||
promptgroup("82 - Display 8-15")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
}
|
||||
field(NIST,DBF_STRING) {
|
||||
prompt("Nine String")
|
||||
promptgroup("82 - Display 8-15")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
}
|
||||
field(TEST,DBF_STRING) {
|
||||
prompt("Ten String")
|
||||
promptgroup("82 - Display 8-15")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
}
|
||||
field(ELST,DBF_STRING) {
|
||||
prompt("Eleven String")
|
||||
promptgroup("82 - Display 8-15")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
}
|
||||
field(TVST,DBF_STRING) {
|
||||
prompt("Twelve String")
|
||||
promptgroup("82 - Display 8-15")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
}
|
||||
field(TTST,DBF_STRING) {
|
||||
prompt("Thirteen String")
|
||||
promptgroup("82 - Display 8-15")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
}
|
||||
field(FTST,DBF_STRING) {
|
||||
prompt("Fourteen String")
|
||||
promptgroup("82 - Display 8-15")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
}
|
||||
field(FFST,DBF_STRING) {
|
||||
prompt("Fifteen String")
|
||||
promptgroup("82 - Display 8-15")
|
||||
special(SPC_MOD)
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
}
|
||||
field(ZRSV,DBF_MENU) {
|
||||
prompt("State Zero Severity")
|
||||
promptgroup("71 - Alarm 0-7")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(ONSV,DBF_MENU) {
|
||||
prompt("State One Severity")
|
||||
promptgroup("71 - Alarm 0-7")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(TWSV,DBF_MENU) {
|
||||
prompt("State Two Severity")
|
||||
promptgroup("71 - Alarm 0-7")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(THSV,DBF_MENU) {
|
||||
prompt("State Three Severity")
|
||||
promptgroup("71 - Alarm 0-7")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(FRSV,DBF_MENU) {
|
||||
prompt("State Four Severity")
|
||||
promptgroup("71 - Alarm 0-7")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(FVSV,DBF_MENU) {
|
||||
prompt("State Five Severity")
|
||||
promptgroup("71 - Alarm 0-7")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(SXSV,DBF_MENU) {
|
||||
prompt("State Six Severity")
|
||||
promptgroup("71 - Alarm 0-7")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(SVSV,DBF_MENU) {
|
||||
prompt("State Seven Severity")
|
||||
promptgroup("71 - Alarm 0-7")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(EISV,DBF_MENU) {
|
||||
prompt("State Eight Severity")
|
||||
promptgroup("72 - Alarm 8-15")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(NISV,DBF_MENU) {
|
||||
prompt("State Nine Severity")
|
||||
promptgroup("72 - Alarm 8-15")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(TESV,DBF_MENU) {
|
||||
prompt("State Ten Severity")
|
||||
promptgroup("72 - Alarm 8-15")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(ELSV,DBF_MENU) {
|
||||
prompt("State Eleven Severity")
|
||||
promptgroup("72 - Alarm 8-15")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(TVSV,DBF_MENU) {
|
||||
prompt("State Twelve Severity")
|
||||
promptgroup("72 - Alarm 8-15")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(TTSV,DBF_MENU) {
|
||||
prompt("State Thirteen Sevr")
|
||||
promptgroup("72 - Alarm 8-15")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(FTSV,DBF_MENU) {
|
||||
prompt("State Fourteen Sevr")
|
||||
promptgroup("72 - Alarm 8-15")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(FFSV,DBF_MENU) {
|
||||
prompt("State Fifteen Sevr")
|
||||
promptgroup("72 - Alarm 8-15")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(UNSV,DBF_MENU) {
|
||||
prompt("Unknown State Sevr")
|
||||
promptgroup("70 - Alarm")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(COSV,DBF_MENU) {
|
||||
prompt("Change of State Sevr")
|
||||
promptgroup("70 - Alarm")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(RVAL,DBF_ULONG) {
|
||||
prompt("Raw Value")
|
||||
pp(TRUE)
|
||||
}
|
||||
field(ORAW,DBF_ULONG) {
|
||||
prompt("Prev Raw Value")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(RBV,DBF_ULONG) {
|
||||
prompt("Readback Value")
|
||||
special(SPC_NOMOD)
|
||||
}
|
||||
field(ORBV,DBF_ULONG) {
|
||||
prompt("Prev Readback Value")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(MASK,DBF_ULONG) {
|
||||
prompt("Hardware Mask")
|
||||
special(SPC_NOMOD)
|
||||
interest(1)
|
||||
}
|
||||
field(MLST,DBF_USHORT) {
|
||||
prompt("Last Value Monitored")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(LALM,DBF_USHORT) {
|
||||
prompt("Last Value Alarmed")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(SDEF,DBF_SHORT) {
|
||||
prompt("States Defined")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(SHFT,DBF_USHORT) {
|
||||
prompt("Shift")
|
||||
promptgroup("50 - Output")
|
||||
interest(1)
|
||||
}
|
||||
field(SIOL,DBF_OUTLINK) {
|
||||
prompt("Sim Output Specifctn")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(1)
|
||||
}
|
||||
field(SIML,DBF_INLINK) {
|
||||
prompt("Sim Mode Location")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(1)
|
||||
}
|
||||
field(SIMM,DBF_MENU) {
|
||||
prompt("Simulation Mode")
|
||||
interest(1)
|
||||
menu(menuYesNo)
|
||||
}
|
||||
field(SIMS,DBF_MENU) {
|
||||
prompt("Sim mode Alarm Svrty")
|
||||
promptgroup("90 - Simulate")
|
||||
interest(2)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(IVOA,DBF_MENU) {
|
||||
prompt("INVALID outpt action")
|
||||
promptgroup("50 - Output")
|
||||
interest(2)
|
||||
menu(menuIvoa)
|
||||
}
|
||||
field(IVOV,DBF_USHORT) {
|
||||
prompt("INVALID output value")
|
||||
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<init_record()>, it is called.
|
||||
|
||||
init_common is then called to determine if any states are defined. If states are
|
||||
defined, SDEF is set to TRUE.
|
||||
|
||||
If device support returns success, VAL is then set from RVAL and UDF is set to
|
||||
FALSE.
|
||||
|
||||
=head4 process
|
||||
|
||||
See next section.
|
||||
|
||||
=head4 special
|
||||
|
||||
Computes SDEF when any of the fields ZRVL,...FFVL change value.
|
||||
|
||||
=head4 get_value
|
||||
|
||||
Fills in the values of struct valueDes so that they refer to VAL.
|
||||
|
||||
=head4 get_enum_str
|
||||
|
||||
Retrieves ASCII string corresponding to VAL.
|
||||
|
||||
=head4 get_enum_strs
|
||||
|
||||
Retrieves ASCII strings for ZRST,...FFST.
|
||||
|
||||
=head4 put_enum_str
|
||||
|
||||
Checks if string matches ZRST,...FFST and if it does, sets VAL.
|
||||
|
||||
=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 not 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 UDF to FALSE
|
||||
|
||||
=item *
|
||||
|
||||
Check for link alarm
|
||||
|
||||
=back
|
||||
|
||||
=item *
|
||||
|
||||
If any state values are defined
|
||||
|
||||
=over
|
||||
|
||||
=item *
|
||||
|
||||
If VAL E<gt> 15, then raise alarm and go to 4
|
||||
|
||||
=item *
|
||||
|
||||
Else using VAL as index set RVAL = one of ZRVL,...FFVL
|
||||
|
||||
=back
|
||||
|
||||
=item *
|
||||
|
||||
Else set RVAL = VAL
|
||||
|
||||
=item *
|
||||
|
||||
Shift RVAL left SHFT bits
|
||||
|
||||
=back
|
||||
|
||||
=item 3.
|
||||
|
||||
Convert
|
||||
|
||||
=over
|
||||
|
||||
=item *
|
||||
|
||||
If PACT is FALSE, compute RVAL
|
||||
|
||||
=over
|
||||
|
||||
=item *
|
||||
|
||||
If VAL is 0,...,15, set RVAL from ZRVL,...,FFVL
|
||||
|
||||
=item *
|
||||
|
||||
If VAL out of range, set RVAL = undefined
|
||||
|
||||
=back
|
||||
|
||||
=item *
|
||||
|
||||
Status = write_mbbo
|
||||
|
||||
=back
|
||||
|
||||
=item 4.
|
||||
|
||||
Check alarms. This routine checks to see if the new VAL causes the alarm status
|
||||
and severity to change. If so, NSEV, NSTA and LALM are set.
|
||||
|
||||
=item 5.
|
||||
|
||||
Check severity and write the new value. See L<Simulation Mode> and L<Invalid
|
||||
Alarm Output Action> for more information.
|
||||
|
||||
=item 6.
|
||||
|
||||
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 7.
|
||||
|
||||
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 8.
|
||||
|
||||
Scan forward link if necessary, set PACT FALSE, and return.
|
||||
|
||||
=back
|
||||
|
||||
|
||||
=head2 Device Support
|
||||
|
||||
=head3 Fields Of Interest To Device Support
|
||||
|
||||
Each mbbo 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_mbbo is called. The device support routines are
|
||||
primarily interested in the following fields:
|
||||
|
||||
=fields PACT, DPVT, 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<dbior> 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<level> 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<init_record()> calls are made, with
|
||||
the integer parameter C<after> set to 0.
|
||||
The second call happens after all of the C<init_record()> calls have been made,
|
||||
with C<after> set to 1.
|
||||
|
||||
=head4 init_record
|
||||
|
||||
init_record(precord)
|
||||
|
||||
This routine is optional. If provided, it is called by the record support's
|
||||
C<init_record()> 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_mbbo
|
||||
|
||||
write_mbbo(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
|
||||
|
||||
=head4 Soft Channel
|
||||
|
||||
The C<<< Soft Channel >>> module writes the current value of VAL.
|
||||
|
||||
If the OUT link type is PV_LINK, then dbCaAddInlink is called by
|
||||
C<init_record()>.
|
||||
|
||||
write_mbbo calls recGblPutLinkValue to write the current value of VAL. See
|
||||
L<Soft Output> for more information.
|
||||
|
||||
=head4 Raw Soft Channel
|
||||
|
||||
This module writes RVAL to the location specified in the output link. It returns
|
||||
a 0.
|
||||
|
||||
=cut
|
||||
@@ -1,38 +0,0 @@
|
||||
#*************************************************************************
|
||||
# Copyright (c) 2002 The University of Chicago, 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.
|
||||
#*************************************************************************
|
||||
recordtype(permissive) {
|
||||
include "dbCommon.dbd"
|
||||
field(LABL,DBF_STRING) {
|
||||
prompt("Button Label")
|
||||
promptgroup("80 - Display")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(20)
|
||||
}
|
||||
field(VAL,DBF_USHORT) {
|
||||
prompt("Status")
|
||||
promptgroup("40 - Input")
|
||||
asl(ASL0)
|
||||
pp(TRUE)
|
||||
}
|
||||
field(OVAL,DBF_USHORT) {
|
||||
prompt("Old Status")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(WFLG,DBF_USHORT) {
|
||||
prompt("Wait Flag")
|
||||
pp(TRUE)
|
||||
}
|
||||
field(OFLG,DBF_USHORT) {
|
||||
prompt("Old Flag")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
}
|
||||
128
src/std/rec/permissiveRecord.dbd.pod
Normal file
128
src/std/rec/permissiveRecord.dbd.pod
Normal file
@@ -0,0 +1,128 @@
|
||||
#*************************************************************************
|
||||
# Copyright (c) 2002 The University of Chicago, 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.
|
||||
#*************************************************************************
|
||||
|
||||
=title Permissive Record (permissive)
|
||||
|
||||
The permissive record is for communication between a server and a client. An
|
||||
example would be a sequence program server and an operator interface client. By
|
||||
using multiple permissive records a sequence program can communicate its current
|
||||
state to the client.
|
||||
|
||||
B<Note this record is deprecated and may be removed in a future EPICS release.>
|
||||
|
||||
=recordtype permissive
|
||||
|
||||
=cut
|
||||
|
||||
recordtype(permissive) {
|
||||
include "dbCommon.dbd"
|
||||
|
||||
=head2 Parameter Fields
|
||||
|
||||
The record-specific fields are described below, grouped by functionality.
|
||||
|
||||
=head3 Scan Parameters
|
||||
|
||||
The permissive record has the standard fields for specifying under what
|
||||
circumstances the record will be processed. These fields are listed in
|
||||
L<Scan Fields>. In addition, L<Scanning Specification> explains how these
|
||||
fields are used. Since the permissive record supports no direct interfaces to
|
||||
hardware, its SCAN field cannot be C<<< I/O Intr >>>.
|
||||
|
||||
=head3 Client-server Parameters
|
||||
|
||||
The client and server communicate through the VAL and watchdog flag (WFLG)
|
||||
fields. At initialization, both fields are set equal to 0, which means OFF. The
|
||||
server sets WFLG equal to ON when it is ready to accept a request. The client
|
||||
monitors WFLG and when WFLG equals 1, the client-server action is performed (a
|
||||
private matter between server and client).
|
||||
|
||||
When WFLG is off--when the server is busy--the client program may turn the VAL
|
||||
field from OFF to ON. After the server finishes its task, it will notice that
|
||||
VAL is ON and will turn both WFLG and VAL OFF and performs the requested
|
||||
service.
|
||||
|
||||
Note that when WFLG is ON, the client program ''must not'' turn VAL to on.
|
||||
|
||||
=fields VAL, WFLG
|
||||
|
||||
=cut
|
||||
|
||||
field(VAL,DBF_USHORT) {
|
||||
prompt("Status")
|
||||
promptgroup("40 - Input")
|
||||
asl(ASL0)
|
||||
pp(TRUE)
|
||||
}
|
||||
field(WFLG,DBF_USHORT) {
|
||||
prompt("Wait Flag")
|
||||
pp(TRUE)
|
||||
}
|
||||
|
||||
=head3 Operator Display Parameters
|
||||
|
||||
The label field (LABL) contains a string given to it that should describe the
|
||||
record in further detail. In addition to the DESC field. See
|
||||
L<Fields Common to All Record Types> for more on the record name (NAME) and
|
||||
description (DESC) fields.
|
||||
|
||||
=fields LABL, NAME, DESC
|
||||
|
||||
=cut
|
||||
|
||||
field(LABL,DBF_STRING) {
|
||||
prompt("Button Label")
|
||||
promptgroup("80 - Display")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(20)
|
||||
}
|
||||
|
||||
=head3 Alarm Parameters
|
||||
|
||||
The Permissive record has the alarm parameters common to all record types.
|
||||
L<Alarm Fields> lists other fields related to a alarms that are common to all
|
||||
record types.
|
||||
|
||||
=head3 Run-time Parameters
|
||||
|
||||
These fields are used to trigger monitors for each field. Monitors for the VAL
|
||||
field are triggered when OVAL, the old value field, does not equal VAL.
|
||||
Likewise, OFLG causes monitors to be invoked for WFLG when WFLG does not equal
|
||||
OLFG.
|
||||
|
||||
=fields OVAL, OFLG
|
||||
|
||||
=cut
|
||||
|
||||
field(OVAL,DBF_USHORT) {
|
||||
prompt("Old Status")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(OFLG,DBF_USHORT) {
|
||||
prompt("Old Flag")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
|
||||
=head2 Record Support
|
||||
|
||||
=head3 Record Support Routines
|
||||
|
||||
=head4 process
|
||||
|
||||
long (*process)(struct dbCommon *precord)
|
||||
|
||||
C<<< process() >>> sets UDF to FALSE, triggers monitors on VAL and WFLG when
|
||||
they change, and scans the forward link if necessary.
|
||||
|
||||
=cut
|
||||
|
||||
}
|
||||
@@ -1,323 +0,0 @@
|
||||
#*************************************************************************
|
||||
# Copyright (c) 2002 The University of Chicago, 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.
|
||||
#*************************************************************************
|
||||
menu(selSELM) {
|
||||
choice(selSELM_Specified,"Specified")
|
||||
choice(selSELM_High_Signal,"High Signal")
|
||||
choice(selSELM_Low_Signal,"Low Signal")
|
||||
choice(selSELM_Median_Signal,"Median Signal")
|
||||
}
|
||||
recordtype(sel) {
|
||||
include "dbCommon.dbd"
|
||||
field(VAL,DBF_DOUBLE) {
|
||||
prompt("Result")
|
||||
promptgroup("40 - Input")
|
||||
asl(ASL0)
|
||||
special(SPC_NOMOD)
|
||||
}
|
||||
field(SELM,DBF_MENU) {
|
||||
prompt("Select Mechanism")
|
||||
promptgroup("30 - Action")
|
||||
menu(selSELM)
|
||||
}
|
||||
field(SELN,DBF_USHORT) {
|
||||
prompt("Index value")
|
||||
}
|
||||
field(PREC,DBF_SHORT) {
|
||||
prompt("Display Precision")
|
||||
promptgroup("80 - Display")
|
||||
interest(1)
|
||||
}
|
||||
field(NVL,DBF_INLINK) {
|
||||
prompt("Index Value Location")
|
||||
promptgroup("30 - Action")
|
||||
interest(1)
|
||||
}
|
||||
field(INPA,DBF_INLINK) {
|
||||
prompt("Input A")
|
||||
promptgroup("41 - Input A-F")
|
||||
interest(1)
|
||||
}
|
||||
field(INPB,DBF_INLINK) {
|
||||
prompt("Input B")
|
||||
promptgroup("41 - Input A-F")
|
||||
interest(1)
|
||||
}
|
||||
field(INPC,DBF_INLINK) {
|
||||
prompt("Input C")
|
||||
promptgroup("41 - Input A-F")
|
||||
interest(1)
|
||||
}
|
||||
field(INPD,DBF_INLINK) {
|
||||
prompt("Input D")
|
||||
promptgroup("41 - Input A-F")
|
||||
interest(1)
|
||||
}
|
||||
field(INPE,DBF_INLINK) {
|
||||
prompt("Input E")
|
||||
promptgroup("41 - Input A-F")
|
||||
interest(1)
|
||||
}
|
||||
field(INPF,DBF_INLINK) {
|
||||
prompt("Input F")
|
||||
promptgroup("41 - Input A-F")
|
||||
interest(1)
|
||||
}
|
||||
field(INPG,DBF_INLINK) {
|
||||
prompt("Input G")
|
||||
promptgroup("42 - Input G-L")
|
||||
interest(1)
|
||||
}
|
||||
field(INPH,DBF_INLINK) {
|
||||
prompt("Input H")
|
||||
promptgroup("42 - Input G-L")
|
||||
interest(1)
|
||||
}
|
||||
field(INPI,DBF_INLINK) {
|
||||
prompt("Input I")
|
||||
promptgroup("42 - Input G-L")
|
||||
interest(1)
|
||||
}
|
||||
field(INPJ,DBF_INLINK) {
|
||||
prompt("Input J")
|
||||
promptgroup("42 - Input G-L")
|
||||
interest(1)
|
||||
}
|
||||
field(INPK,DBF_INLINK) {
|
||||
prompt("Input K")
|
||||
promptgroup("42 - Input G-L")
|
||||
interest(1)
|
||||
}
|
||||
field(INPL,DBF_INLINK) {
|
||||
prompt("Input L")
|
||||
promptgroup("42 - Input G-L")
|
||||
interest(1)
|
||||
}
|
||||
field(EGU,DBF_STRING) {
|
||||
prompt("Engineering Units")
|
||||
promptgroup("80 - Display")
|
||||
interest(1)
|
||||
size(16)
|
||||
prop(YES)
|
||||
}
|
||||
field(HOPR,DBF_DOUBLE) {
|
||||
prompt("High Operating Rng")
|
||||
promptgroup("80 - Display")
|
||||
interest(1)
|
||||
prop(YES)
|
||||
}
|
||||
field(LOPR,DBF_DOUBLE) {
|
||||
prompt("Low Operating Range")
|
||||
promptgroup("80 - Display")
|
||||
interest(1)
|
||||
prop(YES)
|
||||
}
|
||||
field(HIHI,DBF_DOUBLE) {
|
||||
prompt("Hihi Alarm Limit")
|
||||
promptgroup("70 - Alarm")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
prop(YES)
|
||||
}
|
||||
field(LOLO,DBF_DOUBLE) {
|
||||
prompt("Lolo Alarm Limit")
|
||||
promptgroup("70 - Alarm")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
prop(YES)
|
||||
}
|
||||
field(HIGH,DBF_DOUBLE) {
|
||||
prompt("High Alarm Limit")
|
||||
promptgroup("70 - Alarm")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
prop(YES)
|
||||
}
|
||||
field(LOW,DBF_DOUBLE) {
|
||||
prompt("Low Alarm Limit")
|
||||
promptgroup("70 - Alarm")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
prop(YES)
|
||||
}
|
||||
field(HHSV,DBF_MENU) {
|
||||
prompt("Hihi Severity")
|
||||
promptgroup("70 - Alarm")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
prop(YES)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(LLSV,DBF_MENU) {
|
||||
prompt("Lolo Severity")
|
||||
promptgroup("70 - Alarm")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
prop(YES)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(HSV,DBF_MENU) {
|
||||
prompt("High Severity")
|
||||
promptgroup("70 - Alarm")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
prop(YES)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(LSV,DBF_MENU) {
|
||||
prompt("Low Severity")
|
||||
promptgroup("70 - Alarm")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
prop(YES)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(HYST,DBF_DOUBLE) {
|
||||
prompt("Alarm Deadband")
|
||||
promptgroup("70 - Alarm")
|
||||
interest(1)
|
||||
}
|
||||
field(ADEL,DBF_DOUBLE) {
|
||||
prompt("Archive Deadband")
|
||||
promptgroup("80 - Display")
|
||||
interest(1)
|
||||
}
|
||||
field(MDEL,DBF_DOUBLE) {
|
||||
prompt("Monitor Deadband")
|
||||
promptgroup("80 - Display")
|
||||
interest(1)
|
||||
}
|
||||
field(A,DBF_DOUBLE) {
|
||||
prompt("Value of Input A")
|
||||
pp(TRUE)
|
||||
}
|
||||
field(B,DBF_DOUBLE) {
|
||||
prompt("Value of Input B")
|
||||
pp(TRUE)
|
||||
}
|
||||
field(C,DBF_DOUBLE) {
|
||||
prompt("Value of Input C")
|
||||
pp(TRUE)
|
||||
}
|
||||
field(D,DBF_DOUBLE) {
|
||||
prompt("Value of Input D")
|
||||
pp(TRUE)
|
||||
}
|
||||
field(E,DBF_DOUBLE) {
|
||||
prompt("Value of Input E")
|
||||
pp(TRUE)
|
||||
}
|
||||
field(F,DBF_DOUBLE) {
|
||||
prompt("Value of Input F")
|
||||
pp(TRUE)
|
||||
}
|
||||
field(G,DBF_DOUBLE) {
|
||||
prompt("Value of Input G")
|
||||
pp(TRUE)
|
||||
}
|
||||
field(H,DBF_DOUBLE) {
|
||||
prompt("Value of Input H")
|
||||
pp(TRUE)
|
||||
}
|
||||
field(I,DBF_DOUBLE) {
|
||||
prompt("Value of Input I")
|
||||
pp(TRUE)
|
||||
}
|
||||
field(J,DBF_DOUBLE) {
|
||||
prompt("Value of Input J")
|
||||
pp(TRUE)
|
||||
}
|
||||
field(K,DBF_DOUBLE) {
|
||||
prompt("Value of Input K")
|
||||
pp(TRUE)
|
||||
}
|
||||
field(L,DBF_DOUBLE) {
|
||||
prompt("Value of Input L")
|
||||
pp(TRUE)
|
||||
}
|
||||
field(LA,DBF_DOUBLE) {
|
||||
prompt("Prev Value of A")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(LB,DBF_DOUBLE) {
|
||||
prompt("Prev Value of B")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(LC,DBF_DOUBLE) {
|
||||
prompt("Prev Value of C")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(LD,DBF_DOUBLE) {
|
||||
prompt("Prev Value of D")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(LE,DBF_DOUBLE) {
|
||||
prompt("Prev Value of E")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(LF,DBF_DOUBLE) {
|
||||
prompt("Prev Value of F")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(LG,DBF_DOUBLE) {
|
||||
prompt("Prev Value of G")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(LH,DBF_DOUBLE) {
|
||||
prompt("Prev Value of H")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(LI,DBF_DOUBLE) {
|
||||
prompt("Prev Value of I")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(LJ,DBF_DOUBLE) {
|
||||
prompt("Prev Value of J")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(LK,DBF_DOUBLE) {
|
||||
prompt("Prev Value of K")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(LL,DBF_DOUBLE) {
|
||||
prompt("Prev Value of L")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(LALM,DBF_DOUBLE) {
|
||||
prompt("Last Value Alarmed")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(ALST,DBF_DOUBLE) {
|
||||
prompt("Last Value Archived")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(MLST,DBF_DOUBLE) {
|
||||
prompt("Last Val Monitored")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(NLST,DBF_USHORT) {
|
||||
prompt("Last Index Monitored")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
}
|
||||
594
src/std/rec/selRecord.dbd.pod
Normal file
594
src/std/rec/selRecord.dbd.pod
Normal file
@@ -0,0 +1,594 @@
|
||||
#*************************************************************************
|
||||
# Copyright (c) 2002 The University of Chicago, 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.
|
||||
#*************************************************************************
|
||||
|
||||
=title Select Record (sel)
|
||||
|
||||
The select record computes a value based on input obtained from up to 12
|
||||
locations. The selection algorithm can be one of the following: C<<< Specified
|
||||
>>>, C<<< High Signal >>>, C<<< Low Signal >>>, C<<< Median Signal >>>. Each
|
||||
input can be a constant, a database link, or a channel access link.
|
||||
|
||||
=recordtype sel
|
||||
|
||||
=cut
|
||||
|
||||
menu(selSELM) {
|
||||
choice(selSELM_Specified,"Specified")
|
||||
choice(selSELM_High_Signal,"High Signal")
|
||||
choice(selSELM_Low_Signal,"Low Signal")
|
||||
choice(selSELM_Median_Signal,"Median Signal")
|
||||
}
|
||||
recordtype(sel) {
|
||||
|
||||
=head2 Parameter Fields
|
||||
|
||||
The record-specific fields are described below, grouped by functionality.
|
||||
|
||||
=head3 Scan Parameters
|
||||
|
||||
The select record has the standard fields for specifying under what
|
||||
circumstances the record will be processed. These fields are listed in
|
||||
L<Scan Fields>. In addition, L<Scanning Specification>
|
||||
explains how these fields work.
|
||||
|
||||
=head3 Read Parameters
|
||||
|
||||
The INPA-L links determine where the selection record retrieves the values from
|
||||
which it is to select or compute its final value. The INPA-L links are input
|
||||
links configured by the user to be either constants, channel access links, or
|
||||
database links. If channel access or database links, a value is retrieved for
|
||||
each link and placed in the corresponding value field, A-L. If any input link is
|
||||
a constant, the value field for that link will be initialized with the constant
|
||||
value given to it and can be modified via dbPuts. See L<Address Specification>
|
||||
for information on how to specify database links.
|
||||
|
||||
Any links not defined are ignored by the selection record and its algorithm. An
|
||||
undefined link is any constant link whose value is 0. At initialization time,
|
||||
the corresponding value links for such fields are set to NaN, which means
|
||||
MISSING. The value field of an undefined link can be changed at run-time from
|
||||
NaN to another value in order to define the link and its field. Note that all
|
||||
undefined links must be recognized as such if the selection algorithm is to work
|
||||
as expected.
|
||||
|
||||
=fields INPA, INPB, INPC, INPD, INPE, INPF, INPG, INPH, INPI, INPJ, INPK, INPL, A, B, C, D, E, F, G, H, I, J, K, L
|
||||
|
||||
=head3 Select Parameters
|
||||
|
||||
The selection algorithm is determined by three fields configurable by the user:
|
||||
the select mechanism (SELM) field, the select number (SELN) field, and the index
|
||||
value location (NVL) field.
|
||||
|
||||
The SELM field has four choices, i.e., four algorithms as follows:
|
||||
|
||||
=head4 Menu selSELM
|
||||
|
||||
=menu selSELM
|
||||
|
||||
The selection record's VAL field is determined differently for each algorithm.
|
||||
For C<<< Specified >>>, the VAL field is set equal to the value field (A, B, C,
|
||||
D, E, F, G, H, I, J, K, or L) specified by the SELN field. The SELN field
|
||||
contains a
|
||||
number from 0-11 which corresponds to the value field to be used (0 means use A;
|
||||
1 means use B, etc.). How the NVL field is configured determines, in turn,
|
||||
SELN's value. NVL is an input link from which a value for SELN can be retrieved,
|
||||
Like most other input links NVL can be a constant, or a channel access or
|
||||
database link. If NVL is a link, SELN is retrieved from the location in NVL. If
|
||||
a constant, SELN is initialized to the value given to the constant and can be
|
||||
changed via dbPuts. See L<Address Specification> for information on how to
|
||||
specify database links.
|
||||
|
||||
The C<<< High Signal >>>, C<<< Low Signal >>>, and C<<< Median Signal >>>
|
||||
algorithms do not use SELN or NVL. If C<<< High Signal >>> is chosen, VAL is set
|
||||
equal to the highest value out of all the defined value fields (A-L). If C<<<
|
||||
Low Signal >>> is chosen, VAL is set equal to lowest value of all the defined
|
||||
fields (A-L). And if C<<< Median Signal >>> is chosen, VAL is set equal to the
|
||||
median value of the defined value fields (A-L). (Note that these algorithms
|
||||
select from the value fields; they do not select from the value field index. For
|
||||
instance, C<<< Low Signal >>> will not select the A field's value unless the
|
||||
value itself is the lowest of all the defined values.)
|
||||
|
||||
=fields SELM, SELN, NVL
|
||||
|
||||
=head3 Operator Display Parameters
|
||||
|
||||
These parameters are used to present meaningful data to the operator. They
|
||||
display the value and other parameters of the select record either textually or
|
||||
graphically.
|
||||
|
||||
EGU is a string of up to 16 characters describing the units that the selection
|
||||
record manipulates. It is retrieved by the C<<< get_units >>> record support
|
||||
routine.
|
||||
|
||||
The HOPR and LOPR fields set the upper and lower display limits for the VAL,
|
||||
HIHI, HIGH, LOW, and LOLO fields. Both the C<<< get_graphic_double >>> and C<<<
|
||||
get_control_double >>> record support routines retrieve these fields.
|
||||
|
||||
The PREC field determines the floating point precision with which to display
|
||||
VAL. It is used whenever the C<<< get_precision >>> record support routine is
|
||||
called.
|
||||
|
||||
See L<Fields Common to All Record Types> for more on the record name (NAME)
|
||||
and description (DESC) fields.
|
||||
|
||||
=fields EGU, HOPR, LOPR, PREC, NAME, DESC
|
||||
|
||||
=head3 Alarm Parameters
|
||||
|
||||
The possible alarm conditions for select records are the SCAN, READ, and limit
|
||||
alarms. The SCAN and READ alarms are called by the record or device support
|
||||
routines. The limit alarms are configured by the user in the HIHI, LOLO, HIGH,
|
||||
and LOW fields using numerical values. They specify conditions for the VAL
|
||||
field. For each of these fields, there is a corresponding severity field which
|
||||
can be either NO_ALARM, MINOR, or MAJOR. See L<Alarm Specification>
|
||||
for a complete explanation of alarms and these fields. L<Alarm Fields>
|
||||
lists other fields related to a alarms that are common to all record types.
|
||||
|
||||
=fields HIHI, HIGH, LOW, LOLO, HHSV, HSV, LSV, LLSV, HYST
|
||||
|
||||
=head3 Monitor Parameters
|
||||
|
||||
These fields are configurable by the user. They are used as deadbands for the
|
||||
archiver and monitor calls for the VAL field. Unless, VAL changes by more than
|
||||
the value specified by each, then the respective monitors will not be called. If
|
||||
these fields have a value of zero, everytime the VAL changes, monitors are
|
||||
triggered; if they have a value of -1, everytime the record is processed,
|
||||
monitors are triggered. L<Monitor Specification>
|
||||
gives a complete explanation of alarms and deadbands.
|
||||
|
||||
=fields ADEL, MDEL
|
||||
|
||||
=head3 Run-time Parameters
|
||||
|
||||
These parameters are used by the run-time code for processing the selection
|
||||
record. They are not configurable prior to run-time, nor are they modifiable at
|
||||
run-time. They represent the current state of the record. The record support
|
||||
routines use some of them for more efficient processing.
|
||||
|
||||
The VAL field is the result of the selection record's processing. It can be
|
||||
accessed in the normal way by another record or through database access, but is
|
||||
not modifiable except by the record itself. The LALM, ALST, and the MLST are
|
||||
used to implement the HYST, ADEL, and MDEL hysteresis factors for the alarms,
|
||||
archiver, and monitors, respectively.
|
||||
|
||||
The LA-LL fields are used to implement the monitors for each of the value
|
||||
fields, A-L. They represent previous input values. For example, unless LA is not
|
||||
equal to A, no monitor is invoked for A.
|
||||
|
||||
=fields VAL, LALM, ALST, MLST, LA, LB, LC, LD, LE, LF, LG, LH, LI, LJ, LK, LL
|
||||
|
||||
=head2 Record Support
|
||||
|
||||
=head3 Record Support Routines
|
||||
|
||||
=head4 init_record
|
||||
|
||||
long (*init_record)(struct dbCommon *precord, int pass)
|
||||
|
||||
IF NVL is a constant, SELN is set to its value. If NVL is a PV_LINK a channel
|
||||
access link is created.
|
||||
|
||||
For each constant input link, the corresponding value field is initialized with
|
||||
the constant value (or NaN if the constant has the value 0).
|
||||
|
||||
For each input link that is of type PV_LINK, a database or channel access link
|
||||
is created.
|
||||
|
||||
=head4 process
|
||||
|
||||
long (*process)(struct dbCommon *precord)
|
||||
|
||||
See L<Record Processing>.
|
||||
|
||||
=head4 get_units
|
||||
|
||||
long (*get_units)(struct dbAddr *paddr, char *units)
|
||||
|
||||
Retrieves EGU.
|
||||
|
||||
=head4 get_precision
|
||||
|
||||
long (*get_precision)(const struct dbAddr *paddr, long *precision)
|
||||
|
||||
Retrieves PREC.
|
||||
|
||||
=head4 get_graphic_double
|
||||
|
||||
long (*get_graphic_double)(struct dbAddr *paddr, struct dbr_grDouble *p)
|
||||
|
||||
Sets the upper display and lower display limits for a field. If the field is
|
||||
VAL, HIHI, HIGH, LOW, or LOLO, the limits are set to HOPR and LOPR, else if the
|
||||
field has upper and lower limits defined they will be used, else the upper and
|
||||
lower maximum values for the field type will be used.
|
||||
|
||||
=head4 get_control_double
|
||||
|
||||
long (*get_control_double)(struct dbAddr *paddr, struct dbr_ctrlDouble *p)
|
||||
|
||||
Sets the upper control and the lower control limits for a field. If the field is
|
||||
VAL, HIHI, HIGH, LOW, or LOLO, the limits are set to HOPR and LOPR, else if the
|
||||
field has upper and lower limits defined they will be used, else the upper and
|
||||
lower maximum values for the field type will be used.
|
||||
|
||||
=head4 get_alarm_double
|
||||
|
||||
long (*get_alarm_double)(struct dbAddr *paddr, struct dbr_alDouble *p)
|
||||
|
||||
Sets the following values:
|
||||
|
||||
upper_alarm_limit = HIHI
|
||||
upper_warning_limit = HIGH
|
||||
lower_warning_limit = LOW
|
||||
lower_alarm_limit = LOLO
|
||||
|
||||
=head3 Record Processing
|
||||
|
||||
Routine process implements the following algorithm:
|
||||
|
||||
=over
|
||||
|
||||
=item 1.
|
||||
|
||||
If NVL is a database or channel access link, SELN is obtained from NVL. Fetch
|
||||
all values if database or channel access links. If SELM is SELECTED, then only
|
||||
the selected link is fetched.
|
||||
|
||||
=item 2.
|
||||
|
||||
Implement the appropriate selection algorithm. For SELECT_HIGH, SELECT_LOW, and
|
||||
SELECT_MEDIAN, input fields are ignored if they are undefined. If success, UDF
|
||||
is set to FALSE.
|
||||
|
||||
=item 3.
|
||||
|
||||
Check alarms. This routine checks to see if the new VAL causes the alarm status
|
||||
and severity to change. If so, NSEV, NSTA, and LALM are set. It also honors the
|
||||
alarm hysteresis factor (HYST). Thus the value must change by more than HYST
|
||||
before the alarm status and severity is lowered.
|
||||
|
||||
=item 4.
|
||||
|
||||
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 ADEL and MDEL conditions are
|
||||
met
|
||||
|
||||
=item *
|
||||
|
||||
Monitors for A-L are checked whenever other monitors are invoked
|
||||
|
||||
=item *
|
||||
|
||||
NSEV and NSTA are reset to 0.
|
||||
|
||||
=back
|
||||
|
||||
=item 5.
|
||||
|
||||
Scan forward link if necessary, set PACT FALSE, and return.
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
include "dbCommon.dbd"
|
||||
field(VAL,DBF_DOUBLE) {
|
||||
prompt("Result")
|
||||
promptgroup("40 - Input")
|
||||
asl(ASL0)
|
||||
special(SPC_NOMOD)
|
||||
}
|
||||
field(SELM,DBF_MENU) {
|
||||
prompt("Select Mechanism")
|
||||
promptgroup("30 - Action")
|
||||
menu(selSELM)
|
||||
}
|
||||
field(SELN,DBF_USHORT) {
|
||||
prompt("Index value")
|
||||
}
|
||||
field(PREC,DBF_SHORT) {
|
||||
prompt("Display Precision")
|
||||
promptgroup("80 - Display")
|
||||
interest(1)
|
||||
}
|
||||
field(NVL,DBF_INLINK) {
|
||||
prompt("Index Value Location")
|
||||
promptgroup("30 - Action")
|
||||
interest(1)
|
||||
}
|
||||
field(INPA,DBF_INLINK) {
|
||||
prompt("Input A")
|
||||
promptgroup("41 - Input A-F")
|
||||
interest(1)
|
||||
}
|
||||
field(INPB,DBF_INLINK) {
|
||||
prompt("Input B")
|
||||
promptgroup("41 - Input A-F")
|
||||
interest(1)
|
||||
}
|
||||
field(INPC,DBF_INLINK) {
|
||||
prompt("Input C")
|
||||
promptgroup("41 - Input A-F")
|
||||
interest(1)
|
||||
}
|
||||
field(INPD,DBF_INLINK) {
|
||||
prompt("Input D")
|
||||
promptgroup("41 - Input A-F")
|
||||
interest(1)
|
||||
}
|
||||
field(INPE,DBF_INLINK) {
|
||||
prompt("Input E")
|
||||
promptgroup("41 - Input A-F")
|
||||
interest(1)
|
||||
}
|
||||
field(INPF,DBF_INLINK) {
|
||||
prompt("Input F")
|
||||
promptgroup("41 - Input A-F")
|
||||
interest(1)
|
||||
}
|
||||
field(INPG,DBF_INLINK) {
|
||||
prompt("Input G")
|
||||
promptgroup("42 - Input G-L")
|
||||
interest(1)
|
||||
}
|
||||
field(INPH,DBF_INLINK) {
|
||||
prompt("Input H")
|
||||
promptgroup("42 - Input G-L")
|
||||
interest(1)
|
||||
}
|
||||
field(INPI,DBF_INLINK) {
|
||||
prompt("Input I")
|
||||
promptgroup("42 - Input G-L")
|
||||
interest(1)
|
||||
}
|
||||
field(INPJ,DBF_INLINK) {
|
||||
prompt("Input J")
|
||||
promptgroup("42 - Input G-L")
|
||||
interest(1)
|
||||
}
|
||||
field(INPK,DBF_INLINK) {
|
||||
prompt("Input K")
|
||||
promptgroup("42 - Input G-L")
|
||||
interest(1)
|
||||
}
|
||||
field(INPL,DBF_INLINK) {
|
||||
prompt("Input L")
|
||||
promptgroup("42 - Input G-L")
|
||||
interest(1)
|
||||
}
|
||||
field(EGU,DBF_STRING) {
|
||||
prompt("Engineering Units")
|
||||
promptgroup("80 - Display")
|
||||
interest(1)
|
||||
size(16)
|
||||
prop(YES)
|
||||
}
|
||||
field(HOPR,DBF_DOUBLE) {
|
||||
prompt("High Operating Rng")
|
||||
promptgroup("80 - Display")
|
||||
interest(1)
|
||||
prop(YES)
|
||||
}
|
||||
field(LOPR,DBF_DOUBLE) {
|
||||
prompt("Low Operating Range")
|
||||
promptgroup("80 - Display")
|
||||
interest(1)
|
||||
prop(YES)
|
||||
}
|
||||
field(HIHI,DBF_DOUBLE) {
|
||||
prompt("Hihi Alarm Limit")
|
||||
promptgroup("70 - Alarm")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
prop(YES)
|
||||
}
|
||||
field(LOLO,DBF_DOUBLE) {
|
||||
prompt("Lolo Alarm Limit")
|
||||
promptgroup("70 - Alarm")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
prop(YES)
|
||||
}
|
||||
field(HIGH,DBF_DOUBLE) {
|
||||
prompt("High Alarm Limit")
|
||||
promptgroup("70 - Alarm")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
prop(YES)
|
||||
}
|
||||
field(LOW,DBF_DOUBLE) {
|
||||
prompt("Low Alarm Limit")
|
||||
promptgroup("70 - Alarm")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
prop(YES)
|
||||
}
|
||||
field(HHSV,DBF_MENU) {
|
||||
prompt("Hihi Severity")
|
||||
promptgroup("70 - Alarm")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
prop(YES)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(LLSV,DBF_MENU) {
|
||||
prompt("Lolo Severity")
|
||||
promptgroup("70 - Alarm")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
prop(YES)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(HSV,DBF_MENU) {
|
||||
prompt("High Severity")
|
||||
promptgroup("70 - Alarm")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
prop(YES)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(LSV,DBF_MENU) {
|
||||
prompt("Low Severity")
|
||||
promptgroup("70 - Alarm")
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
prop(YES)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
field(HYST,DBF_DOUBLE) {
|
||||
prompt("Alarm Deadband")
|
||||
promptgroup("70 - Alarm")
|
||||
interest(1)
|
||||
}
|
||||
field(ADEL,DBF_DOUBLE) {
|
||||
prompt("Archive Deadband")
|
||||
promptgroup("80 - Display")
|
||||
interest(1)
|
||||
}
|
||||
field(MDEL,DBF_DOUBLE) {
|
||||
prompt("Monitor Deadband")
|
||||
promptgroup("80 - Display")
|
||||
interest(1)
|
||||
}
|
||||
field(A,DBF_DOUBLE) {
|
||||
prompt("Value of Input A")
|
||||
pp(TRUE)
|
||||
}
|
||||
field(B,DBF_DOUBLE) {
|
||||
prompt("Value of Input B")
|
||||
pp(TRUE)
|
||||
}
|
||||
field(C,DBF_DOUBLE) {
|
||||
prompt("Value of Input C")
|
||||
pp(TRUE)
|
||||
}
|
||||
field(D,DBF_DOUBLE) {
|
||||
prompt("Value of Input D")
|
||||
pp(TRUE)
|
||||
}
|
||||
field(E,DBF_DOUBLE) {
|
||||
prompt("Value of Input E")
|
||||
pp(TRUE)
|
||||
}
|
||||
field(F,DBF_DOUBLE) {
|
||||
prompt("Value of Input F")
|
||||
pp(TRUE)
|
||||
}
|
||||
field(G,DBF_DOUBLE) {
|
||||
prompt("Value of Input G")
|
||||
pp(TRUE)
|
||||
}
|
||||
field(H,DBF_DOUBLE) {
|
||||
prompt("Value of Input H")
|
||||
pp(TRUE)
|
||||
}
|
||||
field(I,DBF_DOUBLE) {
|
||||
prompt("Value of Input I")
|
||||
pp(TRUE)
|
||||
}
|
||||
field(J,DBF_DOUBLE) {
|
||||
prompt("Value of Input J")
|
||||
pp(TRUE)
|
||||
}
|
||||
field(K,DBF_DOUBLE) {
|
||||
prompt("Value of Input K")
|
||||
pp(TRUE)
|
||||
}
|
||||
field(L,DBF_DOUBLE) {
|
||||
prompt("Value of Input L")
|
||||
pp(TRUE)
|
||||
}
|
||||
field(LA,DBF_DOUBLE) {
|
||||
prompt("Prev Value of A")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(LB,DBF_DOUBLE) {
|
||||
prompt("Prev Value of B")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(LC,DBF_DOUBLE) {
|
||||
prompt("Prev Value of C")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(LD,DBF_DOUBLE) {
|
||||
prompt("Prev Value of D")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(LE,DBF_DOUBLE) {
|
||||
prompt("Prev Value of E")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(LF,DBF_DOUBLE) {
|
||||
prompt("Prev Value of F")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(LG,DBF_DOUBLE) {
|
||||
prompt("Prev Value of G")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(LH,DBF_DOUBLE) {
|
||||
prompt("Prev Value of H")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(LI,DBF_DOUBLE) {
|
||||
prompt("Prev Value of I")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(LJ,DBF_DOUBLE) {
|
||||
prompt("Prev Value of J")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(LK,DBF_DOUBLE) {
|
||||
prompt("Prev Value of K")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(LL,DBF_DOUBLE) {
|
||||
prompt("Prev Value of L")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(LALM,DBF_DOUBLE) {
|
||||
prompt("Last Value Alarmed")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(ALST,DBF_DOUBLE) {
|
||||
prompt("Last Value Archived")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(MLST,DBF_DOUBLE) {
|
||||
prompt("Last Val Monitored")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(NLST,DBF_USHORT) {
|
||||
prompt("Last Index Monitored")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
}
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
static void processNextLink(seqRecord *prec);
|
||||
static long asyncFinish(seqRecord *prec);
|
||||
static void processCallback(CALLBACK *arg);
|
||||
static void processCallback(epicsCallback *arg);
|
||||
|
||||
/* Create RSET - Record Support Entry Table*/
|
||||
#define report NULL
|
||||
@@ -94,7 +94,7 @@ typedef struct linkGrp {
|
||||
|
||||
/* The list of link-groups for processing */
|
||||
typedef struct seqRecPvt {
|
||||
CALLBACK callback;
|
||||
epicsCallback callback;
|
||||
seqRecord *prec;
|
||||
linkGrp *grps[NUM_LINKS + 1]; /* List of link-groups */
|
||||
int index; /* Where we are now */
|
||||
@@ -241,7 +241,7 @@ static long asyncFinish(seqRecord *prec)
|
||||
}
|
||||
|
||||
|
||||
static void processCallback(CALLBACK *arg)
|
||||
static void processCallback(epicsCallback *arg)
|
||||
{
|
||||
seqRecPvt *pcb;
|
||||
seqRecord *prec;
|
||||
|
||||
@@ -1,365 +0,0 @@
|
||||
#*************************************************************************
|
||||
# Copyright (c) 2012 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.
|
||||
#*************************************************************************
|
||||
menu(seqSELM) {
|
||||
choice(seqSELM_All,"All")
|
||||
choice(seqSELM_Specified,"Specified")
|
||||
choice(seqSELM_Mask,"Mask")
|
||||
}
|
||||
recordtype(seq) {
|
||||
include "dbCommon.dbd"
|
||||
field(VAL,DBF_LONG) {
|
||||
prompt("Used to trigger")
|
||||
asl(ASL0)
|
||||
pp(TRUE)
|
||||
}
|
||||
field(SELM,DBF_MENU) {
|
||||
prompt("Select Mechanism")
|
||||
promptgroup("30 - Action")
|
||||
interest(1)
|
||||
menu(seqSELM)
|
||||
}
|
||||
field(SELN,DBF_USHORT) {
|
||||
prompt("Link Selection")
|
||||
interest(1)
|
||||
initial("1")
|
||||
}
|
||||
field(SELL,DBF_INLINK) {
|
||||
prompt("Link Selection Loc")
|
||||
promptgroup("30 - Action")
|
||||
interest(1)
|
||||
}
|
||||
field(OFFS,DBF_SHORT) {
|
||||
prompt("Offset for Specified")
|
||||
promptgroup("30 - Action")
|
||||
interest(1)
|
||||
initial("0")
|
||||
}
|
||||
field(SHFT,DBF_SHORT) {
|
||||
prompt("Shift for Mask mode")
|
||||
promptgroup("30 - Action")
|
||||
interest(1)
|
||||
initial("-1")
|
||||
}
|
||||
field(OLDN,DBF_USHORT) {
|
||||
prompt("Old Selection")
|
||||
interest(4)
|
||||
}
|
||||
field(PREC,DBF_SHORT) {
|
||||
prompt("Display Precision")
|
||||
promptgroup("80 - Display")
|
||||
interest(1)
|
||||
}
|
||||
field(DLY0,DBF_DOUBLE) {
|
||||
prompt("Delay 0")
|
||||
promptgroup("41 - Link 0-7")
|
||||
interest(1)
|
||||
}
|
||||
field(DOL0,DBF_INLINK) {
|
||||
prompt("Input link 0")
|
||||
promptgroup("41 - Link 0-7")
|
||||
interest(1)
|
||||
}
|
||||
field(DO0,DBF_DOUBLE) {
|
||||
prompt("Value 0")
|
||||
interest(1)
|
||||
}
|
||||
field(LNK0,DBF_OUTLINK) {
|
||||
prompt("Output Link 0")
|
||||
promptgroup("41 - Link 0-7")
|
||||
interest(1)
|
||||
}
|
||||
field(DLY1,DBF_DOUBLE) {
|
||||
prompt("Delay 1")
|
||||
promptgroup("41 - Link 0-7")
|
||||
interest(1)
|
||||
}
|
||||
field(DOL1,DBF_INLINK) {
|
||||
prompt("Input link1")
|
||||
promptgroup("41 - Link 0-7")
|
||||
interest(1)
|
||||
}
|
||||
field(DO1,DBF_DOUBLE) {
|
||||
prompt("Value 1")
|
||||
interest(1)
|
||||
}
|
||||
field(LNK1,DBF_OUTLINK) {
|
||||
prompt("Output Link 1")
|
||||
promptgroup("41 - Link 0-7")
|
||||
interest(1)
|
||||
}
|
||||
field(DLY2,DBF_DOUBLE) {
|
||||
prompt("Delay 2")
|
||||
promptgroup("41 - Link 0-7")
|
||||
interest(1)
|
||||
}
|
||||
field(DOL2,DBF_INLINK) {
|
||||
prompt("Input link 2")
|
||||
promptgroup("41 - Link 0-7")
|
||||
interest(1)
|
||||
}
|
||||
field(DO2,DBF_DOUBLE) {
|
||||
prompt("Value 2")
|
||||
interest(1)
|
||||
}
|
||||
field(LNK2,DBF_OUTLINK) {
|
||||
prompt("Output Link 2")
|
||||
promptgroup("41 - Link 0-7")
|
||||
interest(1)
|
||||
}
|
||||
field(DLY3,DBF_DOUBLE) {
|
||||
prompt("Delay 3")
|
||||
promptgroup("41 - Link 0-7")
|
||||
interest(1)
|
||||
}
|
||||
field(DOL3,DBF_INLINK) {
|
||||
prompt("Input link 3")
|
||||
promptgroup("41 - Link 0-7")
|
||||
interest(1)
|
||||
}
|
||||
field(DO3,DBF_DOUBLE) {
|
||||
prompt("Value 3")
|
||||
interest(1)
|
||||
}
|
||||
field(LNK3,DBF_OUTLINK) {
|
||||
prompt("Output Link 3")
|
||||
promptgroup("41 - Link 0-7")
|
||||
interest(1)
|
||||
}
|
||||
field(DLY4,DBF_DOUBLE) {
|
||||
prompt("Delay 4")
|
||||
promptgroup("41 - Link 0-7")
|
||||
interest(1)
|
||||
}
|
||||
field(DOL4,DBF_INLINK) {
|
||||
prompt("Input link 4")
|
||||
promptgroup("41 - Link 0-7")
|
||||
interest(1)
|
||||
}
|
||||
field(DO4,DBF_DOUBLE) {
|
||||
prompt("Value 4")
|
||||
interest(1)
|
||||
}
|
||||
field(LNK4,DBF_OUTLINK) {
|
||||
prompt("Output Link 4")
|
||||
promptgroup("41 - Link 0-7")
|
||||
interest(1)
|
||||
}
|
||||
field(DLY5,DBF_DOUBLE) {
|
||||
prompt("Delay 5")
|
||||
promptgroup("41 - Link 0-7")
|
||||
interest(1)
|
||||
}
|
||||
field(DOL5,DBF_INLINK) {
|
||||
prompt("Input link 5")
|
||||
promptgroup("41 - Link 0-7")
|
||||
interest(1)
|
||||
}
|
||||
field(DO5,DBF_DOUBLE) {
|
||||
prompt("Value 5")
|
||||
interest(1)
|
||||
}
|
||||
field(LNK5,DBF_OUTLINK) {
|
||||
prompt("Output Link 5")
|
||||
promptgroup("41 - Link 0-7")
|
||||
interest(1)
|
||||
}
|
||||
field(DLY6,DBF_DOUBLE) {
|
||||
prompt("Delay 6")
|
||||
promptgroup("41 - Link 0-7")
|
||||
interest(1)
|
||||
}
|
||||
field(DOL6,DBF_INLINK) {
|
||||
prompt("Input link 6")
|
||||
promptgroup("41 - Link 0-7")
|
||||
interest(1)
|
||||
}
|
||||
field(DO6,DBF_DOUBLE) {
|
||||
prompt("Value 6")
|
||||
interest(1)
|
||||
}
|
||||
field(LNK6,DBF_OUTLINK) {
|
||||
prompt("Output Link 6")
|
||||
promptgroup("41 - Link 0-7")
|
||||
interest(1)
|
||||
}
|
||||
field(DLY7,DBF_DOUBLE) {
|
||||
prompt("Delay 7")
|
||||
promptgroup("41 - Link 0-7")
|
||||
interest(1)
|
||||
}
|
||||
field(DOL7,DBF_INLINK) {
|
||||
prompt("Input link 7")
|
||||
promptgroup("41 - Link 0-7")
|
||||
interest(1)
|
||||
}
|
||||
field(DO7,DBF_DOUBLE) {
|
||||
prompt("Value 7")
|
||||
interest(1)
|
||||
}
|
||||
field(LNK7,DBF_OUTLINK) {
|
||||
prompt("Output Link 7")
|
||||
promptgroup("41 - Link 0-7")
|
||||
interest(1)
|
||||
}
|
||||
field(DLY8,DBF_DOUBLE) {
|
||||
prompt("Delay 8")
|
||||
promptgroup("42 - Link 8-F")
|
||||
interest(1)
|
||||
}
|
||||
field(DOL8,DBF_INLINK) {
|
||||
prompt("Input link 8")
|
||||
promptgroup("42 - Link 8-F")
|
||||
interest(1)
|
||||
}
|
||||
field(DO8,DBF_DOUBLE) {
|
||||
prompt("Value 8")
|
||||
interest(1)
|
||||
}
|
||||
field(LNK8,DBF_OUTLINK) {
|
||||
prompt("Output Link 8")
|
||||
promptgroup("42 - Link 8-F")
|
||||
interest(1)
|
||||
}
|
||||
field(DLY9,DBF_DOUBLE) {
|
||||
prompt("Delay 9")
|
||||
promptgroup("42 - Link 8-F")
|
||||
interest(1)
|
||||
}
|
||||
field(DOL9,DBF_INLINK) {
|
||||
prompt("Input link 9")
|
||||
promptgroup("42 - Link 8-F")
|
||||
interest(1)
|
||||
}
|
||||
field(DO9,DBF_DOUBLE) {
|
||||
prompt("Value 9")
|
||||
interest(1)
|
||||
}
|
||||
field(LNK9,DBF_OUTLINK) {
|
||||
prompt("Output Link 9")
|
||||
promptgroup("42 - Link 8-F")
|
||||
interest(1)
|
||||
}
|
||||
field(DLYA,DBF_DOUBLE) {
|
||||
prompt("Delay 10")
|
||||
promptgroup("42 - Link 8-F")
|
||||
interest(1)
|
||||
}
|
||||
field(DOLA,DBF_INLINK) {
|
||||
prompt("Input link 10")
|
||||
promptgroup("42 - Link 8-F")
|
||||
interest(1)
|
||||
}
|
||||
field(DOA,DBF_DOUBLE) {
|
||||
prompt("Value 10")
|
||||
interest(1)
|
||||
}
|
||||
field(LNKA,DBF_OUTLINK) {
|
||||
prompt("Output Link 10")
|
||||
promptgroup("42 - Link 8-F")
|
||||
interest(1)
|
||||
}
|
||||
field(DLYB,DBF_DOUBLE) {
|
||||
prompt("Delay 11")
|
||||
promptgroup("42 - Link 8-F")
|
||||
interest(1)
|
||||
}
|
||||
field(DOLB,DBF_INLINK) {
|
||||
prompt("Input link 11")
|
||||
promptgroup("42 - Link 8-F")
|
||||
interest(1)
|
||||
}
|
||||
field(DOB,DBF_DOUBLE) {
|
||||
prompt("Value 11")
|
||||
interest(1)
|
||||
}
|
||||
field(LNKB,DBF_OUTLINK) {
|
||||
prompt("Output Link 11")
|
||||
promptgroup("42 - Link 8-F")
|
||||
interest(1)
|
||||
}
|
||||
field(DLYC,DBF_DOUBLE) {
|
||||
prompt("Delay 12")
|
||||
promptgroup("42 - Link 8-F")
|
||||
interest(1)
|
||||
}
|
||||
field(DOLC,DBF_INLINK) {
|
||||
prompt("Input link 12")
|
||||
promptgroup("42 - Link 8-F")
|
||||
interest(1)
|
||||
}
|
||||
field(DOC,DBF_DOUBLE) {
|
||||
prompt("Value 12")
|
||||
interest(1)
|
||||
}
|
||||
field(LNKC,DBF_OUTLINK) {
|
||||
prompt("Output Link 12")
|
||||
promptgroup("42 - Link 8-F")
|
||||
interest(1)
|
||||
}
|
||||
field(DLYD,DBF_DOUBLE) {
|
||||
prompt("Delay 13")
|
||||
promptgroup("42 - Link 8-F")
|
||||
interest(1)
|
||||
}
|
||||
field(DOLD,DBF_INLINK) {
|
||||
prompt("Input link 13")
|
||||
promptgroup("42 - Link 8-F")
|
||||
interest(1)
|
||||
}
|
||||
field(DOD,DBF_DOUBLE) {
|
||||
prompt("Value 13")
|
||||
interest(1)
|
||||
}
|
||||
field(LNKD,DBF_OUTLINK) {
|
||||
prompt("Output Link 13")
|
||||
promptgroup("42 - Link 8-F")
|
||||
interest(1)
|
||||
}
|
||||
field(DLYE,DBF_DOUBLE) {
|
||||
prompt("Delay 14")
|
||||
promptgroup("42 - Link 8-F")
|
||||
interest(1)
|
||||
}
|
||||
field(DOLE,DBF_INLINK) {
|
||||
prompt("Input link 14")
|
||||
promptgroup("42 - Link 8-F")
|
||||
interest(1)
|
||||
}
|
||||
field(DOE,DBF_DOUBLE) {
|
||||
prompt("Value 14")
|
||||
interest(1)
|
||||
}
|
||||
field(LNKE,DBF_OUTLINK) {
|
||||
prompt("Output Link 14")
|
||||
promptgroup("42 - Link 8-F")
|
||||
interest(1)
|
||||
}
|
||||
field(DLYF,DBF_DOUBLE) {
|
||||
prompt("Delay 15")
|
||||
promptgroup("42 - Link 8-F")
|
||||
interest(1)
|
||||
}
|
||||
field(DOLF,DBF_INLINK) {
|
||||
prompt("Input link 15")
|
||||
promptgroup("42 - Link 8-F")
|
||||
interest(1)
|
||||
}
|
||||
field(DOF,DBF_DOUBLE) {
|
||||
prompt("Value 15")
|
||||
interest(1)
|
||||
}
|
||||
field(LNKF,DBF_OUTLINK) {
|
||||
prompt("Output Link 15")
|
||||
promptgroup("42 - Link 8-F")
|
||||
interest(1)
|
||||
}
|
||||
}
|
||||
|
||||
variable(seqDLYprecision, int)
|
||||
variable(seqDLYlimit, double)
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user