From 80f9140590cd6ea0ea56fc8814408dff043df1aa Mon Sep 17 00:00:00 2001 From: Ole Artz Date: Tue, 8 Aug 2017 11:51:16 +0200 Subject: [PATCH] HAMEG_HMP4030: .proto .db and other requirements --- .../Db/HAMEG_HMP4030.substitutions | 8 + .../Db/HAMEG_HMP4030.template | 237 ++++++++++++++++++ HAMEG_HMP4030/HAMEG_HMP4030App/Db/Makefile | 24 ++ HAMEG_HMP4030/HAMEG_HMP4030App/Makefile | 8 + .../src/HAMEG_HMP4030Main.cpp | 23 ++ HAMEG_HMP4030/HAMEG_HMP4030App/src/Makefile | 42 ++++ HAMEG_HMP4030/Makefile | 31 +++ HAMEG_HMP4030/configure/CONFIG | 29 +++ HAMEG_HMP4030/configure/CONFIG_SITE | 43 ++++ HAMEG_HMP4030/configure/Makefile | 8 + HAMEG_HMP4030/configure/RELEASE | 43 ++++ HAMEG_HMP4030/configure/RULES | 6 + HAMEG_HMP4030/configure/RULES.ioc | 2 + HAMEG_HMP4030/configure/RULES_DIRS | 2 + HAMEG_HMP4030/configure/RULES_TOP | 3 + HAMEG_HMP4030/iocBoot/Makefile | 6 + .../iocBoot/iocHAMEG_HMP4030/Makefile | 4 + HAMEG_HMP4030/iocBoot/iocHAMEG_HMP4030/st.cmd | 33 +++ HAMEG_HMP4030/protocols/HAMEG_HMP4030.proto | 167 ++++++++++++ 19 files changed, 719 insertions(+) create mode 100644 HAMEG_HMP4030/HAMEG_HMP4030App/Db/HAMEG_HMP4030.substitutions create mode 100644 HAMEG_HMP4030/HAMEG_HMP4030App/Db/HAMEG_HMP4030.template create mode 100644 HAMEG_HMP4030/HAMEG_HMP4030App/Db/Makefile create mode 100644 HAMEG_HMP4030/HAMEG_HMP4030App/Makefile create mode 100644 HAMEG_HMP4030/HAMEG_HMP4030App/src/HAMEG_HMP4030Main.cpp create mode 100644 HAMEG_HMP4030/HAMEG_HMP4030App/src/Makefile create mode 100644 HAMEG_HMP4030/Makefile create mode 100644 HAMEG_HMP4030/configure/CONFIG create mode 100644 HAMEG_HMP4030/configure/CONFIG_SITE create mode 100644 HAMEG_HMP4030/configure/Makefile create mode 100644 HAMEG_HMP4030/configure/RELEASE create mode 100644 HAMEG_HMP4030/configure/RULES create mode 100644 HAMEG_HMP4030/configure/RULES.ioc create mode 100644 HAMEG_HMP4030/configure/RULES_DIRS create mode 100644 HAMEG_HMP4030/configure/RULES_TOP create mode 100644 HAMEG_HMP4030/iocBoot/Makefile create mode 100644 HAMEG_HMP4030/iocBoot/iocHAMEG_HMP4030/Makefile create mode 100644 HAMEG_HMP4030/iocBoot/iocHAMEG_HMP4030/st.cmd create mode 100644 HAMEG_HMP4030/protocols/HAMEG_HMP4030.proto diff --git a/HAMEG_HMP4030/HAMEG_HMP4030App/Db/HAMEG_HMP4030.substitutions b/HAMEG_HMP4030/HAMEG_HMP4030App/Db/HAMEG_HMP4030.substitutions new file mode 100644 index 0000000..30f07be --- /dev/null +++ b/HAMEG_HMP4030/HAMEG_HMP4030App/Db/HAMEG_HMP4030.substitutions @@ -0,0 +1,8 @@ +file HAMEG_HMP4030.template { + +pattern { CHAN } + { "1" } + { "2" } + { "3" } +} + diff --git a/HAMEG_HMP4030/HAMEG_HMP4030App/Db/HAMEG_HMP4030.template b/HAMEG_HMP4030/HAMEG_HMP4030App/Db/HAMEG_HMP4030.template new file mode 100644 index 0000000..6748e69 --- /dev/null +++ b/HAMEG_HMP4030/HAMEG_HMP4030App/Db/HAMEG_HMP4030.template @@ -0,0 +1,237 @@ +record (ai, "$(sys):$(sub):POWER:$(vsys):$(CHAN):SetVoltage") { + field (DTYP, "stream") + field (INP, "@HAMEG_HMP4030.proto SetVoltage($(CHAN)) $(PORT)") + field (SCAN, "2 second") + field (EGU, "V") + field (PREC, "4") + field (ADEL, "0.005") + field (MDEL, "0.001") +} +record (ai, "$(sys):$(sub):POWER:$(vsys):$(CHAN):ReadSetVoltage") { + field (DTYP, "stream") + field (INP, "@HAMEG_HMP4030.proto ReadSetVoltage($(CHAN)) $(PORT)") + field (SCAN, "2 second") + field (EGU, "V") + field (PREC, "4") + field (ADEL, "0.005") + field (MDEL, "0.001") +} + +record (ai, "$(sys):$(sub):POWER:$(vsys):$(CHAN):SetVoltageStepSize") { + field (DTYP, "stream") + field (INP, "@HAMEG_HMP4030.proto SetVoltageStepSize($(CHAN)) $(PORT)") + field (SCAN, "2 second") + field (EGU, "V") + field (PREC, "4") + field (ADEL, "0.005") + field (MDEL, "0.001") +} + +record (ai, "$(sys):$(sub):POWER:$(vsys):$(CHAN):ReadSetVoltageStepSize") { + field (DTYP, "stream") + field (INP, "@HAMEG_HMP4030.proto ReadSetVoltageStepSize($(CHAN)) $(PORT)") + field (SCAN, "2 second") + field (EGU, "V") + field (PREC, "4") + field (ADEL, "0.005") + field (MDEL, "0.001") +} + +record (ai, "$(sys):$(sub):POWER:$(vsys):$(CHAN):SetCurrent") { + field (DTYP, "stream") + field (INP, "@HAMEG_HMP4030.proto SetCurrent($(CHAN)) $(PORT)") + field (SCAN, "2 second") + field (EGU, "A") + field (PREC, "4") + field (ADEL, "0.005") + field (MDEL, "0.001") +} +record (ai, "$(sys):$(sub):POWER:$(vsys):$(CHAN):ReadSetCurrent") { + field (DTYP, "stream") + field (INP, "@HAMEG_HMP4030.proto ReadSetCurrent($(CHAN)) $(PORT)") + field (SCAN, "2 second") + field (EGU, "A") + field (PREC, "4") + field (ADEL, "0.005") + field (MDEL, "0.001") +} + +record (ai, "$(sys):$(sub):POWER:$(vsys):$(CHAN):SetCurrentStepSize") { + field (DTYP, "stream") + field (INP, "@HAMEG_HMP4030.proto SetCurrentStepSize($(CHAN)) $(PORT)") + field (SCAN, "2 second") + field (EGU, "A") + field (PREC, "4") + field (ADEL, "0.005") + field (MDEL, "0.001") +} + +record (ai, "$(sys):$(sub):POWER:$(vsys):$(CHAN):ReadSetCurrentStepSize") { + field (DTYP, "stream") + field (INP, "@HAMEG_HMP4030.proto ReadSetCurrentStepSize($(CHAN)) $(PORT)") + field (SCAN, "2 second") + field (EGU, "A") + field (PREC, "4") + field (ADEL, "0.005") + field (MDEL, "0.001") +} + +record (ai, "$(sys):$(sub):POWER:$(vsys):$(CHAN):SetVoltage_Current") { + field (DTYP, "stream") + field (INP, "@HAMEG_HMP4030.proto SetVoltage_Current($(CHAN)) $(PORT)") + field (SCAN, "2 second") + field (EGU, "V,A") + field (PREC, "4") + field (ADEL, "0.005") + field (MDEL, "0.001") +} + +record (ai, "$(sys):$(sub):POWER:$(vsys):$(CHAN):ReadSetVoltage_Current") { + field (DTYP, "stream") + field (INP, "@HAMEG_HMP4030.proto ReadSetVoltage_Current($(CHAN)) $(PORT)") + field (SCAN, "2 second") + field (EGU, "V,A") + field (PREC, "4") + field (ADEL, "0.005") + field (MDEL, "0.001") +} + +record (ai, "$(sys):$(sub):POWER:$(vsys):$(CHAN):ActivateChannel") { + field (DTYP, "stream") + field (INP, "@HAMEG_HMP4030.proto ActivateChannel($(CHAN)) $(PORT)") + field (SCAN, "2 second") + field (PREC, "4") + field (ADEL, "0.005") + field (MDEL, "0.001") +} + +record (ai, "$(sys):$(sub):POWER:$(vsys):$(CHAN):DeactivateChannel") { + field (DTYP, "stream") + field (INP, "@HAMEG_HMP4030.proto DeactivateChannel($(CHAN)) $(PORT)") + field (SCAN, "2 second") + field (PREC, "4") + field (ADEL, "0.005") + field (MDEL, "0.001") +} + +record (ai, "$(sys):$(sub):POWER:$(vsys):$(CHAN):ReadChannelMode") { + field (DTYP, "stream") + field (INP, "@HAMEG_HMP4030.proto ReadChannelMode($(CHAN)) $(PORT)") + field (SCAN, "2 second") + field (PREC, "4") + field (ADEL, "0.005") + field (MDEL, "0.001") +} + +record (ai, "$(sys):$(sub):POWER:$(vsys):ActivateAllChannel") { + field (DTYP, "stream") + field (INP, "@HAMEG_HMP4030.proto ActivateAllChannel $(PORT)") + field (SCAN, "2 second") + field (PREC, "4") + field (ADEL, "0.005") + field (MDEL, "0.001") +} + +record (ai, "$(sys):$(sub):POWER:$(vsys):DeactivateAllChannel") { + field (DTYP, "stream") + field (INP, "@HAMEG_HMP4030.proto DeactivateAllChannel $(PORT)") + field (SCAN, "2 second") + field (PREC, "4") + field (ADEL, "0.005") + field (MDEL, "0.001") +} + +record (ai, "$(sys):$(sub):POWER:$(vsys):$(CHAN):ActivateFuse") { + field (DTYP, "stream") + field (INP, "@HAMEG_HMP4030.proto ActivateFuse($(CHAN)) $(PORT)") + field (SCAN, "2 second") + field (PREC, "4") + field (ADEL, "0.005") + field (MDEL, "0.001") +} + +record (ai, "$(sys):$(sub):POWER:$(vsys):$(CHAN):DeactivateFuse") { + field (DTYP, "stream") + field (INP, "@HAMEG_HMP4030.proto DeactivateFuse($(CHAN)) $(PORT)") + field (SCAN, "2 second") + field (PREC, "4") + field (ADEL, "0.005") + field (MDEL, "0.001") +} + +record (ai, "$(sys):$(sub):POWER:$(vsys):$(CHAN):ReadFuseMode") { + field (DTYP, "stream") + field (INP, "@HAMEG_HMP4030.proto ReadFuseMode($(CHAN)) $(PORT)") + field (SCAN, "2 second") + field (PREC, "4") + field (ADEL, "0.005") + field (MDEL, "0.001") +} + +record (ai, "$(sys):$(sub):POWER:$(vsys):$(CHAN):SetVoltageProtection") { + field (DTYP, "stream") + field (INP, "@HAMEG_HMP4030.proto SetVoltageProtection($(CHAN)) $(PORT)") + field (SCAN, "2 second") + field (EGU, "V") + field (PREC, "4") + field (ADEL, "0.005") + field (MDEL, "0.001") +} + +record (ai, "$(sys):$(sub):POWER:$(vsys):$(CHAN):ClearVoltageProtection") { + field (DTYP, "stream") + field (INP, "@HAMEG_HMP4030.proto ClearVoltageProtection($(CHAN)) $(PORT)") + field (SCAN, "2 second") + field (PREC, "4") + field (ADEL, "0.005") + field (MDEL, "0.001") +} + +record (ai, "$(sys):$(sub):POWER:$(vsys):$(CHAN):ReadVoltageMinProtection") { + field (DTYP, "stream") + field (INP, "@HAMEG_HMP4030.proto ReadVoltageMINProtection($(CHAN)) $(PORT)") + field (SCAN, "2 second") + field (EGU, "V") + field (PREC, "4") + field (ADEL, "0.005") + field (MDEL, "0.001") +} + +record (ai, "$(sys):$(sub):POWER:$(vsys):$(CHAN):ReadVoltageMaXProtection") { + field (DTYP, "stream") + field (INP, "@HAMEG_HMP4030.proto ReadVoltageMAXProtection($(CHAN)) $(PORT)") + field (SCAN, "2 second") + field (EGU, "V") + field (PREC, "4") + field (ADEL, "0.005") + field (MDEL, "0.001") +} + +record (ai, "$(sys):$(sub):POWER:$(vsys):$(CHAN):SetVoltageProtectionMeasured") { + field (DTYP, "stream") + field (INP, "@HAMEG_HMP4030.proto SetVoltageProtectionMeasured($(CHAN)) $(PORT)") + field (SCAN, "2 second") + field (PREC, "4") + field (ADEL, "0.005") + field (MDEL, "0.001") +} + +record (ai, "$(sys):$(sub):POWER:$(vsys):$(CHAN):SetVoltageProtectionProtected") { + field (DTYP, "stream") + field (INP, "@HAMEG_HMP4030.proto SetVoltageProtectionProtected($(CHAN)) $(PORT)") + field (SCAN, "2 second") + field (PREC, "4") + field (ADEL, "0.005") + field (MDEL, "0.001") +} + +record (ai, "$(sys):$(sub):POWER:$(vsys):$(CHAN):ReadVoltageProtectionMode") { + field (DTYP, "stream") + field (INP, "@HAMEG_HMP4030.proto ReadVoltageProtectionMode($(CHAN)) $(PORT)") + field (SCAN, "2 second") + field (PREC, "4") + field (ADEL, "0.005") + field (MDEL, "0.001") +} + + diff --git a/HAMEG_HMP4030/HAMEG_HMP4030App/Db/Makefile b/HAMEG_HMP4030/HAMEG_HMP4030App/Db/Makefile new file mode 100644 index 0000000..c1fa840 --- /dev/null +++ b/HAMEG_HMP4030/HAMEG_HMP4030App/Db/Makefile @@ -0,0 +1,24 @@ +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 +DB += HAMEG_HMP4030.db + + +#---------------------------------------------------- +# If .db template is not named *.template add +# _template = + +include $(TOP)/configure/RULES +#---------------------------------------- +# ADD RULES AFTER THIS LINE + diff --git a/HAMEG_HMP4030/HAMEG_HMP4030App/Makefile b/HAMEG_HMP4030/HAMEG_HMP4030App/Makefile new file mode 100644 index 0000000..10e0126 --- /dev/null +++ b/HAMEG_HMP4030/HAMEG_HMP4030App/Makefile @@ -0,0 +1,8 @@ +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*)) +include $(TOP)/configure/RULES_DIRS + diff --git a/HAMEG_HMP4030/HAMEG_HMP4030App/src/HAMEG_HMP4030Main.cpp b/HAMEG_HMP4030/HAMEG_HMP4030App/src/HAMEG_HMP4030Main.cpp new file mode 100644 index 0000000..fe0f390 --- /dev/null +++ b/HAMEG_HMP4030/HAMEG_HMP4030App/src/HAMEG_HMP4030Main.cpp @@ -0,0 +1,23 @@ +/* HAMEG_HMP4030Main.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/HAMEG_HMP4030/HAMEG_HMP4030App/src/Makefile b/HAMEG_HMP4030/HAMEG_HMP4030App/src/Makefile new file mode 100644 index 0000000..a118b49 --- /dev/null +++ b/HAMEG_HMP4030/HAMEG_HMP4030App/src/Makefile @@ -0,0 +1,42 @@ +TOP=../.. + +include $(TOP)/configure/CONFIG +#---------------------------------------- +# ADD MACRO DEFINITIONS AFTER THIS LINE +#============================= + +#============================= +# Build the IOC application + +PROD_IOC = HAMEG_HMP4030 +# HAMEG_HMP4030.dbd will be created and installed +DBD += HAMEG_HMP4030.dbd + +# HAMEG_HMP4030.dbd will be made up from these files: +HAMEG_HMP4030_DBD += base.dbd + +# Include dbd files from all support applications: +#HAMEG_HMP4030_DBD += xxx.dbd + +# Add all the support libraries needed by this IOC +#HAMEG_HMP4030_LIBS += xxx + +# HAMEG_HMP4030_registerRecordDeviceDriver.cpp derives from HAMEG_HMP4030.dbd +HAMEG_HMP4030_SRCS += HAMEG_HMP4030_registerRecordDeviceDriver.cpp + +# Build the main IOC entry point on workstation OSs. +HAMEG_HMP4030_SRCS_DEFAULT += HAMEG_HMP4030Main.cpp +HAMEG_HMP4030_SRCS_vxWorks += -nil- + +# Add support from base/src/vxWorks if needed +#HAMEG_HMP4030_OBJS_vxWorks += $(EPICS_BASE_BIN)/vxComLibrary + +# Finally link to the EPICS Base libraries +HAMEG_HMP4030_LIBS += $(EPICS_BASE_IOC_LIBS) + +#=========================== + +include $(TOP)/configure/RULES +#---------------------------------------- +# ADD RULES AFTER THIS LINE + diff --git a/HAMEG_HMP4030/Makefile b/HAMEG_HMP4030/Makefile new file mode 100644 index 0000000..19c9068 --- /dev/null +++ b/HAMEG_HMP4030/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/HAMEG_HMP4030/configure/CONFIG b/HAMEG_HMP4030/configure/CONFIG new file mode 100644 index 0000000..c1a4703 --- /dev/null +++ b/HAMEG_HMP4030/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/HAMEG_HMP4030/configure/CONFIG_SITE b/HAMEG_HMP4030/configure/CONFIG_SITE new file mode 100644 index 0000000..212485e --- /dev/null +++ b/HAMEG_HMP4030/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/HAMEG_HMP4030/configure/Makefile b/HAMEG_HMP4030/configure/Makefile new file mode 100644 index 0000000..9254309 --- /dev/null +++ b/HAMEG_HMP4030/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/HAMEG_HMP4030/configure/RELEASE b/HAMEG_HMP4030/configure/RELEASE new file mode 100644 index 0000000..bd6b780 --- /dev/null +++ b/HAMEG_HMP4030/configure/RELEASE @@ -0,0 +1,43 @@ +# 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 definititions 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 = /home/scs/EPICS/EPICS/base + +# 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 + diff --git a/HAMEG_HMP4030/configure/RULES b/HAMEG_HMP4030/configure/RULES new file mode 100644 index 0000000..6d56e14 --- /dev/null +++ b/HAMEG_HMP4030/configure/RULES @@ -0,0 +1,6 @@ +# RULES + +include $(CONFIG)/RULES + +# Library should be rebuilt because LIBOBJS may have changed. +$(LIBNAME): ../Makefile diff --git a/HAMEG_HMP4030/configure/RULES.ioc b/HAMEG_HMP4030/configure/RULES.ioc new file mode 100644 index 0000000..901987c --- /dev/null +++ b/HAMEG_HMP4030/configure/RULES.ioc @@ -0,0 +1,2 @@ +#RULES.ioc +include $(CONFIG)/RULES.ioc diff --git a/HAMEG_HMP4030/configure/RULES_DIRS b/HAMEG_HMP4030/configure/RULES_DIRS new file mode 100644 index 0000000..3ba269d --- /dev/null +++ b/HAMEG_HMP4030/configure/RULES_DIRS @@ -0,0 +1,2 @@ +#RULES_DIRS +include $(CONFIG)/RULES_DIRS diff --git a/HAMEG_HMP4030/configure/RULES_TOP b/HAMEG_HMP4030/configure/RULES_TOP new file mode 100644 index 0000000..d09d668 --- /dev/null +++ b/HAMEG_HMP4030/configure/RULES_TOP @@ -0,0 +1,3 @@ +#RULES_TOP +include $(CONFIG)/RULES_TOP + diff --git a/HAMEG_HMP4030/iocBoot/Makefile b/HAMEG_HMP4030/iocBoot/Makefile new file mode 100644 index 0000000..91e47d0 --- /dev/null +++ b/HAMEG_HMP4030/iocBoot/Makefile @@ -0,0 +1,6 @@ +TOP = .. +include $(TOP)/configure/CONFIG +DIRS += $(wildcard *ioc*) +DIRS += $(wildcard as*) +include $(CONFIG)/RULES_DIRS + diff --git a/HAMEG_HMP4030/iocBoot/iocHAMEG_HMP4030/Makefile b/HAMEG_HMP4030/iocBoot/iocHAMEG_HMP4030/Makefile new file mode 100644 index 0000000..e064d73 --- /dev/null +++ b/HAMEG_HMP4030/iocBoot/iocHAMEG_HMP4030/Makefile @@ -0,0 +1,4 @@ +TOP = ../.. +include $(TOP)/configure/CONFIG +TARGETS = envPaths +include $(TOP)/configure/RULES.ioc diff --git a/HAMEG_HMP4030/iocBoot/iocHAMEG_HMP4030/st.cmd b/HAMEG_HMP4030/iocBoot/iocHAMEG_HMP4030/st.cmd new file mode 100644 index 0000000..7a86a86 --- /dev/null +++ b/HAMEG_HMP4030/iocBoot/iocHAMEG_HMP4030/st.cmd @@ -0,0 +1,33 @@ +#!../../bin/linux-arm/HAMEG_HMP4030 + +## You may have to change HAMEG_HMP4030 to something else +## everywhere it appears in this file + +< envPaths +epicsEnvSet ("STREAM_PROTOCOL_PATH", "${TOP}/protocols") + +cd "${TOP}" + +## Register all support components +dbLoadDatabase "dbd/HAMEG_HMP4030.dbd" +HAMEG_HMP4030_registerRecordDeviceDriver pdbbase + +#drvAsynSerialPortConfigure("HAMEG_PORT","/dev/HAMEG_HAMEG_HO720_018442435") +asynSetOption ("BALZERS_PORT", 0, "baud", "115200") +asynSetOption ("BALZERS_PORT", 0, "bits", "8") +asynSetOption ("BALZERS_PORT", 0, "parity", "none") +asynSetOption ("BALZERS_PORT", 0, "stop", "1") +asynSetOption ("BALZERS_PORT", 0, "clocal", "N") +asynSetOption ("BALZERS_PORT", 0, "crtscts", "N") + +## Load record instances +#dbLoadRecords("db/xxx.db","user=scs") + +dbLoadRecords("dbd/bptHAMEG_HMP4030.dbd") +dbLoadRecords("db/HAMEG_HMP4030.db", "PORT=HAMEG_PORT,sys=CBM,sub=MVD,vsys=PRESTO_RECIPIENT") + +cd "${TOP}/iocBoot/${IOC}" +iocInit + +## Start any sequence programs +#seq sncxxx,"user=scs" diff --git a/HAMEG_HMP4030/protocols/HAMEG_HMP4030.proto b/HAMEG_HMP4030/protocols/HAMEG_HMP4030.proto new file mode 100644 index 0000000..77be935 --- /dev/null +++ b/HAMEG_HMP4030/protocols/HAMEG_HMP4030.proto @@ -0,0 +1,167 @@ +################################################# +# ### ### # +# ### StreamDevice Protocol for ### # +# ### HAMEG_HMP4030 ### # +# ### ### # +# ### author: O.Artz ### # +# ### ### # +# ### ### # +# ### Ref 1.0; 2017-08-07 ### # +################################################# + +################### +# ### Globals ### # +################### +Terminator = LF; +LockTimeout = 5000; +ReplyTimeout = 500; +ReadTimeout = 500; +WriteTimeout = 300; +ExtraInput = Ignore; + +##################### +# ### Protocols ### # +##################### + +#---VOLTAGE--------------------------------------------------------------------------- +SetVoltage { + out "INST OUT\$1"; + out "VOLT %f"; +} + +ReadSetVoltage { + out "INST OUT\$1"; + out "VOLT?"; + in "%f"; +} + +SetVoltageStepSize { + out "INST OUT\$1"; + out "VOLT:STEP %f"; +} + +ReadSetVoltageStepSize { + out "INST OUT\$1"; + out "VOLT:STEP?"; + in "%f"; +} + +#---CURRENT--------------------------------------------------------------------------- +SetCurrent { + out "INST OUT\$1"; + out "CURR %f"; +} + +ReadSetCurrent { + out "INST OUT\$1"; + out "CURR?"; + in "%f"; +} + +SetVoltageStepSize { + out "INST OUT\$1"; + out "CURR:STEP %f"; +} + +ReadSetVoltageStepSize { + out "INST OUT\$1"; + out "CURR:STEP?"; + in "%f"; +} + +#---VOLLTAGE+CURRENT------------------------------------------------------------------ +SetVoltage_Current { + out "INST OUT\$1"; + out "APPL %f,%f"; +} + +ReadSetVoltage_Current { + out "INST OUT\$1"; + out "APPL?"; +} + +#---CHANNELMODE----------------------------------------------------------------------- +ActivateChannel { + out "INST OUT\$1"; + out "OUTP ON"; + out "OUTP:SEL ON"; +} + +DeactivateChannel { + out "INST OUT\$1"; + out "OUTP OFF"; + out "OUTP:SEL OFF"; + +} + +ReadChannelMode { + out "INST OUT\$1"; + out "OUTP?"; + in "%i"; +} + +ActivateAllChannel { + out "INST OUT\$1"; + out "OUTP:GEN ON"; +} + +DeactivateAllChannel { + out "INST OUT\$1"; + out "OUTP:GEN OFF"; +} + +#---FUSE------------------------------------------------------------------------------ +ActivateFuse { + out "INST OUT\$1"; + out "FUSE ON": +} + +DeactivateFuse { + out "INST OUT\$1"; + out "FUSE OFF": +} + +ReadFuseMode { + out "INST OUT\$1"; + out "FUSE?"; + in "%i"; +} + +#---PROTECTION------------------------------------------------------------------------ +SetVoltageProtection { + out "INST OUT\$1"; + out "VOLT:PROT %f"; +} + +ClearVoltageProtection { + out "INST OUT\%1"; + out "VOLT:PROT:CLE"; +} + +ReadVoltageMINProtection { + out "INST OUT\$1"; + out "VOLT:PROT? MIN"; + in "%f"; +} + +ReadVoltageMAXProtection { + out "INST OUT\$1"; + out "VOLT:PROT? MAX"; + in "%f"; +} + +SetVoltageProtectionMeasured { + out "INST OUT\%1"; + out "VOLT:PROT:MODE MEAS"; +} + +SetVoltageProtectionProtected { + out "INST OUT\%1"; + out "VOLT:PROT:MODE PROT"; +} + +ReadVoltageProtectionMode { + out "INST OUT\%1"; + out "VOLT:PROT:MODE?"; + in "protected"; +} -- 2.43.0