diff --git a/ecmc_plugin_motion/Db/.keep b/Db/.keep similarity index 100% rename from ecmc_plugin_motion/Db/.keep rename to Db/.keep diff --git a/ecmc_plugin_motion/Db/ecmcPluginMotion.template b/Db/ecmcPluginMotion.template similarity index 98% rename from ecmc_plugin_motion/Db/ecmcPluginMotion.template rename to Db/ecmcPluginMotion.template index 700eec7..117edef 100644 --- a/ecmc_plugin_motion/Db/ecmcPluginMotion.template +++ b/Db/ecmcPluginMotion.template @@ -10,6 +10,7 @@ record(waveform,"$(P)Plg-Mtn${INDEX}-PosAct-Arr"){ field(SCAN, "I/O Intr") field(TSE, "0") field(EGU, "${RAW_EGU= }") + field(PREC, "${PREC=3 }") } # Set pos @@ -24,6 +25,7 @@ record(waveform,"$(P)Plg-Mtn${INDEX}-PosSet-Arr"){ field(SCAN, "I/O Intr") field(TSE, "0") field(EGU, "${RAW_EGU= }") + field(PREC, "${PREC=3 }") } # Position Error @@ -38,6 +40,7 @@ record(waveform,"$(P)Plg-Mtn${INDEX}-PosErr-Arr"){ field(SCAN, "I/O Intr") field(TSE, "0") field(EGU, "${RAW_EGU= }") + field(PREC, "${PREC=3 }") } # X axis time (reltive within buffer) @@ -51,6 +54,7 @@ record(waveform,"$(P)Plg-Mtn${INDEX}-Time-Arr"){ field(NELM, "$(NELM)") field(SCAN, "I/O Intr") field(TSE, "0") + field(PREC, "${PREC=3 }") } # Axis Enable diff --git a/GNUmakefile b/GNUmakefile index 0425d2a..bce1209 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -6,7 +6,7 @@ BUILDCLASSES = Linux ARCH_FILTER = deb10% # Run 7.0.6 for now -EXCLUDE_VERSIONS+=3 7.0.5 7.0.7 +EXCLUDE_VERSIONS+=3 7.0.5 7.0.6 IGNORE_MODULES += asynMotor IGNORE_MODULES += motorBase @@ -16,8 +16,8 @@ OPT_CXXFLAGS_YES = -O3 # dependencies ECmasterECMC_VERSION = v1.1.0 -motorECMC_VERSION = 7.0.7-ESS -ecmc_VERSION = v9.0.1_RC1 +motorECMC_VERSION = 7.0.9-ESS +ecmc_VERSION = sandst_a ################################################################################ # THIS RELATES TO THE EtherCAT MASTER LIBRARY @@ -29,9 +29,10 @@ EC_MASTER_LIB = ${EPICS_MODULES}/ECmasterECMC/${ECmasterECMC_VERSION}/R${EPICSVE USR_LDFLAGS += -Wl,-rpath=${EC_MASTER_LIB} USR_LDFLAGS += -L ${EC_MASTER_LIB} -BASE_DIR = ecmc_plugin_motion +BASE_DIR = . SRC_DIR = $(BASE_DIR)/src DB_DIR = $(BASE_DIR)/Db +SCRIPTS_DIR = $(BASE_DIR)/scripts SOURCES += $(SRC_DIR)/ecmcPluginMotion.c SOURCES += $(SRC_DIR)/ecmcMotionPlgWrap.cpp @@ -41,6 +42,5 @@ SOURCES += $(SRC_DIR)/ecmcMotionPlg.cpp HEADERS += $(foreach d,${SRC_DIR}, $(wildcard $d/*.h)) DBDS += $(foreach d,${SRC_DIR}, $(wildcard $d/*.dbd)) SCRIPTS += $(BASE_DIR)/startup.cmd -SCRIPTS += $(BASE_DIR)/addMotionObj.cmd +SCRIPTS += $(SCRIPTS_DIR)/addMotionObj.cmd TEMPLATES += $(wildcard $(DB_DIR)/*.template) - diff --git a/iocsh/test_plugin_motion.script b/iocsh/test_plugin_motion.script index bc22a5b..97b009a 100644 --- a/iocsh/test_plugin_motion.script +++ b/iocsh/test_plugin_motion.script @@ -2,15 +2,10 @@ ## Example: Configuraftion for running ecmc motion plugin ############################################################################## -## Initiation: -epicsEnvSet("IOC" ,"$(IOC="IOC_TEST")") -epicsEnvSet("SCRIPTEXEC" ,"$(SCRIPTEXEC="iocshLoad")") - -require ecmccfg "9.0.1_RC1" +require ecmccfg "9.4.0" "ECMC_VER=9.4.0,EC_RATE=500" # run module startup.cmd (only needed at ESS PSI auto call at require) -$(ECMCCFG_INIT="")$(SCRIPTEXEC) ${ecmccfg_DIR}startup.cmd, "IOC=$(IOC),ECMC_VER=v9.0.1_RC1, EC_RATE=500" - +$(ECMCCFG_INIT="")$(SCRIPTEXEC) ${ecmccfg_DIR}startup.cmd, "IOC=$(IOC),ECMC_VER=9.4.0, EC_RATE=500" ############################################################################## ## Configure hardware diff --git a/iocsh/test_plugin_motion_psi.script b/iocsh/test_plugin_motion_psi.script index 38a13b3..8284767 100644 --- a/iocsh/test_plugin_motion_psi.script +++ b/iocsh/test_plugin_motion_psi.script @@ -2,15 +2,9 @@ ## Example: Configuraftion for running ecmc motion plugin ############################################################################## -## Initiation: -epicsEnvSet("IOC" ,"$(IOC="IOC_TEST")") -epicsEnvSet("ECMCCFG_INIT" ,"") #Only run startup once (auto at PSI, need call at ESS), variable set to "#" in startup.cmd -epicsEnvSet("SCRIPTEXEC" ,"$(SCRIPTEXEC="iocshLoad")") - -require ecmccfg "sandst_a_v9.0.1_RC1" "ECMC_VER=v9.0.1_RC1" - +require ecmccfg "9.4.0" "ECMC_VER=9.4.0" ############################################################################## -## Configure hardware +## Configue epicsEnvSet("ECMC_EC_SLAVE_NUM", "4") ${SCRIPTEXEC} ${ecmccfg_DIR}configureSlave.cmd, "SLAVE_ID=$(ECMC_EC_SLAVE_NUM), HW_DESC=EL7031, CONFIG=-Motor-Trinamic-QMot-QSH4218-41-10-035" @@ -33,8 +27,6 @@ $(SCRIPTEXEC) ($(ecmccfg_DIR)configureAxis.cmd, CONFIG=./cfg/el7031.ax) # epicsEnvSet(ECMC_PLUGIN_CONFIG,"PLUGIN_ID=1,AX=1,BUFF_SIZE=200,DBG=0,ENA=1") require ecmc_plugin_motion sandst_a "${ECMC_PLUGIN_CONFIG}" -# below needed at ESS but not PSI: -#${SCRIPTEXEC} ${ecmc_plugin_motion_DIR}startup.cmd "${ECMC_PLUGIN_CONFIG}" ############################################################################## ############# Configure diagnostics: diff --git a/ecmc_plugin_motion/addMotionObj.cmd b/scripts/addMotionObj.cmd similarity index 96% rename from ecmc_plugin_motion/addMotionObj.cmd rename to scripts/addMotionObj.cmd index 956d416..bc97b80 100644 --- a/ecmc_plugin_motion/addMotionObj.cmd +++ b/scripts/addMotionObj.cmd @@ -28,7 +28,7 @@ #- First loaded object will therefore have index epicsEnvSet(ECMC_PLG_MOTION_OBJ_INDEX,${ECMC_PLG_MOTION_OBJ_INDEX=0}) -# Might need differet paths for PSI and ESS.. must check +#- Might need differet paths for PSI and ESS.. must check epicsEnvSet(ECMC_PLUGIN_FILNAME,"$(ecmc_plugin_motion_DIR)/lib/${EPICS_HOST_ARCH=linux-x86_64}/libecmc_plugin_motion.so") epicsEnvSet(ECMC_PLUGIN_CONFIG,"AXIS=${AX};BUFFER_SIZE=${BUFF_SIZE};DBG_PRINT=${DBG=1};ENABLE=${ENA=1};") ${SCRIPTEXEC} ${ecmccfg_DIR}loadPlugin.cmd, "PLUGIN_ID=${PLUGIN_ID},FILE=${ECMC_PLUGIN_FILNAME},CONFIG='${ECMC_PLUGIN_CONFIG}', REPORT=${REPORT=1}" diff --git a/ecmc_plugin_motion/src/.keep b/src/.keep similarity index 100% rename from ecmc_plugin_motion/src/.keep rename to src/.keep diff --git a/ecmc_plugin_motion/src/ecmcDataBuffer.h b/src/ecmcDataBuffer.h similarity index 100% rename from ecmc_plugin_motion/src/ecmcDataBuffer.h rename to src/ecmcDataBuffer.h diff --git a/ecmc_plugin_motion/src/ecmcMotionPlg.cpp b/src/ecmcMotionPlg.cpp similarity index 100% rename from ecmc_plugin_motion/src/ecmcMotionPlg.cpp rename to src/ecmcMotionPlg.cpp diff --git a/ecmc_plugin_motion/src/ecmcMotionPlg.h b/src/ecmcMotionPlg.h similarity index 100% rename from ecmc_plugin_motion/src/ecmcMotionPlg.h rename to src/ecmcMotionPlg.h diff --git a/ecmc_plugin_motion/src/ecmcMotionPlgDefs.h b/src/ecmcMotionPlgDefs.h similarity index 100% rename from ecmc_plugin_motion/src/ecmcMotionPlgDefs.h rename to src/ecmcMotionPlgDefs.h diff --git a/ecmc_plugin_motion/src/ecmcMotionPlgWrap.cpp b/src/ecmcMotionPlgWrap.cpp similarity index 100% rename from ecmc_plugin_motion/src/ecmcMotionPlgWrap.cpp rename to src/ecmcMotionPlgWrap.cpp diff --git a/ecmc_plugin_motion/src/ecmcMotionPlgWrap.h b/src/ecmcMotionPlgWrap.h similarity index 100% rename from ecmc_plugin_motion/src/ecmcMotionPlgWrap.h rename to src/ecmcMotionPlgWrap.h diff --git a/ecmc_plugin_motion/src/ecmcPluginMotion.c b/src/ecmcPluginMotion.c similarity index 98% rename from ecmc_plugin_motion/src/ecmcPluginMotion.c rename to src/ecmcPluginMotion.c index e240feb..891c4dd 100644 --- a/ecmc_plugin_motion/src/ecmcPluginMotion.c +++ b/src/ecmcPluginMotion.c @@ -27,7 +27,7 @@ extern "C" { #include "ecmcMotionPlgWrap.h" static int lastEcmcError = 0; -static char* lastConfStr = NULL; +static char* lastConfStr = NULL; /** Optional. * Will be called once after successfull load into ecmc. @@ -38,7 +38,7 @@ int motionConstruct(char *configStr) { //This module is allowed to load several times so no need to check if loaded - // create FFT object and register data callback + // create object and register data callback lastConfStr = strdup(configStr); return createMotionObj(configStr); } @@ -48,10 +48,10 @@ int motionConstruct(char *configStr) **/ void motionDestruct(void) { - deleteAllMotionObjs(); - if(lastConfStr){ - free(lastConfStr); - } + //deleteAllMotionObjs(); + //if(lastConfStr){ + // free(lastConfStr); + //} } /** Optional function. diff --git a/ecmc_plugin_motion/startup.cmd b/startup.cmd similarity index 100% rename from ecmc_plugin_motion/startup.cmd rename to startup.cmd