Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ticket7975 add ioc rknmntr #1

Merged
merged 23 commits into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Set the default behavior, in case people don't have core.autocrlf set.
* text=auto

# Explicitly declare text files you want to always be normalized and converted
# to native line endings on checkout.
*.c text
*.cpp text
*.h text
*.hpp text
*.java text
*.sh text eol=lf
*.bat text
*.cmd text
*.db text
*.dbd text
*.template text
*.substitutions text
*.py text
*.rst text
*.uxf text

# Declare files that will always have CRLF line endings on checkout.
*.sln text eol=crlf

# Denote all files that are truly binary and should not be modified.
*.png binary
*.jpg binary
*.class binary
*.vi binary
21 changes: 21 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
O.*/
/db
/bin
/dbd
/include
/lib
/templates
test-reports
envPaths
cdCommands
dllPath.bat
runIOC.bat
runIOC.sh
relPaths.sh
*.tag
/data/
/doc/
*_info_positions.req
*_info_settings.req
*.py[cod]
__pycache__/
30 changes: 30 additions & 0 deletions LICENCE
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
BSD 3-Clause License

Copyright (c) 2023, Science and Technology Facilities Council
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

* Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

37 changes: 37 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Makefile for Asyn rknmntr support
#
# Created by wtn43451 on Wed Sep 27 14:08:57 2023
# Based on the Asyn streamSCPI template

TOP = .
include $(TOP)/configure/CONFIG

DIRS += configure
DIRS += $(wildcard *Sup)
DIRS += $(wildcard *App)
DIRS += $(wildcard *Top)
DIRS += $(wildcard iocBoot)

# The build order is controlled by these dependency rules:

# All dirs except configure depend on configure
$(foreach dir, $(filter-out configure, $(DIRS)), \
$(eval $(dir)_DEPEND_DIRS += configure))

# Any *App dirs depend on all *Sup dirs
$(foreach dir, $(filter %App, $(DIRS)), \
$(eval $(dir)_DEPEND_DIRS += $(filter %Sup, $(DIRS))))

# Any *Top dirs depend on all *Sup and *App dirs
$(foreach dir, $(filter %Top, $(DIRS)), \
$(eval $(dir)_DEPEND_DIRS += $(filter %Sup %App, $(DIRS))))

# iocBoot depends on all *App dirs
iocBoot_DEPEND_DIRS += $(filter %App,$(DIRS))

# Add any additional dependency rules here:

include $(TOP)/configure/RULES_TOP

ioctests:
.\system_tests\run_tests.bat
29 changes: 29 additions & 0 deletions configure/CONFIG
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# CONFIG - Load build configuration data
#
# Do not make changes to this file!

# Allow user to override where the build rules come from
RULES = $(EPICS_BASE)

# RELEASE files point to other application tops
include $(TOP)/configure/RELEASE
-include $(TOP)/configure/RELEASE.$(EPICS_HOST_ARCH).Common
ifdef T_A
-include $(TOP)/configure/RELEASE.Common.$(T_A)
-include $(TOP)/configure/RELEASE.$(EPICS_HOST_ARCH).$(T_A)
endif

CONFIG = $(RULES)/configure
include $(CONFIG)/CONFIG

# Override the Base definition:
INSTALL_LOCATION = $(TOP)

# CONFIG_SITE files contain other build configuration settings
include $(TOP)/configure/CONFIG_SITE
-include $(TOP)/configure/CONFIG_SITE.$(EPICS_HOST_ARCH).Common
ifdef T_A
-include $(TOP)/configure/CONFIG_SITE.Common.$(T_A)
-include $(TOP)/configure/CONFIG_SITE.$(EPICS_HOST_ARCH).$(T_A)
endif

43 changes: 43 additions & 0 deletions configure/CONFIG_SITE
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# CONFIG_SITE

# Make any application-specific changes to the EPICS build
# configuration variables in this file.
#
# Host/target specific settings can be specified in files named
# CONFIG_SITE.$(EPICS_HOST_ARCH).Common
# CONFIG_SITE.Common.$(T_A)
# CONFIG_SITE.$(EPICS_HOST_ARCH).$(T_A)

# CHECK_RELEASE controls the consistency checking of the support
# applications pointed to by the RELEASE* files.
# Normally CHECK_RELEASE should be set to YES.
# Set CHECK_RELEASE to NO to disable checking completely.
# Set CHECK_RELEASE to WARN to perform consistency checking but
# continue building even if conflicts are found.
CHECK_RELEASE = YES

# Set this when you only want to compile this application
# for a subset of the cross-compiled target architectures
# that Base is built for.
#CROSS_COMPILER_TARGET_ARCHS = vxWorks-ppc32

# To install files into a location other than $(TOP) define
# INSTALL_LOCATION here.
#INSTALL_LOCATION=</absolute/path/to/install/top>

# Set this when the IOC and build host use different paths
# to the install location. This may be needed to boot from
# a Microsoft FTP server say, or on some NFS configurations.
#IOCS_APPL_TOP = </IOC's/absolute/path/to/install/top>

# For application debugging purposes, override the HOST_OPT and/
# or CROSS_OPT settings from base/configure/CONFIG_SITE
#HOST_OPT = NO
#CROSS_OPT = NO

# These allow developers to override the CONFIG_SITE variable
# settings without having to modify the configure/CONFIG_SITE
# file itself.
-include $(TOP)/../CONFIG_SITE.local
-include $(TOP)/configure/CONFIG_SITE.local

