From b35774ddc80e51a463c62de62665c2d41f8cb0d7 Mon Sep 17 00:00:00 2001 From: Rory-Potter-Tessella Date: Wed, 15 Aug 2018 14:09:52 +0100 Subject: [PATCH 01/14] Add template IOC --- KICKER/KICKER-IOC-01App/Db/Makefile | 22 ++++++ KICKER/KICKER-IOC-01App/Makefile | 9 +++ .../src/KICKER-IOC-01Main.cpp | 23 ++++++ KICKER/KICKER-IOC-01App/src/Makefile | 9 +++ KICKER/KICKER-IOC-01App/src/build.mak | 72 ++++++++++++++++++ KICKER/Makefile | 31 ++++++++ KICKER/configure/CONFIG | 29 ++++++++ KICKER/configure/CONFIG_SITE | 43 +++++++++++ KICKER/configure/Makefile | 8 ++ KICKER/configure/RELEASE | 73 +++++++++++++++++++ KICKER/configure/RULES | 6 ++ KICKER/configure/RULES.ioc | 2 + KICKER/configure/RULES_DIRS | 2 + KICKER/configure/RULES_TOP | 3 + KICKER/iocBoot/Makefile | 6 ++ KICKER/iocBoot/iocKICKER-IOC-01/Makefile | 6 ++ KICKER/iocBoot/iocKICKER-IOC-01/config.xml | 12 +++ KICKER/iocBoot/iocKICKER-IOC-01/st-common.cmd | 44 +++++++++++ KICKER/iocBoot/iocKICKER-IOC-01/st.cmd | 18 +++++ Makefile | 1 + 20 files changed, 419 insertions(+) create mode 100644 KICKER/KICKER-IOC-01App/Db/Makefile create mode 100644 KICKER/KICKER-IOC-01App/Makefile create mode 100644 KICKER/KICKER-IOC-01App/src/KICKER-IOC-01Main.cpp create mode 100644 KICKER/KICKER-IOC-01App/src/Makefile create mode 100644 KICKER/KICKER-IOC-01App/src/build.mak create mode 100644 KICKER/Makefile create mode 100644 KICKER/configure/CONFIG create mode 100644 KICKER/configure/CONFIG_SITE create mode 100644 KICKER/configure/Makefile create mode 100644 KICKER/configure/RELEASE create mode 100644 KICKER/configure/RULES create mode 100644 KICKER/configure/RULES.ioc create mode 100644 KICKER/configure/RULES_DIRS create mode 100644 KICKER/configure/RULES_TOP create mode 100644 KICKER/iocBoot/Makefile create mode 100644 KICKER/iocBoot/iocKICKER-IOC-01/Makefile create mode 100644 KICKER/iocBoot/iocKICKER-IOC-01/config.xml create mode 100644 KICKER/iocBoot/iocKICKER-IOC-01/st-common.cmd create mode 100644 KICKER/iocBoot/iocKICKER-IOC-01/st.cmd diff --git a/KICKER/KICKER-IOC-01App/Db/Makefile b/KICKER/KICKER-IOC-01App/Db/Makefile new file mode 100644 index 000000000..983981d40 --- /dev/null +++ b/KICKER/KICKER-IOC-01App/Db/Makefile @@ -0,0 +1,22 @@ +TOP=../.. +include $(TOP)/configure/CONFIG +#---------------------------------------- +# ADD MACRO DEFINITIONS AFTER THIS LINE + +#---------------------------------------------------- +# Optimization of db files using dbst (DEFAULT: NO) +#DB_OPT = YES + +#---------------------------------------------------- +# Create and install (or just install) into /db +# databases, templates, substitutions like this +#DB += xxx.db + +#---------------------------------------------------- +# If .db template is not named *.template add +# _template = + +include $(TOP)/configure/RULES +#---------------------------------------- +# ADD RULES AFTER THIS LINE + diff --git a/KICKER/KICKER-IOC-01App/Makefile b/KICKER/KICKER-IOC-01App/Makefile new file mode 100644 index 000000000..373b86bfc --- /dev/null +++ b/KICKER/KICKER-IOC-01App/Makefile @@ -0,0 +1,9 @@ +TOP = .. +include $(TOP)/configure/CONFIG +DIRS := $(DIRS) $(filter-out $(DIRS), $(wildcard *src*)) +DIRS := $(DIRS) $(filter-out $(DIRS), $(wildcard *Src*)) +DIRS := $(DIRS) $(filter-out $(DIRS), $(wildcard *db*)) +DIRS := $(DIRS) $(filter-out $(DIRS), $(wildcard *Db*)) +DIRS := $(DIRS) $(filter-out $(DIRS), $(wildcard *protocol*)) +include $(TOP)/configure/RULES_DIRS + diff --git a/KICKER/KICKER-IOC-01App/src/KICKER-IOC-01Main.cpp b/KICKER/KICKER-IOC-01App/src/KICKER-IOC-01Main.cpp new file mode 100644 index 000000000..4daf2f8e4 --- /dev/null +++ b/KICKER/KICKER-IOC-01App/src/KICKER-IOC-01Main.cpp @@ -0,0 +1,23 @@ +/* KICKER-IOC-01Main.cpp */ +/* Author: Marty Kraimer Date: 17MAR2000 */ + +#include +#include +#include +#include +#include + +#include "epicsExit.h" +#include "epicsThread.h" +#include "iocsh.h" + +int main(int argc,char *argv[]) +{ + if(argc>=2) { + iocsh(argv[1]); + epicsThreadSleep(.2); + } + iocsh(NULL); + epicsExit(0); + return(0); +} diff --git a/KICKER/KICKER-IOC-01App/src/Makefile b/KICKER/KICKER-IOC-01App/src/Makefile new file mode 100644 index 000000000..0ee3565d0 --- /dev/null +++ b/KICKER/KICKER-IOC-01App/src/Makefile @@ -0,0 +1,9 @@ +TOP=../.. +# This file should do very little - it's purpose is to set the APPNAME and then load build.mak + +# this definition is used in build.mak +APPNAME=KICKER-IOC-01 + +# If we are ###-IOC-01 leave this as is, if we are ###-IOC-02 or higher change to ###-IOC-01 and delete build.mak from this directory +# there should only be a single build.mak for all IOCs of a given family and it is located in the ###-IOC-01 directory +include $(TOP)/KICKER-IOC-01App/src/build.mak diff --git a/KICKER/KICKER-IOC-01App/src/build.mak b/KICKER/KICKER-IOC-01App/src/build.mak new file mode 100644 index 000000000..6703cdab1 --- /dev/null +++ b/KICKER/KICKER-IOC-01App/src/build.mak @@ -0,0 +1,72 @@ +TOP=../.. + +include $(TOP)/configure/CONFIG +#---------------------------------------- +# ADD MACRO DEFINITIONS AFTER THIS LINE +#============================= + +### NOTE: there should only be one build.mak for a given IOC family and this should be located in the ###-IOC-01 directory + +#============================= +# Build the IOC application KICKER-IOC-01 +# We actually use $(APPNAME) below so this file can be included by multiple IOCs + +PROD_IOC = $(APPNAME) +# KICKER-IOC-01.dbd will be created and installed +DBD += $(APPNAME).dbd + +# KICKER-IOC-01.dbd will be made up from these files: +$(APPNAME)_DBD += base.dbd +## ISIS standard dbd ## +$(APPNAME)_DBD += devSequencer.dbd +$(APPNAME)_DBD += icpconfig.dbd +$(APPNAME)_DBD += pvdump.dbd +$(APPNAME)_DBD += asSupport.dbd +$(APPNAME)_DBD += devIocStats.dbd +$(APPNAME)_DBD += caPutLog.dbd +$(APPNAME)_DBD += utilities.dbd +## Stream device support ## +$(APPNAME)_DBD += stream.dbd +$(APPNAME)_DBD += asyn.dbd +$(APPNAME)_DBD += drvAsynSerialPort.dbd +$(APPNAME)_DBD += drvAsynIPPort.dbd +$(APPNAME)_DBD += calcSupport.dbd +## add other dbd here ## +#$(APPNAME)_DBD += xxx.dbd + +# Add all the support libraries needed by this IOC +## ISIS standard libraries ## +$(APPNAME)_LIBS += seqDev seq pv +$(APPNAME)_LIBS += devIocStats +$(APPNAME)_LIBS += pvdump $(MYSQLLIB) easySQLite sqlite +$(APPNAME)_LIBS += caPutLog +$(APPNAME)_LIBS += icpconfig pugixml +$(APPNAME)_LIBS += autosave +$(APPNAME)_LIBS += utilities pcre libjson zlib +## Stream device libraries ## +$(APPNAME)_LIBS += stream +$(APPNAME)_LIBS += pcre +$(APPNAME)_LIBS += asyn +## Add other libraries here ## +$(APPNAME)_LIBS += calc +#$(APPNAME)_LIBS += xxx + +# KICKER-IOC-01_registerRecordDeviceDriver.cpp derives from KICKER-IOC-01.dbd +$(APPNAME)_SRCS += $(APPNAME)_registerRecordDeviceDriver.cpp + +# Build the main IOC entry point on workstation OSs. +$(APPNAME)_SRCS_DEFAULT += $(APPNAME)Main.cpp +$(APPNAME)_SRCS_vxWorks += -nil- + +# Add support from base/src/vxWorks if needed +#$(APPNAME)_OBJS_vxWorks += $(EPICS_BASE_BIN)/vxComLibrary + +# Finally link to the EPICS Base libraries +$(APPNAME)_LIBS += $(EPICS_BASE_IOC_LIBS) + +#=========================== + +include $(TOP)/configure/RULES +#---------------------------------------- +# ADD RULES AFTER THIS LINE + diff --git a/KICKER/Makefile b/KICKER/Makefile new file mode 100644 index 000000000..19c9068d1 --- /dev/null +++ b/KICKER/Makefile @@ -0,0 +1,31 @@ +# Makefile at top of application tree +TOP = . +include $(TOP)/configure/CONFIG + +# Directories to build, any order +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 diff --git a/KICKER/configure/CONFIG b/KICKER/configure/CONFIG new file mode 100644 index 000000000..c1a470322 --- /dev/null +++ b/KICKER/configure/CONFIG @@ -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 + diff --git a/KICKER/configure/CONFIG_SITE b/KICKER/configure/CONFIG_SITE new file mode 100644 index 000000000..212485ebe --- /dev/null +++ b/KICKER/configure/CONFIG_SITE @@ -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= + +# 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 = + +# 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 + diff --git a/KICKER/configure/Makefile b/KICKER/configure/Makefile new file mode 100644 index 000000000..925430940 --- /dev/null +++ b/KICKER/configure/Makefile @@ -0,0 +1,8 @@ +TOP=.. + +include $(TOP)/configure/CONFIG + +TARGETS = $(CONFIG_TARGETS) +CONFIGS += $(subst ../,,$(wildcard $(CONFIG_INSTALLS))) + +include $(TOP)/configure/RULES diff --git a/KICKER/configure/RELEASE b/KICKER/configure/RELEASE new file mode 100644 index 000000000..1cd421fd9 --- /dev/null +++ b/KICKER/configure/RELEASE @@ -0,0 +1,73 @@ +# RELEASE - Location of external support modules +# +# IF YOU MAKE ANY CHANGES to this file you must subsequently +# do a "gnumake rebuild" in this application's top level +# directory. +# +# The build process does not check dependencies against files +# that are outside this application, thus you should do a +# "gnumake rebuild" in the top level directory after EPICS_BASE +# or any other external module pointed to below is rebuilt. +# +# Host- or target-specific settings can be given in files named +# RELEASE.$(EPICS_HOST_ARCH).Common +# RELEASE.Common.$(T_A) +# RELEASE.$(EPICS_HOST_ARCH).$(T_A) +# +# This file is parsed by both GNUmake and an EPICS Perl script, +# so it can ONLY contain definitions of paths to other support +# modules, variable definitions that are used in module paths, +# and include statements that pull in other RELEASE files. +# Variables may be used before their values have been set. +# Build variables that are NOT used in paths should be set in +# the CONFIG_SITE file. + +# Variables and paths to dependent modules: +#MODULES = /path/to/modules +#MYMODULE = $(MODULES)/my-module + +# If using the sequencer, point SNCSEQ at its top directory: +#SNCSEQ = $(MODULES)/seq-ver + +# EPICS_BASE should appear last so earlier modules can override stuff: +EPICS_BASE = C:/Instrument/Apps/EPICS/base/master + +# Set RULES here if you want to use build rules from somewhere +# other than EPICS_BASE: +#RULES = $(MODULES)/build-rules + +# These allow developers to override the RELEASE variable settings +# without having to modify the configure/RELEASE file itself. +-include $(TOP)/../RELEASE.local +-include $(TOP)/configure/RELEASE.local + +# Macros required for basic ioc/stream device +ACCESSSECURITY=$(SUPPORT)/AccessSecurity/master +ASUBFUNCTIONS=$(SUPPORT)/asubFunctions/master +ASYN=$(SUPPORT)/asyn/master +AUTOSAVE=$(SUPPORT)/autosave/master +CALC=$(SUPPORT)/calc/master +CAPUTLOG=$(SUPPORT)/caPutLog/master +DEVIOCSTATS=$(SUPPORT)/devIocStats/master +ICPCONFIG=$(SUPPORT)/icpconfig/master +LIBJSON=$(SUPPORT)/libjson/master +MYSQL=$(SUPPORT)/MySQL/master +ONCRPC=$(SUPPORT)/oncrpc/master +PCRE=$(SUPPORT)/pcre/master +PUGIXML=$(SUPPORT)/pugixml/master +PVDUMP=$(SUPPORT)/pvdump/master +SNCSEQ=$(SUPPORT)/seq/master +SQLITE=$(SUPPORT)/sqlite/master +SSCAN=$(SUPPORT)/sscan/master +STREAMDEVICE=$(SUPPORT)/StreamDevice/master +UTILITIES=$(SUPPORT)/utilities/master +ZLIB=$(SUPPORT)/zlib/master + +# optional extra local definitions here +-include $(TOP)/configure/RELEASE.private + +include $(TOP)/../../../ISIS_CONFIG +-include $(TOP)/../../../ISIS_CONFIG.$(EPICS_HOST_ARCH) + +# IOC-specific support module +KICKER=$(SUPPORT)/kicker/master diff --git a/KICKER/configure/RULES b/KICKER/configure/RULES new file mode 100644 index 000000000..6d56e14e8 --- /dev/null +++ b/KICKER/configure/RULES @@ -0,0 +1,6 @@ +# RULES + +include $(CONFIG)/RULES + +# Library should be rebuilt because LIBOBJS may have changed. +$(LIBNAME): ../Makefile diff --git a/KICKER/configure/RULES.ioc b/KICKER/configure/RULES.ioc new file mode 100644 index 000000000..901987c6c --- /dev/null +++ b/KICKER/configure/RULES.ioc @@ -0,0 +1,2 @@ +#RULES.ioc +include $(CONFIG)/RULES.ioc diff --git a/KICKER/configure/RULES_DIRS b/KICKER/configure/RULES_DIRS new file mode 100644 index 000000000..3ba269dcc --- /dev/null +++ b/KICKER/configure/RULES_DIRS @@ -0,0 +1,2 @@ +#RULES_DIRS +include $(CONFIG)/RULES_DIRS diff --git a/KICKER/configure/RULES_TOP b/KICKER/configure/RULES_TOP new file mode 100644 index 000000000..d09d668d5 --- /dev/null +++ b/KICKER/configure/RULES_TOP @@ -0,0 +1,3 @@ +#RULES_TOP +include $(CONFIG)/RULES_TOP + diff --git a/KICKER/iocBoot/Makefile b/KICKER/iocBoot/Makefile new file mode 100644 index 000000000..91e47d0b5 --- /dev/null +++ b/KICKER/iocBoot/Makefile @@ -0,0 +1,6 @@ +TOP = .. +include $(TOP)/configure/CONFIG +DIRS += $(wildcard *ioc*) +DIRS += $(wildcard as*) +include $(CONFIG)/RULES_DIRS + diff --git a/KICKER/iocBoot/iocKICKER-IOC-01/Makefile b/KICKER/iocBoot/iocKICKER-IOC-01/Makefile new file mode 100644 index 000000000..09b391227 --- /dev/null +++ b/KICKER/iocBoot/iocKICKER-IOC-01/Makefile @@ -0,0 +1,6 @@ +TOP = ../.. +include $(TOP)/configure/CONFIG +#ARCH = windows-x64 +ARCH = $(EPICS_HOST_ARCH) +TARGETS = envPaths dllPath.bat relPaths.sh runIOC.bat runIOC.sh +include $(TOP)/configure/RULES.ioc diff --git a/KICKER/iocBoot/iocKICKER-IOC-01/config.xml b/KICKER/iocBoot/iocKICKER-IOC-01/config.xml new file mode 100644 index 000000000..43f3fa8f7 --- /dev/null +++ b/KICKER/iocBoot/iocKICKER-IOC-01/config.xml @@ -0,0 +1,12 @@ + + + +This is a template description +These are template details + + + + + + + diff --git a/KICKER/iocBoot/iocKICKER-IOC-01/st-common.cmd b/KICKER/iocBoot/iocKICKER-IOC-01/st-common.cmd new file mode 100644 index 000000000..a4ad4ac86 --- /dev/null +++ b/KICKER/iocBoot/iocKICKER-IOC-01/st-common.cmd @@ -0,0 +1,44 @@ +epicsEnvSet "STREAM_PROTOCOL_PATH" "$(KICKER)/data" +epicsEnvSet "DEVICE" "L0" + +##ISIS## Run IOC initialisation +< $(IOCSTARTUP)/init.cmd + +## Device simulation mode IP configuration +$(IFDEVSIM) drvAsynIPPortConfigure("$(DEVICE)", "localhost:$(EMULATOR_PORT=57677)") + +## For recsim: +$(IFRECSIM) drvAsynSerialPortConfigure("$(DEVICE)", "$(PORT=NUL)", 0, 1, 0, 0) + +## For real device: +$(IFNOTDEVSIM) $(IFNOTRECSIM) drvAsynSerialPortConfigure("$(DEVICE)", "$(PORT=NO_PORT_MACRO)", 0, 0, 0, 0) +$(IFNOTDEVSIM) $(IFNOTRECSIM) asynSetOption("$(DEVICE)", -1, "baud", "$(BAUD=9600)") +$(IFNOTDEVSIM) $(IFNOTRECSIM) asynSetOption("$(DEVICE)", -1, "bits", "$(BITS=8)") +$(IFNOTDEVSIM) $(IFNOTRECSIM) asynSetOption("$(DEVICE)", -1, "parity", "$(PARITY=none)") +$(IFNOTDEVSIM) $(IFNOTRECSIM) asynSetOption("$(DEVICE)", -1, "stop", "$(STOP=1)") +## Hardware flow control off +$(IFNOTDEVSIM) $(IFNOTRECSIM) asynSetOption("$(DEVICE)", 0, "clocal", "Y") +$(IFNOTDEVSIM) $(IFNOTRECSIM) asynSetOption("$(DEVICE)",0,"crtscts","N") +## Software flow control off +$(IFNOTDEVSIM) $(IFNOTRECSIM) asynSetOption("$(DEVICE)",0,"ixon","N") +$(IFNOTDEVSIM) $(IFNOTRECSIM) asynSetOption("$(DEVICE)",0,"ixoff","N") + +## Load record instances + +##ISIS## Load common DB records +< $(IOCSTARTUP)/dbload.cmd + +## Load our record instances +dbLoadRecords("$(KICKER)/db/kicker.db","PVPREFIX=$(MYPVPREFIX),P=$(MYPVPREFIX)$(IOCNAME):,RECSIM=$(RECSIM=0),DISABLE=$(DISABLE=0),PORT=$(DEVICE)") + +##ISIS## Stuff that needs to be done after all records are loaded but before iocInit is called +< $(IOCSTARTUP)/preiocinit.cmd + +cd "${TOP}/iocBoot/${IOC}" +iocInit + +## Start any sequence programs +#seq sncxxx,"user=olz75487" + +##ISIS## Stuff that needs to be done after iocInit is called e.g. sequence programs +< $(IOCSTARTUP)/postiocinit.cmd diff --git a/KICKER/iocBoot/iocKICKER-IOC-01/st.cmd b/KICKER/iocBoot/iocKICKER-IOC-01/st.cmd new file mode 100644 index 000000000..3d91b770d --- /dev/null +++ b/KICKER/iocBoot/iocKICKER-IOC-01/st.cmd @@ -0,0 +1,18 @@ +#!../../bin/windows-x64/KICKER-IOC-01 + +## You may have to change KICKER-IOC-01 to something else +## everywhere it appears in this file + +# Increase this if you get <> or discarded messages warnings in your errlog output +errlogInit2(65536, 256) + +< envPaths + +cd "${TOP}" + +## Register all support components +dbLoadDatabase "dbd/KICKER-IOC-01.dbd" +KICKER_IOC_01_registerRecordDeviceDriver pdbbase + +## calling common command file in ioc 01 boot dir +< ${TOP}/iocBoot/iocKICKER-IOC-01/st-common.cmd diff --git a/Makefile b/Makefile index cf91d4db0..a643df9bd 100644 --- a/Makefile +++ b/Makefile @@ -18,6 +18,7 @@ IOCDIRS += SP2XX IOCDIRS += RKNDIO IOCDIRS += NGPSPSU IOCDIRS += KYNCTM3K +IOCDIRS += KICKER ## check on missing directories IOCMAKES = $(wildcard */Makefile) From f49acdb7b1342249dd8c3c882596712c89a3ad41 Mon Sep 17 00:00:00 2001 From: Rory-Potter-Tessella Date: Wed, 15 Aug 2018 15:19:46 +0100 Subject: [PATCH 02/14] Added DAQ records to IOC --- KICKER/configure/RELEASE | 1 + KICKER/iocBoot/iocKICKER-IOC-01/st-common.cmd | 44 ----------------- KICKER/iocBoot/iocKICKER-IOC-01/st-daq.cmd | 18 +++++++ KICKER/iocBoot/iocKICKER-IOC-01/st.cmd | 49 ++++++++++++++++++- 4 files changed, 66 insertions(+), 46 deletions(-) delete mode 100644 KICKER/iocBoot/iocKICKER-IOC-01/st-common.cmd create mode 100644 KICKER/iocBoot/iocKICKER-IOC-01/st-daq.cmd diff --git a/KICKER/configure/RELEASE b/KICKER/configure/RELEASE index 1cd421fd9..42685f530 100644 --- a/KICKER/configure/RELEASE +++ b/KICKER/configure/RELEASE @@ -48,6 +48,7 @@ ASYN=$(SUPPORT)/asyn/master AUTOSAVE=$(SUPPORT)/autosave/master CALC=$(SUPPORT)/calc/master CAPUTLOG=$(SUPPORT)/caPutLog/master +DAQMXBASE=$(SUPPORT)/DAQmxBase\master DEVIOCSTATS=$(SUPPORT)/devIocStats/master ICPCONFIG=$(SUPPORT)/icpconfig/master LIBJSON=$(SUPPORT)/libjson/master diff --git a/KICKER/iocBoot/iocKICKER-IOC-01/st-common.cmd b/KICKER/iocBoot/iocKICKER-IOC-01/st-common.cmd deleted file mode 100644 index a4ad4ac86..000000000 --- a/KICKER/iocBoot/iocKICKER-IOC-01/st-common.cmd +++ /dev/null @@ -1,44 +0,0 @@ -epicsEnvSet "STREAM_PROTOCOL_PATH" "$(KICKER)/data" -epicsEnvSet "DEVICE" "L0" - -##ISIS## Run IOC initialisation -< $(IOCSTARTUP)/init.cmd - -## Device simulation mode IP configuration -$(IFDEVSIM) drvAsynIPPortConfigure("$(DEVICE)", "localhost:$(EMULATOR_PORT=57677)") - -## For recsim: -$(IFRECSIM) drvAsynSerialPortConfigure("$(DEVICE)", "$(PORT=NUL)", 0, 1, 0, 0) - -## For real device: -$(IFNOTDEVSIM) $(IFNOTRECSIM) drvAsynSerialPortConfigure("$(DEVICE)", "$(PORT=NO_PORT_MACRO)", 0, 0, 0, 0) -$(IFNOTDEVSIM) $(IFNOTRECSIM) asynSetOption("$(DEVICE)", -1, "baud", "$(BAUD=9600)") -$(IFNOTDEVSIM) $(IFNOTRECSIM) asynSetOption("$(DEVICE)", -1, "bits", "$(BITS=8)") -$(IFNOTDEVSIM) $(IFNOTRECSIM) asynSetOption("$(DEVICE)", -1, "parity", "$(PARITY=none)") -$(IFNOTDEVSIM) $(IFNOTRECSIM) asynSetOption("$(DEVICE)", -1, "stop", "$(STOP=1)") -## Hardware flow control off -$(IFNOTDEVSIM) $(IFNOTRECSIM) asynSetOption("$(DEVICE)", 0, "clocal", "Y") -$(IFNOTDEVSIM) $(IFNOTRECSIM) asynSetOption("$(DEVICE)",0,"crtscts","N") -## Software flow control off -$(IFNOTDEVSIM) $(IFNOTRECSIM) asynSetOption("$(DEVICE)",0,"ixon","N") -$(IFNOTDEVSIM) $(IFNOTRECSIM) asynSetOption("$(DEVICE)",0,"ixoff","N") - -## Load record instances - -##ISIS## Load common DB records -< $(IOCSTARTUP)/dbload.cmd - -## Load our record instances -dbLoadRecords("$(KICKER)/db/kicker.db","PVPREFIX=$(MYPVPREFIX),P=$(MYPVPREFIX)$(IOCNAME):,RECSIM=$(RECSIM=0),DISABLE=$(DISABLE=0),PORT=$(DEVICE)") - -##ISIS## Stuff that needs to be done after all records are loaded but before iocInit is called -< $(IOCSTARTUP)/preiocinit.cmd - -cd "${TOP}/iocBoot/${IOC}" -iocInit - -## Start any sequence programs -#seq sncxxx,"user=olz75487" - -##ISIS## Stuff that needs to be done after iocInit is called e.g. sequence programs -< $(IOCSTARTUP)/postiocinit.cmd diff --git a/KICKER/iocBoot/iocKICKER-IOC-01/st-daq.cmd b/KICKER/iocBoot/iocKICKER-IOC-01/st-daq.cmd new file mode 100644 index 000000000..9f9156560 --- /dev/null +++ b/KICKER/iocBoot/iocKICKER-IOC-01/st-daq.cmd @@ -0,0 +1,18 @@ +## NI cDAQ-9181 with NI 9375 card +epicsEnvSet("CDAQ","cDAQ9181-RFEMod1") + +## CDAQ port0 is input +$(IFNOTDEVSIM) DAQmxConfig("R0", "$(CDAQ)/port0/line0", 0, "AI","OneShot N=1 F=0") +$(IFNOTDEVSIM) DAQmxConfig("R0", "$(CDAQ)/port0/line1", 1, "AI","OneShot N=1 F=0") +$(IFNOTDEVSIM) DAQmxConfig("R0", "$(CDAQ)/port0/line2", 2, "AI","OneShot N=1 F=0") +$(IFNOTDEVSIM) DAQmxConfig("R0", "$(CDAQ)/port0/line3", 3, "AI","OneShot N=1 F=0") + + +## Load record instances +$(IFNOTDEVSIM) dbLoadRecords("$(DAQMXBASE)/db/DAQmxBaseIOC.vdb","DAQMX=$(MYPVPREFIX)$(IOCNAME):DAQ,RECSIM=$(RECSIM=0)") + +$(IFNOTDEVSIM) dbLoadRecords("$(DAQMXBASE)/db/DAQmxBaseAnIn.db","DAQMX=$(MYPVPREFIX)$(IOCNAME):DAQ:AI,PORT=R0,CHAN=0") +$(IFNOTDEVSIM) dbLoadRecords("$(DAQMXBASE)/db/DAQmxBaseAnIn.db","DAQMX=$(MYPVPREFIX)$(IOCNAME):DAQ:AI,PORT=R0,CHAN=1") +$(IFNOTDEVSIM) dbLoadRecords("$(DAQMXBASE)/db/DAQmxBaseAnIn.db","DAQMX=$(MYPVPREFIX)$(IOCNAME):DAQ:AI,PORT=R0,CHAN=2") +$(IFNOTDEVSIM) dbLoadRecords("$(DAQMXBASE)/db/DAQmxBaseAnIn.db","DAQMX=$(MYPVPREFIX)$(IOCNAME):DAQ:AI,PORT=R0,CHAN=3") + diff --git a/KICKER/iocBoot/iocKICKER-IOC-01/st.cmd b/KICKER/iocBoot/iocKICKER-IOC-01/st.cmd index 3d91b770d..a198166d8 100644 --- a/KICKER/iocBoot/iocKICKER-IOC-01/st.cmd +++ b/KICKER/iocBoot/iocKICKER-IOC-01/st.cmd @@ -14,5 +14,50 @@ cd "${TOP}" dbLoadDatabase "dbd/KICKER-IOC-01.dbd" KICKER_IOC_01_registerRecordDeviceDriver pdbbase -## calling common command file in ioc 01 boot dir -< ${TOP}/iocBoot/iocKICKER-IOC-01/st-common.cmd +epicsEnvSet "STREAM_PROTOCOL_PATH" "$(KICKER)/data" +epicsEnvSet "DEVICE" "L0" + +##ISIS## Run IOC initialisation +< $(IOCSTARTUP)/init.cmd + +## Device simulation mode IP configuration +$(IFDEVSIM) drvAsynIPPortConfigure("$(DEVICE)", "localhost:$(EMULATOR_PORT=57677)") + +## For recsim: +$(IFRECSIM) drvAsynSerialPortConfigure("$(DEVICE)", "$(PORT=NUL)", 0, 1, 0, 0) + +## For real device: +$(IFNOTDEVSIM) $(IFNOTRECSIM) drvAsynSerialPortConfigure("$(DEVICE)", "$(PORT=NO_PORT_MACRO)", 0, 0, 0, 0) +$(IFNOTDEVSIM) $(IFNOTRECSIM) asynSetOption("$(DEVICE)", -1, "baud", "$(BAUD=9600)") +$(IFNOTDEVSIM) $(IFNOTRECSIM) asynSetOption("$(DEVICE)", -1, "bits", "$(BITS=8)") +$(IFNOTDEVSIM) $(IFNOTRECSIM) asynSetOption("$(DEVICE)", -1, "parity", "$(PARITY=none)") +$(IFNOTDEVSIM) $(IFNOTRECSIM) asynSetOption("$(DEVICE)", -1, "stop", "$(STOP=1)") +## Hardware flow control off +$(IFNOTDEVSIM) $(IFNOTRECSIM) asynSetOption("$(DEVICE)", 0, "clocal", "Y") +$(IFNOTDEVSIM) $(IFNOTRECSIM) asynSetOption("$(DEVICE)",0,"crtscts","N") +## Software flow control off +$(IFNOTDEVSIM) $(IFNOTRECSIM) asynSetOption("$(DEVICE)",0,"ixon","N") +$(IFNOTDEVSIM) $(IFNOTRECSIM) asynSetOption("$(DEVICE)",0,"ixoff","N") + +## Load record instances + +##ISIS## Load common DB records +< $(IOCSTARTUP)/dbload.cmd + +# Load up DB record for talking to the DAQ box +< iocBoot/iocKICKER-IOC-01/st-daq.cmd + +## Load our record instances +dbLoadRecords("$(KICKER)/db/kicker.db","PVPREFIX=$(MYPVPREFIX),P=$(MYPVPREFIX)$(IOCNAME):,RECSIM=$(RECSIM=0),DISABLE=$(DISABLE=0),PORT=$(DEVICE)") + +##ISIS## Stuff that needs to be done after all records are loaded but before iocInit is called +< $(IOCSTARTUP)/preiocinit.cmd + +cd "${TOP}/iocBoot/${IOC}" +iocInit + +## Start any sequence programs +#seq sncxxx,"user=olz75487" + +##ISIS## Stuff that needs to be done after iocInit is called e.g. sequence programs +< $(IOCSTARTUP)/postiocinit.cmd From 792d0a64cfb17d418aac694e2af499d035dc5ea8 Mon Sep 17 00:00:00 2001 From: Rory-Potter-Tessella Date: Fri, 17 Aug 2018 13:31:41 +0100 Subject: [PATCH 03/14] Added modbus files --- .../iocBoot/iocKICKER-IOC-01/st-schneider.cmd | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 KICKER/iocBoot/iocKICKER-IOC-01/st-schneider.cmd diff --git a/KICKER/iocBoot/iocKICKER-IOC-01/st-schneider.cmd b/KICKER/iocBoot/iocKICKER-IOC-01/st-schneider.cmd new file mode 100644 index 000000000..ceacf6bb9 --- /dev/null +++ b/KICKER/iocBoot/iocKICKER-IOC-01/st-schneider.cmd @@ -0,0 +1,53 @@ +## RTU + +## Device simulation mode IP configuration +$(IFDEVSIM) drvAsynIPPortConfigure("$(DEVICE):PLC", "localhost:$(EMULATOR_PORT=57677)") + +## For recsim: +$(IFRECSIM) drvAsynSerialPortConfigure("$(DEVICE):PLC", "$(PORT=NUL)", 0, 1, 0, 0) + +## For real devices +$(IFNOTDEVSIM) $(IFNOTRECSIM) drvAsynSerialPortConfigure("$(DEVICE):PLC","$(PORT=NO_PORT_MACRO)",0,0,0) # change this +$(IFNOTDEVSIM) $(IFNOTRECSIM) asynSetOption("$(DEVICE):PLC",0,"baud","9600") +$(IFNOTDEVSIM) $(IFNOTRECSIM) asynSetOption("$(DEVICE):PLC",0,"bits","8") +$(IFNOTDEVSIM) $(IFNOTRECSIM) asynSetOption("$(DEVICE):PLC",0,"parity","even") +$(IFNOTDEVSIM) $(IFNOTRECSIM) asynSetOption("$(DEVICE):PLC",0,"stop","1") + +# Hardware flow control +$(IFNOTDEVSIM) $(IFNOTRECSIM) asynSetOption("$(DEVICE):PLC",0,"clocal","N") # N enables DSR/DTR handshaking +$(IFNOTDEVSIM) $(IFNOTRECSIM) asynSetOption("$(DEVICE):PLC",0,"crtscts","N") + +# Softawre flow control on +$(IFNOTDEVSIM) $(IFNOTRECSIM) asynSetOption("$(DEVICE):PLC",0,"ixon","Y") +$(IFNOTDEVSIM) $(IFNOTRECSIM) asynSetOption("$(DEVICE):PLC",0,"ixoff","Y") + +## Add an asyn "interpose interface" driver. +####################################################################### +# modbusInterposeConfig(const char *portName, +# modbusLinkType linkType, .... Modbus link layer type: 0 = TCP/IP , 1 = RTU, 2 = ASCII +# int timeoutMsec, +# int writeDelayMsec) +####################################################################### +$(IFNOTRECSIM) modbusInterposeConfig($(DEVICE):PLC, 0, 0, 0) + +# Creates a modbus port driver +####################################################################### +# modbus port driver is created with the following command: +#drvModbusAsynConfigure(portName, +# tcpPortName, +# slaveAddress, +# modbusFunction, +# modbusStartAddress, +# modbusLength, +# dataType, +# pollMsec, +# plcType); +# Modbus functions: +# Read Holding Registers: 3 +####################################################################### + +$(IFNOTRECSIM) drvModbusAsynConfigure("$(DEVICE):POWER", "$(DEVICE):PLC", 1, 3, 0, 1, 0, 1000, "PLC") + + +# Load modbus record from template +dbLoadRecords("$(KICKER)/db/kicker_power.db","PVPREFIX=$(MYPVPREFIX),P=$(MYPVPREFIX)$(IOCNAME):,RECSIM=$(RECSIM=0),DISABLE=$(DISABLE=0),PORT=$(DEVICE),R=$(R=)") \ No newline at end of file From 4f275ac9fce36c8ee1c74864714c2d12e13bcae6 Mon Sep 17 00:00:00 2001 From: Rory-Potter-Tessella Date: Fri, 17 Aug 2018 13:33:41 +0100 Subject: [PATCH 04/14] Updated to configure modbus --- KICKER/configure/RELEASE | 1 + KICKER/iocBoot/iocKICKER-IOC-01/st.cmd | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/KICKER/configure/RELEASE b/KICKER/configure/RELEASE index 42685f530..c852d70bb 100644 --- a/KICKER/configure/RELEASE +++ b/KICKER/configure/RELEASE @@ -52,6 +52,7 @@ DAQMXBASE=$(SUPPORT)/DAQmxBase\master DEVIOCSTATS=$(SUPPORT)/devIocStats/master ICPCONFIG=$(SUPPORT)/icpconfig/master LIBJSON=$(SUPPORT)/libjson/master +MODBUS=$(SUPPORT)/modbus/master MYSQL=$(SUPPORT)/MySQL/master ONCRPC=$(SUPPORT)/oncrpc/master PCRE=$(SUPPORT)/pcre/master diff --git a/KICKER/iocBoot/iocKICKER-IOC-01/st.cmd b/KICKER/iocBoot/iocKICKER-IOC-01/st.cmd index a198166d8..273ba783e 100644 --- a/KICKER/iocBoot/iocKICKER-IOC-01/st.cmd +++ b/KICKER/iocBoot/iocKICKER-IOC-01/st.cmd @@ -20,6 +20,9 @@ epicsEnvSet "DEVICE" "L0" ##ISIS## Run IOC initialisation < $(IOCSTARTUP)/init.cmd +## Modbus configuration +drvModbusAsynConfigure("$(DEVICE)heartbeat", "$(DEVICE)", 1, 3, 649, 1, 0, 1000, "PLC") + ## Device simulation mode IP configuration $(IFDEVSIM) drvAsynIPPortConfigure("$(DEVICE)", "localhost:$(EMULATOR_PORT=57677)") @@ -44,11 +47,14 @@ $(IFNOTDEVSIM) $(IFNOTRECSIM) asynSetOption("$(DEVICE)",0,"ixoff","N") ##ISIS## Load common DB records < $(IOCSTARTUP)/dbload.cmd -# Load up DB record for talking to the DAQ box +# Load up DB records for talking to the DAQ box < iocBoot/iocKICKER-IOC-01/st-daq.cmd +# Load up record for talking to the Schneider M580 PLC +< iocBoot/iocKICKER-IOC-01/st-schneider.cmd + ## Load our record instances -dbLoadRecords("$(KICKER)/db/kicker.db","PVPREFIX=$(MYPVPREFIX),P=$(MYPVPREFIX)$(IOCNAME):,RECSIM=$(RECSIM=0),DISABLE=$(DISABLE=0),PORT=$(DEVICE)") +dbLoadRecords("$(KICKER)/db/kicker.db","PVPREFIX=$(MYPVPREFIX), ,P=$(MYPVPREFIX)$(IOCNAME):,DAQMX=$(MYPVPREFIX)$(IOCNAME):DAQ:,PSU_MAX_VOLT=$(PSU_MAX_VOLT=45), PSU_MAX_CURR=$(PSU_MAX_CURR=15),RECSIM=$(RECSIM=0),DISABLE=$(DISABLE=0),PORT=$(DEVICE)") ##ISIS## Stuff that needs to be done after all records are loaded but before iocInit is called < $(IOCSTARTUP)/preiocinit.cmd From ae2f9d5631ced876c11a2120da6501244acdf8e0 Mon Sep 17 00:00:00 2001 From: Rory-Potter-Tessella Date: Fri, 17 Aug 2018 13:34:07 +0100 Subject: [PATCH 05/14] Updated DAQ config --- KICKER/iocBoot/iocKICKER-IOC-01/st-daq.cmd | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/KICKER/iocBoot/iocKICKER-IOC-01/st-daq.cmd b/KICKER/iocBoot/iocKICKER-IOC-01/st-daq.cmd index 9f9156560..c06d4cfcf 100644 --- a/KICKER/iocBoot/iocKICKER-IOC-01/st-daq.cmd +++ b/KICKER/iocBoot/iocKICKER-IOC-01/st-daq.cmd @@ -1,18 +1,17 @@ ## NI cDAQ-9181 with NI 9375 card -epicsEnvSet("CDAQ","cDAQ9181-RFEMod1") +epicsEnvSet("CDAQ","cDAQ9185-1D195CF") ## CDAQ port0 is input -$(IFNOTDEVSIM) DAQmxConfig("R0", "$(CDAQ)/port0/line0", 0, "AI","OneShot N=1 F=0") -$(IFNOTDEVSIM) DAQmxConfig("R0", "$(CDAQ)/port0/line1", 1, "AI","OneShot N=1 F=0") -$(IFNOTDEVSIM) DAQmxConfig("R0", "$(CDAQ)/port0/line2", 2, "AI","OneShot N=1 F=0") -$(IFNOTDEVSIM) DAQmxConfig("R0", "$(CDAQ)/port0/line3", 3, "AI","OneShot N=1 F=0") +$(IFNOTDEVSIM) DAQmxConfig("R0", "$(CDAQ)/port1/line0", 0, "AI","OneShot N=1 F=0") +$(IFNOTDEVSIM) DAQmxConfig("R0", "$(CDAQ)/port1/line1", 1, "AI","OneShot N=1 F=0") +$(IFNOTDEVSIM) DAQmxConfig("R0", "$(CDAQ)/port1/line2", 2, "AI","OneShot N=1 F=0") +$(IFNOTDEVSIM) DAQmxConfig("R0", "$(CDAQ)/port1/line3", 3, "AI","OneShot N=1 F=0") ## Load record instances $(IFNOTDEVSIM) dbLoadRecords("$(DAQMXBASE)/db/DAQmxBaseIOC.vdb","DAQMX=$(MYPVPREFIX)$(IOCNAME):DAQ,RECSIM=$(RECSIM=0)") -$(IFNOTDEVSIM) dbLoadRecords("$(DAQMXBASE)/db/DAQmxBaseAnIn.db","DAQMX=$(MYPVPREFIX)$(IOCNAME):DAQ:AI,PORT=R0,CHAN=0") -$(IFNOTDEVSIM) dbLoadRecords("$(DAQMXBASE)/db/DAQmxBaseAnIn.db","DAQMX=$(MYPVPREFIX)$(IOCNAME):DAQ:AI,PORT=R0,CHAN=1") -$(IFNOTDEVSIM) dbLoadRecords("$(DAQMXBASE)/db/DAQmxBaseAnIn.db","DAQMX=$(MYPVPREFIX)$(IOCNAME):DAQ:AI,PORT=R0,CHAN=2") -$(IFNOTDEVSIM) dbLoadRecords("$(DAQMXBASE)/db/DAQmxBaseAnIn.db","DAQMX=$(MYPVPREFIX)$(IOCNAME):DAQ:AI,PORT=R0,CHAN=3") - +$(IFNOTDEVSIM) dbLoadRecords("$(DAQMXBASE)/db/DAQmxBaseAnIn.db","DAQMX=$(MYPVPREFIX)$(IOCNAME):DAQ,PORT=R0,CHAN=0,IFRECSIM=$(IFRECSIM),IFNOTRECSIM=$(IFNOTRECSIM)") +$(IFNOTDEVSIM) dbLoadRecords("$(DAQMXBASE)/db/DAQmxBaseAnIn.db","DAQMX=$(MYPVPREFIX)$(IOCNAME):DAQ,PORT=R0,CHAN=1,IFRECSIM=$(IFRECSIM),IFNOTRECSIM=$(IFNOTRECSIM)") +$(IFNOTDEVSIM) dbLoadRecords("$(DAQMXBASE)/db/DAQmxBaseAnIn.db","DAQMX=$(MYPVPREFIX)$(IOCNAME):DAQ,PORT=R0,CHAN=2,IFRECSIM=$(IFRECSIM),IFNOTRECSIM=$(IFNOTRECSIM)") +$(IFNOTDEVSIM) dbLoadRecords("$(DAQMXBASE)/db/DAQmxBaseAnIn.db","DAQMX=$(MYPVPREFIX)$(IOCNAME):DAQ,PORT=R0,CHAN=3,IFRECSIM=$(IFRECSIM),IFNOTRECSIM=$(IFNOTRECSIM)") From 9c7196bbecb76c89c18ecee0eda7b875ea2a32bf Mon Sep 17 00:00:00 2001 From: Rory-Potter-Tessella Date: Mon, 20 Aug 2018 16:40:29 +0100 Subject: [PATCH 06/14] Updated DAQ config and loaded current records --- KICKER/iocBoot/iocKICKER-IOC-01/st-daq.cmd | 27 ++++++++-------------- KICKER/iocBoot/iocKICKER-IOC-01/st.cmd | 4 +++- 2 files changed, 13 insertions(+), 18 deletions(-) diff --git a/KICKER/iocBoot/iocKICKER-IOC-01/st-daq.cmd b/KICKER/iocBoot/iocKICKER-IOC-01/st-daq.cmd index c06d4cfcf..1dbee1792 100644 --- a/KICKER/iocBoot/iocKICKER-IOC-01/st-daq.cmd +++ b/KICKER/iocBoot/iocKICKER-IOC-01/st-daq.cmd @@ -1,17 +1,10 @@ -## NI cDAQ-9181 with NI 9375 card -epicsEnvSet("CDAQ","cDAQ9185-1D195CF") - -## CDAQ port0 is input -$(IFNOTDEVSIM) DAQmxConfig("R0", "$(CDAQ)/port1/line0", 0, "AI","OneShot N=1 F=0") -$(IFNOTDEVSIM) DAQmxConfig("R0", "$(CDAQ)/port1/line1", 1, "AI","OneShot N=1 F=0") -$(IFNOTDEVSIM) DAQmxConfig("R0", "$(CDAQ)/port1/line2", 2, "AI","OneShot N=1 F=0") -$(IFNOTDEVSIM) DAQmxConfig("R0", "$(CDAQ)/port1/line3", 3, "AI","OneShot N=1 F=0") - - -## Load record instances -$(IFNOTDEVSIM) dbLoadRecords("$(DAQMXBASE)/db/DAQmxBaseIOC.vdb","DAQMX=$(MYPVPREFIX)$(IOCNAME):DAQ,RECSIM=$(RECSIM=0)") - -$(IFNOTDEVSIM) dbLoadRecords("$(DAQMXBASE)/db/DAQmxBaseAnIn.db","DAQMX=$(MYPVPREFIX)$(IOCNAME):DAQ,PORT=R0,CHAN=0,IFRECSIM=$(IFRECSIM),IFNOTRECSIM=$(IFNOTRECSIM)") -$(IFNOTDEVSIM) dbLoadRecords("$(DAQMXBASE)/db/DAQmxBaseAnIn.db","DAQMX=$(MYPVPREFIX)$(IOCNAME):DAQ,PORT=R0,CHAN=1,IFRECSIM=$(IFRECSIM),IFNOTRECSIM=$(IFNOTRECSIM)") -$(IFNOTDEVSIM) dbLoadRecords("$(DAQMXBASE)/db/DAQmxBaseAnIn.db","DAQMX=$(MYPVPREFIX)$(IOCNAME):DAQ,PORT=R0,CHAN=2,IFRECSIM=$(IFRECSIM),IFNOTRECSIM=$(IFNOTRECSIM)") -$(IFNOTDEVSIM) dbLoadRecords("$(DAQMXBASE)/db/DAQmxBaseAnIn.db","DAQMX=$(MYPVPREFIX)$(IOCNAME):DAQ,PORT=R0,CHAN=3,IFRECSIM=$(IFRECSIM),IFNOTRECSIM=$(IFNOTRECSIM)") +## NI cDAQ-9185 +epicsEnvSet("CDAQER","cDAQ9185-1D195CFMod2") +epicsEnvSet("CDAQAI","cDAQ9185-1D195CFMod3") +epicsEnvSet("CDAQAO","cDAQ9185-1D195CFMod4") + +## input +$(IFNOTDEVSIM) DAQmxConfig("R0", "$(CDAQAI)/ai0", 0, "AI","N=1000 F=1000") ## Kicker Volt +$(IFNOTDEVSIM) DAQmxConfig("R0", "$(CDAQAI)/ai1", 1, "AI","N=1000 F=1000") ## Kicker Curr +$(IFNOTDEVSIM) DAQmxConfig("R0", "$(CDAQAI)/ai2", 2, "AI","N=1000 F=1000") ## Separator Volt +$(IFNOTDEVSIM) DAQmxConfig("R0", "$(CDAQAI)/ai3", 3, "AI","N=1000 F=1000") ## Separator Curr diff --git a/KICKER/iocBoot/iocKICKER-IOC-01/st.cmd b/KICKER/iocBoot/iocKICKER-IOC-01/st.cmd index 273ba783e..5c0ace97b 100644 --- a/KICKER/iocBoot/iocKICKER-IOC-01/st.cmd +++ b/KICKER/iocBoot/iocKICKER-IOC-01/st.cmd @@ -54,7 +54,9 @@ $(IFNOTDEVSIM) $(IFNOTRECSIM) asynSetOption("$(DEVICE)",0,"ixoff","N") < iocBoot/iocKICKER-IOC-01/st-schneider.cmd ## Load our record instances -dbLoadRecords("$(KICKER)/db/kicker.db","PVPREFIX=$(MYPVPREFIX), ,P=$(MYPVPREFIX)$(IOCNAME):,DAQMX=$(MYPVPREFIX)$(IOCNAME):DAQ:,PSU_MAX_VOLT=$(PSU_MAX_VOLT=45), PSU_MAX_CURR=$(PSU_MAX_CURR=15),RECSIM=$(RECSIM=0),DISABLE=$(DISABLE=0),PORT=$(DEVICE)") +dbLoadRecords("$(KICKER)/db/kicker.db","PVPREFIX=$(MYPVPREFIX), ,P=$(MYPVPREFIX)$(IOCNAME):,DAQMX=$(MYPVPREFIX)$(IOCNAME):DAQ:, PSU_MAX_CURR=$(PSU_MAX_CURR=15),RECSIM=$(RECSIM=0),DISABLE=$(DISABLE=0),PORT=$(DEVICE)") +dbLoadRecords("$(KICKER)/db/kicker_voltage.db","PVPREFIX=$(MYPVPREFIX),P=$(MYPVPREFIX)$(IOCNAME):,RECSIM=$(RECSIM=0),DISABLE=$(DISABLE=0),PORT=$(DEVICE),DAQMX=$(MYPVPREFIX)$(IOCNAME):DAQ:,IFNOTRECSIM=$(IFNOTRECSIM),IFRECSIM=$(IFRECSIM),PSU_MAX_VOLT=$(PSU_MAX_VOLT=45)") +dbLoadRecords("$(KICKER)/db/kicker_current.db","PVPREFIX=$(MYPVPREFIX),P=$(MYPVPREFIX)$(IOCNAME):,RECSIM=$(RECSIM=0),DISABLE=$(DISABLE=0),PORT=$(DEVICE),DAQMX=$(MYPVPREFIX)$(IOCNAME):DAQ:,IFNOTRECSIM=$(IFNOTRECSIM),IFRECSIM=$(IFRECSIM),PSU_MAX_CURR=$(PSU_MAX_VOLT=15)") ##ISIS## Stuff that needs to be done after all records are loaded but before iocInit is called < $(IOCSTARTUP)/preiocinit.cmd From a3453c54f1c0b4f259eeed02d01e4486009c323e Mon Sep 17 00:00:00 2001 From: Rory-Potter-Tessella Date: Tue, 21 Aug 2018 16:57:30 +0100 Subject: [PATCH 07/14] Added changes to work with device --- KICKER/KICKER-IOC-01App/src/build.mak | 2 ++ KICKER/configure/RELEASE | 2 +- KICKER/iocBoot/iocKICKER-IOC-01/st-daq.cmd | 4 ---- KICKER/iocBoot/iocKICKER-IOC-01/st.cmd | 16 ---------------- 4 files changed, 3 insertions(+), 21 deletions(-) diff --git a/KICKER/KICKER-IOC-01App/src/build.mak b/KICKER/KICKER-IOC-01App/src/build.mak index 6703cdab1..d92622944 100644 --- a/KICKER/KICKER-IOC-01App/src/build.mak +++ b/KICKER/KICKER-IOC-01App/src/build.mak @@ -31,6 +31,7 @@ $(APPNAME)_DBD += asyn.dbd $(APPNAME)_DBD += drvAsynSerialPort.dbd $(APPNAME)_DBD += drvAsynIPPort.dbd $(APPNAME)_DBD += calcSupport.dbd +$(APPNAME)_DBD += DAQmxSupport.dbd ## add other dbd here ## #$(APPNAME)_DBD += xxx.dbd @@ -50,6 +51,7 @@ $(APPNAME)_LIBS += asyn ## Add other libraries here ## $(APPNAME)_LIBS += calc #$(APPNAME)_LIBS += xxx +$(APPNAME)_LIBS += DAQmxSupport # KICKER-IOC-01_registerRecordDeviceDriver.cpp derives from KICKER-IOC-01.dbd $(APPNAME)_SRCS += $(APPNAME)_registerRecordDeviceDriver.cpp diff --git a/KICKER/configure/RELEASE b/KICKER/configure/RELEASE index c852d70bb..3561d97bc 100644 --- a/KICKER/configure/RELEASE +++ b/KICKER/configure/RELEASE @@ -48,7 +48,7 @@ ASYN=$(SUPPORT)/asyn/master AUTOSAVE=$(SUPPORT)/autosave/master CALC=$(SUPPORT)/calc/master CAPUTLOG=$(SUPPORT)/caPutLog/master -DAQMXBASE=$(SUPPORT)/DAQmxBase\master +DAQMXBASE=$(SUPPORT)/DAQmxBase/master DEVIOCSTATS=$(SUPPORT)/devIocStats/master ICPCONFIG=$(SUPPORT)/icpconfig/master LIBJSON=$(SUPPORT)/libjson/master diff --git a/KICKER/iocBoot/iocKICKER-IOC-01/st-daq.cmd b/KICKER/iocBoot/iocKICKER-IOC-01/st-daq.cmd index 1dbee1792..379a073ba 100644 --- a/KICKER/iocBoot/iocKICKER-IOC-01/st-daq.cmd +++ b/KICKER/iocBoot/iocKICKER-IOC-01/st-daq.cmd @@ -1,10 +1,6 @@ ## NI cDAQ-9185 -epicsEnvSet("CDAQER","cDAQ9185-1D195CFMod2") epicsEnvSet("CDAQAI","cDAQ9185-1D195CFMod3") -epicsEnvSet("CDAQAO","cDAQ9185-1D195CFMod4") ## input $(IFNOTDEVSIM) DAQmxConfig("R0", "$(CDAQAI)/ai0", 0, "AI","N=1000 F=1000") ## Kicker Volt $(IFNOTDEVSIM) DAQmxConfig("R0", "$(CDAQAI)/ai1", 1, "AI","N=1000 F=1000") ## Kicker Curr -$(IFNOTDEVSIM) DAQmxConfig("R0", "$(CDAQAI)/ai2", 2, "AI","N=1000 F=1000") ## Separator Volt -$(IFNOTDEVSIM) DAQmxConfig("R0", "$(CDAQAI)/ai3", 3, "AI","N=1000 F=1000") ## Separator Curr diff --git a/KICKER/iocBoot/iocKICKER-IOC-01/st.cmd b/KICKER/iocBoot/iocKICKER-IOC-01/st.cmd index 5c0ace97b..c598eb354 100644 --- a/KICKER/iocBoot/iocKICKER-IOC-01/st.cmd +++ b/KICKER/iocBoot/iocKICKER-IOC-01/st.cmd @@ -23,25 +23,9 @@ epicsEnvSet "DEVICE" "L0" ## Modbus configuration drvModbusAsynConfigure("$(DEVICE)heartbeat", "$(DEVICE)", 1, 3, 649, 1, 0, 1000, "PLC") -## Device simulation mode IP configuration -$(IFDEVSIM) drvAsynIPPortConfigure("$(DEVICE)", "localhost:$(EMULATOR_PORT=57677)") - ## For recsim: $(IFRECSIM) drvAsynSerialPortConfigure("$(DEVICE)", "$(PORT=NUL)", 0, 1, 0, 0) -## For real device: -$(IFNOTDEVSIM) $(IFNOTRECSIM) drvAsynSerialPortConfigure("$(DEVICE)", "$(PORT=NO_PORT_MACRO)", 0, 0, 0, 0) -$(IFNOTDEVSIM) $(IFNOTRECSIM) asynSetOption("$(DEVICE)", -1, "baud", "$(BAUD=9600)") -$(IFNOTDEVSIM) $(IFNOTRECSIM) asynSetOption("$(DEVICE)", -1, "bits", "$(BITS=8)") -$(IFNOTDEVSIM) $(IFNOTRECSIM) asynSetOption("$(DEVICE)", -1, "parity", "$(PARITY=none)") -$(IFNOTDEVSIM) $(IFNOTRECSIM) asynSetOption("$(DEVICE)", -1, "stop", "$(STOP=1)") -## Hardware flow control off -$(IFNOTDEVSIM) $(IFNOTRECSIM) asynSetOption("$(DEVICE)", 0, "clocal", "Y") -$(IFNOTDEVSIM) $(IFNOTRECSIM) asynSetOption("$(DEVICE)",0,"crtscts","N") -## Software flow control off -$(IFNOTDEVSIM) $(IFNOTRECSIM) asynSetOption("$(DEVICE)",0,"ixon","N") -$(IFNOTDEVSIM) $(IFNOTRECSIM) asynSetOption("$(DEVICE)",0,"ixoff","N") - ## Load record instances ##ISIS## Load common DB records From b38705c1599b652adee8121db0b52c12299691f7 Mon Sep 17 00:00:00 2001 From: Rory-Potter-Tessella Date: Tue, 28 Aug 2018 11:37:16 +0100 Subject: [PATCH 08/14] Added Modbus support files to build --- KICKER/KICKER-IOC-01App/src/build.mak | 2 ++ .../iocBoot/iocKICKER-IOC-01/st-schneider.cmd | 23 ++++++++----------- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/KICKER/KICKER-IOC-01App/src/build.mak b/KICKER/KICKER-IOC-01App/src/build.mak index d92622944..cb46cd7d4 100644 --- a/KICKER/KICKER-IOC-01App/src/build.mak +++ b/KICKER/KICKER-IOC-01App/src/build.mak @@ -32,6 +32,7 @@ $(APPNAME)_DBD += drvAsynSerialPort.dbd $(APPNAME)_DBD += drvAsynIPPort.dbd $(APPNAME)_DBD += calcSupport.dbd $(APPNAME)_DBD += DAQmxSupport.dbd +$(APPNAME)_DBD += modbusSupport.dbd ## add other dbd here ## #$(APPNAME)_DBD += xxx.dbd @@ -52,6 +53,7 @@ $(APPNAME)_LIBS += asyn $(APPNAME)_LIBS += calc #$(APPNAME)_LIBS += xxx $(APPNAME)_LIBS += DAQmxSupport +$(APPNAME)_LIBS += modbus # KICKER-IOC-01_registerRecordDeviceDriver.cpp derives from KICKER-IOC-01.dbd $(APPNAME)_SRCS += $(APPNAME)_registerRecordDeviceDriver.cpp diff --git a/KICKER/iocBoot/iocKICKER-IOC-01/st-schneider.cmd b/KICKER/iocBoot/iocKICKER-IOC-01/st-schneider.cmd index ceacf6bb9..b3e83237f 100644 --- a/KICKER/iocBoot/iocKICKER-IOC-01/st-schneider.cmd +++ b/KICKER/iocBoot/iocKICKER-IOC-01/st-schneider.cmd @@ -1,25 +1,22 @@ ## RTU -## Device simulation mode IP configuration -$(IFDEVSIM) drvAsynIPPortConfigure("$(DEVICE):PLC", "localhost:$(EMULATOR_PORT=57677)") - ## For recsim: $(IFRECSIM) drvAsynSerialPortConfigure("$(DEVICE):PLC", "$(PORT=NUL)", 0, 1, 0, 0) ## For real devices -$(IFNOTDEVSIM) $(IFNOTRECSIM) drvAsynSerialPortConfigure("$(DEVICE):PLC","$(PORT=NO_PORT_MACRO)",0,0,0) # change this -$(IFNOTDEVSIM) $(IFNOTRECSIM) asynSetOption("$(DEVICE):PLC",0,"baud","9600") -$(IFNOTDEVSIM) $(IFNOTRECSIM) asynSetOption("$(DEVICE):PLC",0,"bits","8") -$(IFNOTDEVSIM) $(IFNOTRECSIM) asynSetOption("$(DEVICE):PLC",0,"parity","even") -$(IFNOTDEVSIM) $(IFNOTRECSIM) asynSetOption("$(DEVICE):PLC",0,"stop","1") +$(IFNOTRECSIM) drvAsynSerialPortConfigure("$(DEVICE):PLC","$(PORT=NO_PORT_MACRO)",0,0,0) # change this +$(IFNOTRECSIM) asynSetOption("$(DEVICE):PLC",0,"baud","9600") +$(IFNOTRECSIM) asynSetOption("$(DEVICE):PLC",0,"bits","8") +$(IFNOTRECSIM) asynSetOption("$(DEVICE):PLC",0,"parity","even") +$(IFNOTRECSIM) asynSetOption("$(DEVICE):PLC",0,"stop","1") # Hardware flow control -$(IFNOTDEVSIM) $(IFNOTRECSIM) asynSetOption("$(DEVICE):PLC",0,"clocal","N") # N enables DSR/DTR handshaking -$(IFNOTDEVSIM) $(IFNOTRECSIM) asynSetOption("$(DEVICE):PLC",0,"crtscts","N") +$(IFNOTRECSIM) asynSetOption("$(DEVICE):PLC",0,"clocal","N") # N enables DSR/DTR handshaking +$(IFNOTRECSIM) asynSetOption("$(DEVICE):PLC",0,"crtscts","N") # Softawre flow control on -$(IFNOTDEVSIM) $(IFNOTRECSIM) asynSetOption("$(DEVICE):PLC",0,"ixon","Y") -$(IFNOTDEVSIM) $(IFNOTRECSIM) asynSetOption("$(DEVICE):PLC",0,"ixoff","Y") +$(IFNOTRECSIM) asynSetOption("$(DEVICE):PLC",0,"ixon","Y") +$(IFNOTRECSIM) asynSetOption("$(DEVICE):PLC",0,"ixoff","Y") ## Add an asyn "interpose interface" driver. ####################################################################### @@ -50,4 +47,4 @@ $(IFNOTRECSIM) drvModbusAsynConfigure("$(DEVICE):POWER", "$(DEVICE):PLC", 1, 3, # Load modbus record from template -dbLoadRecords("$(KICKER)/db/kicker_power.db","PVPREFIX=$(MYPVPREFIX),P=$(MYPVPREFIX)$(IOCNAME):,RECSIM=$(RECSIM=0),DISABLE=$(DISABLE=0),PORT=$(DEVICE),R=$(R=)") \ No newline at end of file +dbLoadRecords("$(KICKER)/db/kicker_power.db","PVPREFIX=$(MYPVPREFIX),P=$(MYPVPREFIX)$(IOCNAME):,IFNOTRECSIM=$(IFNOTRECSIM),RECSIM=$(RECSIM=0),DISABLE=$(DISABLE=0),PORT=$(DEVICE)") \ No newline at end of file From b19f48f9943928197a13fc1a72ae1d5d5e30c4e5 Mon Sep 17 00:00:00 2001 From: Rory-Potter-Tessella Date: Tue, 28 Aug 2018 12:24:47 +0100 Subject: [PATCH 09/14] Updated records loading --- KICKER/iocBoot/iocKICKER-IOC-01/st.cmd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/KICKER/iocBoot/iocKICKER-IOC-01/st.cmd b/KICKER/iocBoot/iocKICKER-IOC-01/st.cmd index c598eb354..ea4282d2c 100644 --- a/KICKER/iocBoot/iocKICKER-IOC-01/st.cmd +++ b/KICKER/iocBoot/iocKICKER-IOC-01/st.cmd @@ -39,8 +39,8 @@ $(IFRECSIM) drvAsynSerialPortConfigure("$(DEVICE)", "$(PORT=NUL)", 0, 1, 0, 0) ## Load our record instances dbLoadRecords("$(KICKER)/db/kicker.db","PVPREFIX=$(MYPVPREFIX), ,P=$(MYPVPREFIX)$(IOCNAME):,DAQMX=$(MYPVPREFIX)$(IOCNAME):DAQ:, PSU_MAX_CURR=$(PSU_MAX_CURR=15),RECSIM=$(RECSIM=0),DISABLE=$(DISABLE=0),PORT=$(DEVICE)") -dbLoadRecords("$(KICKER)/db/kicker_voltage.db","PVPREFIX=$(MYPVPREFIX),P=$(MYPVPREFIX)$(IOCNAME):,RECSIM=$(RECSIM=0),DISABLE=$(DISABLE=0),PORT=$(DEVICE),DAQMX=$(MYPVPREFIX)$(IOCNAME):DAQ:,IFNOTRECSIM=$(IFNOTRECSIM),IFRECSIM=$(IFRECSIM),PSU_MAX_VOLT=$(PSU_MAX_VOLT=45)") -dbLoadRecords("$(KICKER)/db/kicker_current.db","PVPREFIX=$(MYPVPREFIX),P=$(MYPVPREFIX)$(IOCNAME):,RECSIM=$(RECSIM=0),DISABLE=$(DISABLE=0),PORT=$(DEVICE),DAQMX=$(MYPVPREFIX)$(IOCNAME):DAQ:,IFNOTRECSIM=$(IFNOTRECSIM),IFRECSIM=$(IFRECSIM),PSU_MAX_CURR=$(PSU_MAX_VOLT=15)") +dbLoadRecords("$(KICKER)/db/kicker_voltage.db","PVPREFIX=$(MYPVPREFIX),P=$(MYPVPREFIX)$(IOCNAME):,RECSIM=$(RECSIM=0),DISABLE=$(DISABLE=0),PORT=$(DEVICE),DAQMX=$(MYPVPREFIX)$(IOCNAME):DAQ:,IFNOTRECSIM=$(IFNOTRECSIM),IFRECSIM=$(IFRECSIM),PSU_MAX_VOLT=$(PSU_MAX_VOLT=45),NELM=$(NELM=1000)") +dbLoadRecords("$(KICKER)/db/kicker_current.db","PVPREFIX=$(MYPVPREFIX),P=$(MYPVPREFIX)$(IOCNAME):,RECSIM=$(RECSIM=0),DISABLE=$(DISABLE=0),PORT=$(DEVICE),DAQMX=$(MYPVPREFIX)$(IOCNAME):DAQ:,IFNOTRECSIM=$(IFNOTRECSIM),IFRECSIM=$(IFRECSIM),PSU_MAX_CURR=$(PSU_MAX_VOLT=15),NELM=$(NELM=1000)") ##ISIS## Stuff that needs to be done after all records are loaded but before iocInit is called < $(IOCSTARTUP)/preiocinit.cmd From 344cc860dc50a2a3b6b12bf35468ecdbe36ae6c3 Mon Sep 17 00:00:00 2001 From: Rory-Potter-Tessella Date: Tue, 28 Aug 2018 13:28:49 +0100 Subject: [PATCH 10/14] Tidy up of iocBoot --- KICKER/iocBoot/iocKICKER-IOC-01/config.xml | 3 +-- KICKER/iocBoot/iocKICKER-IOC-01/st-schneider.cmd | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/KICKER/iocBoot/iocKICKER-IOC-01/config.xml b/KICKER/iocBoot/iocKICKER-IOC-01/config.xml index 43f3fa8f7..07185180c 100644 --- a/KICKER/iocBoot/iocKICKER-IOC-01/config.xml +++ b/KICKER/iocBoot/iocKICKER-IOC-01/config.xml @@ -1,8 +1,7 @@ -This is a template description -These are template details +Kicker PSU diff --git a/KICKER/iocBoot/iocKICKER-IOC-01/st-schneider.cmd b/KICKER/iocBoot/iocKICKER-IOC-01/st-schneider.cmd index b3e83237f..fd0c41ba3 100644 --- a/KICKER/iocBoot/iocKICKER-IOC-01/st-schneider.cmd +++ b/KICKER/iocBoot/iocKICKER-IOC-01/st-schneider.cmd @@ -47,4 +47,4 @@ $(IFNOTRECSIM) drvModbusAsynConfigure("$(DEVICE):POWER", "$(DEVICE):PLC", 1, 3, # Load modbus record from template -dbLoadRecords("$(KICKER)/db/kicker_power.db","PVPREFIX=$(MYPVPREFIX),P=$(MYPVPREFIX)$(IOCNAME):,IFNOTRECSIM=$(IFNOTRECSIM),RECSIM=$(RECSIM=0),DISABLE=$(DISABLE=0),PORT=$(DEVICE)") \ No newline at end of file +dbLoadRecords("$(KICKER)/db/kicker_power.db","PVPREFIX=$(MYPVPREFIX),P=$(MYPVPREFIX)$(IOCNAME):,IFNOTRECSIM=$(IFNOTRECSIM),RECSIM=$(RECSIM=0),DISABLE=$(DISABLE=0),PORT=$(DEVICE)") From 1929c112d8f0a6f3009fd65b79264155c5cbfb5d Mon Sep 17 00:00:00 2001 From: Rory-Potter-Tessella Date: Tue, 28 Aug 2018 13:31:25 +0100 Subject: [PATCH 11/14] Tidy up st-daq for testing --- KICKER/iocBoot/iocKICKER-IOC-01/st-daq.cmd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/KICKER/iocBoot/iocKICKER-IOC-01/st-daq.cmd b/KICKER/iocBoot/iocKICKER-IOC-01/st-daq.cmd index 379a073ba..0e38958f6 100644 --- a/KICKER/iocBoot/iocKICKER-IOC-01/st-daq.cmd +++ b/KICKER/iocBoot/iocKICKER-IOC-01/st-daq.cmd @@ -2,5 +2,5 @@ epicsEnvSet("CDAQAI","cDAQ9185-1D195CFMod3") ## input -$(IFNOTDEVSIM) DAQmxConfig("R0", "$(CDAQAI)/ai0", 0, "AI","N=1000 F=1000") ## Kicker Volt -$(IFNOTDEVSIM) DAQmxConfig("R0", "$(CDAQAI)/ai1", 1, "AI","N=1000 F=1000") ## Kicker Curr +$(IFNOTRECSIM) DAQmxConfig("R0", "$(CDAQAI)/ai0", 0, "AI","N=1000 F=1000") ## Kicker Volt +$(IFNOTRECSIM) DAQmxConfig("R0", "$(CDAQAI)/ai1", 1, "AI","N=1000 F=1000") ## Kicker Curr From e11504ee26ddbeeba4455a92bae5e7b024d6576e Mon Sep 17 00:00:00 2001 From: Rory-Potter-Tessella Date: Thu, 6 Sep 2018 15:10:49 +0100 Subject: [PATCH 12/14] Commented out heartbeat modbus config line --- KICKER/iocBoot/iocKICKER-IOC-01/st-schneider.cmd | 3 +++ 1 file changed, 3 insertions(+) diff --git a/KICKER/iocBoot/iocKICKER-IOC-01/st-schneider.cmd b/KICKER/iocBoot/iocKICKER-IOC-01/st-schneider.cmd index fd0c41ba3..f9d45b9d8 100644 --- a/KICKER/iocBoot/iocKICKER-IOC-01/st-schneider.cmd +++ b/KICKER/iocBoot/iocKICKER-IOC-01/st-schneider.cmd @@ -1,3 +1,6 @@ +## Modbus configuration +# drvModbusAsynConfigure("$(DEVICE)heartbeat", "$(DEVICE)", 1, 3, 649, 1, 0, 1000, "PLC") + ## RTU ## For recsim: From 4ee635f69a9e0f3201972343e496c1f455c1ff47 Mon Sep 17 00:00:00 2001 From: Rory-Potter-Tessella Date: Thu, 6 Sep 2018 15:11:47 +0100 Subject: [PATCH 13/14] Created DAQ port name as a macro, number of elements sampled as a macro and the Frequency of sampling as a macro --- KICKER/iocBoot/iocKICKER-IOC-01/config.xml | 18 ++++++++++-------- KICKER/iocBoot/iocKICKER-IOC-01/st-daq.cmd | 6 +++--- KICKER/iocBoot/iocKICKER-IOC-01/st.cmd | 12 +++--------- 3 files changed, 16 insertions(+), 20 deletions(-) diff --git a/KICKER/iocBoot/iocKICKER-IOC-01/config.xml b/KICKER/iocBoot/iocKICKER-IOC-01/config.xml index 07185180c..a2bb814a4 100644 --- a/KICKER/iocBoot/iocKICKER-IOC-01/config.xml +++ b/KICKER/iocBoot/iocKICKER-IOC-01/config.xml @@ -1,11 +1,13 @@ - -Kicker PSU - - - - - - + + Kicker PSU + + + + + + + + diff --git a/KICKER/iocBoot/iocKICKER-IOC-01/st-daq.cmd b/KICKER/iocBoot/iocKICKER-IOC-01/st-daq.cmd index 0e38958f6..1d84c6e99 100644 --- a/KICKER/iocBoot/iocKICKER-IOC-01/st-daq.cmd +++ b/KICKER/iocBoot/iocKICKER-IOC-01/st-daq.cmd @@ -1,6 +1,6 @@ ## NI cDAQ-9185 -epicsEnvSet("CDAQAI","cDAQ9185-1D195CFMod3") +epicsEnvSet("CDAQAI", "$(DAQ_AI_PORT_NAME = cDAQ9185-MuonFEMod3)") ## input -$(IFNOTRECSIM) DAQmxConfig("R0", "$(CDAQAI)/ai0", 0, "AI","N=1000 F=1000") ## Kicker Volt -$(IFNOTRECSIM) DAQmxConfig("R0", "$(CDAQAI)/ai1", 1, "AI","N=1000 F=1000") ## Kicker Curr +$(IFNOTRECSIM) DAQmxConfig("R0", "$(CDAQAI)/ai0", 0, "AI","N=$(NELM = 1000) F=$(FREQ = 1000)") ## Kicker Volt +$(IFNOTRECSIM) DAQmxConfig("R0", "$(CDAQAI)/ai1", 1, "AI","N=$(NELM = 1000) F=$(FREQ = 1000)") ## Kicker Curr diff --git a/KICKER/iocBoot/iocKICKER-IOC-01/st.cmd b/KICKER/iocBoot/iocKICKER-IOC-01/st.cmd index ea4282d2c..d37b70682 100644 --- a/KICKER/iocBoot/iocKICKER-IOC-01/st.cmd +++ b/KICKER/iocBoot/iocKICKER-IOC-01/st.cmd @@ -20,12 +20,6 @@ epicsEnvSet "DEVICE" "L0" ##ISIS## Run IOC initialisation < $(IOCSTARTUP)/init.cmd -## Modbus configuration -drvModbusAsynConfigure("$(DEVICE)heartbeat", "$(DEVICE)", 1, 3, 649, 1, 0, 1000, "PLC") - -## For recsim: -$(IFRECSIM) drvAsynSerialPortConfigure("$(DEVICE)", "$(PORT=NUL)", 0, 1, 0, 0) - ## Load record instances ##ISIS## Load common DB records @@ -38,9 +32,9 @@ $(IFRECSIM) drvAsynSerialPortConfigure("$(DEVICE)", "$(PORT=NUL)", 0, 1, 0, 0) < iocBoot/iocKICKER-IOC-01/st-schneider.cmd ## Load our record instances -dbLoadRecords("$(KICKER)/db/kicker.db","PVPREFIX=$(MYPVPREFIX), ,P=$(MYPVPREFIX)$(IOCNAME):,DAQMX=$(MYPVPREFIX)$(IOCNAME):DAQ:, PSU_MAX_CURR=$(PSU_MAX_CURR=15),RECSIM=$(RECSIM=0),DISABLE=$(DISABLE=0),PORT=$(DEVICE)") -dbLoadRecords("$(KICKER)/db/kicker_voltage.db","PVPREFIX=$(MYPVPREFIX),P=$(MYPVPREFIX)$(IOCNAME):,RECSIM=$(RECSIM=0),DISABLE=$(DISABLE=0),PORT=$(DEVICE),DAQMX=$(MYPVPREFIX)$(IOCNAME):DAQ:,IFNOTRECSIM=$(IFNOTRECSIM),IFRECSIM=$(IFRECSIM),PSU_MAX_VOLT=$(PSU_MAX_VOLT=45),NELM=$(NELM=1000)") -dbLoadRecords("$(KICKER)/db/kicker_current.db","PVPREFIX=$(MYPVPREFIX),P=$(MYPVPREFIX)$(IOCNAME):,RECSIM=$(RECSIM=0),DISABLE=$(DISABLE=0),PORT=$(DEVICE),DAQMX=$(MYPVPREFIX)$(IOCNAME):DAQ:,IFNOTRECSIM=$(IFNOTRECSIM),IFRECSIM=$(IFRECSIM),PSU_MAX_CURR=$(PSU_MAX_VOLT=15),NELM=$(NELM=1000)") +dbLoadRecords("$(KICKER)/db/kicker.db","PVPREFIX=$(MYPVPREFIX), ,P=$(MYPVPREFIX)$(IOCNAME):,RECSIM=$(RECSIM=0),DISABLE=$(DISABLE=0),PORT=$(DEVICE)") +dbLoadRecords("$(KICKER)/db/kicker_voltage.db","PVPREFIX=$(MYPVPREFIX),P=$(MYPVPREFIX)$(IOCNAME):,RECSIM=$(RECSIM=0),DISABLE=$(DISABLE=0),PORT=$(DEVICE),DAQMX=$(DAQMX = DAQ):,IFNOTRECSIM=$(IFNOTRECSIM),IFRECSIM=$(IFRECSIM),PSU_MAX_VOLT=$(PSU_MAX_VOLT=45),NELM=$(NELM=1000)") +dbLoadRecords("$(KICKER)/db/kicker_current.db","PVPREFIX=$(MYPVPREFIX),P=$(MYPVPREFIX)$(IOCNAME):,RECSIM=$(RECSIM=0),DISABLE=$(DISABLE=0),PORT=$(DEVICE),DAQMX=$(DAQMX = DAQ):,IFNOTRECSIM=$(IFNOTRECSIM),IFRECSIM=$(IFRECSIM),PSU_MAX_CURR=$(PSU_MAX_CURR=15),NELM=$(NELM=1000)") ##ISIS## Stuff that needs to be done after all records are loaded but before iocInit is called < $(IOCSTARTUP)/preiocinit.cmd From b9655c9cca4f387aa3c733e497ff53f70c7cc4d5 Mon Sep 17 00:00:00 2001 From: Rory-Potter-Tessella Date: Fri, 7 Sep 2018 12:28:56 +0100 Subject: [PATCH 14/14] Tidy up --- KICKER/iocBoot/iocKICKER-IOC-01/st-daq.cmd | 6 +++--- KICKER/iocBoot/iocKICKER-IOC-01/st-schneider.cmd | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/KICKER/iocBoot/iocKICKER-IOC-01/st-daq.cmd b/KICKER/iocBoot/iocKICKER-IOC-01/st-daq.cmd index 1d84c6e99..10afd2af5 100644 --- a/KICKER/iocBoot/iocKICKER-IOC-01/st-daq.cmd +++ b/KICKER/iocBoot/iocKICKER-IOC-01/st-daq.cmd @@ -1,6 +1,6 @@ ## NI cDAQ-9185 -epicsEnvSet("CDAQAI", "$(DAQ_AI_PORT_NAME = cDAQ9185-MuonFEMod3)") +$(IFNOTRECSIM) epicsEnvSet("CDAQAI", "$(DAQ_AI_PORT_NAME = cDAQ9185-MuonFEMod3)") ## input -$(IFNOTRECSIM) DAQmxConfig("R0", "$(CDAQAI)/ai0", 0, "AI","N=$(NELM = 1000) F=$(FREQ = 1000)") ## Kicker Volt -$(IFNOTRECSIM) DAQmxConfig("R0", "$(CDAQAI)/ai1", 1, "AI","N=$(NELM = 1000) F=$(FREQ = 1000)") ## Kicker Curr +$(IFNOTRECSIM) DAQmxConfig("R0", "$(CDAQAI)/ai1", 1, "AI","N=$(NELM=1000), F=$(FREQ=1000)") ## Kicker Curr +$(IFNOTRECSIM) DAQmxConfig("R0", "$(CDAQAI)/ai0", 0, "AI","N=$(NELM=1000), F=$(FREQ=1000)") ## Kicker Volt diff --git a/KICKER/iocBoot/iocKICKER-IOC-01/st-schneider.cmd b/KICKER/iocBoot/iocKICKER-IOC-01/st-schneider.cmd index f9d45b9d8..0dee30890 100644 --- a/KICKER/iocBoot/iocKICKER-IOC-01/st-schneider.cmd +++ b/KICKER/iocBoot/iocKICKER-IOC-01/st-schneider.cmd @@ -50,4 +50,4 @@ $(IFNOTRECSIM) drvModbusAsynConfigure("$(DEVICE):POWER", "$(DEVICE):PLC", 1, 3, # Load modbus record from template -dbLoadRecords("$(KICKER)/db/kicker_power.db","PVPREFIX=$(MYPVPREFIX),P=$(MYPVPREFIX)$(IOCNAME):,IFNOTRECSIM=$(IFNOTRECSIM),RECSIM=$(RECSIM=0),DISABLE=$(DISABLE=0),PORT=$(DEVICE)") +dbLoadRecords("$(KICKER)/db/kicker_power.db","PVPREFIX=$(MYPVPREFIX),P=$(MYPVPREFIX)$(IOCNAME):,IFNOTRECSIM=$(IFNOTRECSIM),RECSIM=$(RECSIM=0),DISABLE=$(DISABLE=0),PORT=$(DEVICE), DEVICE=$(DEVICE)")