8 changes: 8 additions & 0 deletions configure/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
TOP=..

include $(TOP)/configure/CONFIG

TARGETS = $(CONFIG_TARGETS)
CONFIGS += $(subst ../,,$(wildcard $(CONFIG_INSTALLS)))

include $(TOP)/configure/RULES
5 changes: 5 additions & 0 deletions configure/RELEASE
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# optional extra local definitions here
-include $(TOP)/configure/RELEASE.private

include $(TOP)/../../../ISIS_CONFIG
-include $(TOP)/../../../ISIS_CONFIG.$(EPICS_HOST_ARCH)
6 changes: 6 additions & 0 deletions configure/RULES
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# RULES

include $(CONFIG)/RULES

# Library should be rebuilt because LIBOBJS may have changed.
$(LIBNAME): ../Makefile
2 changes: 2 additions & 0 deletions configure/RULES_DIRS
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#RULES_DIRS
include $(CONFIG)/RULES_DIRS
3 changes: 3 additions & 0 deletions configure/RULES_TOP
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#RULES_TOP
include $(CONFIG)/RULES_TOP

78 changes: 78 additions & 0 deletions documentation/devrknmntr.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>rknmntr Instrument Support</title>
<meta name="generator" content="amaya 8.5, see http://www.w3.org/Amaya/" />
</head>

<body>
<h1>Using rknmntr instrument support in an application</h1>

<p>Several files need minor modifications to use rknmntr instrument support in
an application.</p>
<ol>
<li>Add the full path to the rknmntr support directory to the
application <tt>configure/RELEASE</tt> file:<br />
<tt>rknmntr=</tt><em>xxxx</em><tt>/modules/instrument/rknmntr/&lt;release&gt;</tt><br />
Where <tt>&lt;release&gt;</tt> is the release number of of the rknmntr support.</li>
<li>Add stream and asyn support to application database definition file<br />
The application database definition file must include the database
definition files for the stream package and for any needed ASYN
drivers. There are two ways that this can be done:
<ul>
<li>If you are building your application database definition file from
an <em>xxx</em><tt>Include.dbd</tt> file you include the additional database
definitions in that file:<br />
<tt>include "base.dbd"</tt><br />
<tt>include "stream.dbd"</tt><br />
<tt>include "drvAsynIPPort.dbd"</tt></li>
<li>If you are building your application database definition file from
the application Makefile you specify the aditional database
definitions there:<br />
<em>xxx</em><tt>_DBD += base.dbd</tt><br />
<em>xxx</em><tt>_DBD += stream.dbd</tt><br />
<em>xxx</em><tt>_DBD += drvAsynIPPort.dbd</tt><br /></li>
</ul>
</li>
<li>Add the stream and asyn support libraries to the application<br />
You must link the stream support library and the ASYN support library
with the application. Add the following lines: <br />
<em>xxx</em><tt>_LIBS += stream</tt><br />
<em>xxx</em><tt>_LIBS += asyn</tt><br />
before the <br />
<em>xxx</em><tt>_LIBS += $(EPICS_BASE_IOC_LIBS)</tt><br />
in the application Makefile.</li>
<li>Load the rknmntr support database records in the application startup script:<br />
<tt>cd $(rknmntr)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt>(<tt>cd rknmntr</tt> if using the vxWorks shell)<br />
<tt>dbLoadRecords("db/devrknmntr.db,"P=</tt><em>&lt;P&gt;</em><tt>,R=</tt><em>&lt;R&gt;</em><tt>,PORT=</tt><em>&lt;PORT&gt;</em><tt>,A=</tt><em>&lt;A&gt;</em><tt>")</tt><br />
You'll have to provide appropriate values for the PV name prefixes
(<em>&lt;P&gt;</em> and <em>&lt;R&gt;</em>), the port name (<em>&lt;PORT&gt;</em>) and the device address
(<em>&lt;A&gt;</em>). The port name must match the value specified in
an ASYN <tt>drv</tt><em>xxxxx</em><tt>Configure</tt> command.
</li>
</ol>
<h1>Installation and Building</h1>
After obtaining a copy of the distribution, it must be installed and built
for use at your site.
<ol>
<li>Create an installation directory for the module. The path name
of this directory should end with <tt>modules/instrument/rknmntr</tt>.</li>
<li>Place the distribution file into this directory.</li>
<li>Execute the following commands:<br />
<tt>cd modules/instrument/rknmntr</tt><br />
<tt>gunzip rknmntr&lt;release&gt;.tar.gz</tt><br />
<tt>tar xvf rknmntr&lt;release&gt;.tar</tt><br />
<tt>cd &lt;release&gt;</tt><br />
Where <tt>&lt;release&gt;</tt> is the release number of of the rknmntr support.
</li>
<li>Edit the <tt>configure/RELEASE</tt> file and set the paths to your
installation of EPICS base, stream and ASYN support modules.</li>
<li>Execute <tt>make</tt> in the top level directory.</li>
</ol>
</body>
</html>


12 changes: 12 additions & 0 deletions rknmntrSup/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
TOP=..
include $(TOP)/configure/CONFIG
#=======================================

# Install .dbd and .db files
DB += rknmntr.db
DB += RIKEN_TEMP_CALC.db
DB += test_PSU_PVs.db
DB += test_block_curr_PVs.db

#=======================================
include $(TOP)/configure/RULES
Loading