diff --git a/iocsh/rheotest.iocsh b/iocsh/rheotest.iocsh deleted file mode 100644 index 899f5541e98f8411f4275527a817c9b58ec8255d..0000000000000000000000000000000000000000 --- a/iocsh/rheotest.iocsh +++ /dev/null @@ -1,14 +0,0 @@ -# This should be the included snippet to configure and run the deployed IOC. It should be loaded with -# -# iocshLoad("$(rheotest_DIR)/rheotest.iocsh") -require rheotest,0.2 -epicsEnvSet("STREAM_PROTOCOL_PATH", "$(rheotest_DIR)/db") -#drvAsynIPPortConfigure("rheo", "127.0.0.1:5555") - -drvAsynIPPortConfigure("rheo", "172.30.32.60:1025") - -dbLoadRecords("rheo_comm.db", "P=rheo") - -iocInit() - - diff --git a/rheotest.Makefile b/rheotest.Makefile deleted file mode 100644 index dc85b57cf6d1c5b7aeebba45e6a0be0ae9ec7524..0000000000000000000000000000000000000000 --- a/rheotest.Makefile +++ /dev/null @@ -1,138 +0,0 @@ -# -# Copyright (c) 2019 - 2022, European Spallation Source ERIC -# -# The program is free software: you can redistribute it and/or modify it -# under the terms of the BSD 3-Clause license. -# -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. -# -# Author : Jim Larsson -# email : jim.larsson@ess.eu -# Date : 2022-09-05 -# version : 0.0.0 -# -# This template file is based on one generated by e3TemplateGenerator.bash. -# Please look at many other module_name.Makefile in the https://gitlab.esss.lu.se/epics-modules/ -# repositories. -# - -## The following lines are mandatory, please don't change them. -where_am_I := $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) -include $(E3_REQUIRE_TOOLS)/driver.makefile - - -############################################################################ -# -# Add any required modules here that come from startup scripts, etc. -# -############################################################################ - -REQUIRED += stream - - -############################################################################ -# -# If you want to exclude any architectures: -# -############################################################################ - -# EXCLUDE_ARCHS += linux-ppc64e6500 - - -############################################################################ -# -# Relevant directories to point to files -# -############################################################################ - -APP:=rheotestApp -APPDB:=$(APP)/Db -APPSRC:=$(APP)/src -APPCMDS:=$(APP)/cmds - - -############################################################################ -# -# Add any files that should be copied to $(module)/Db -# -############################################################################ - -TEMPLATES += $(wildcard $(APPDB)/*.db) -TEMPLATES += $(wildcard $(APPDB)/*.proto) -# TEMPLATES += $(wildcard $(APPDB)/*.template) - -# USR_INCLUDES += -I$(where_am_I)$(APPSRC) - - -############################################################################ -# -# Add any files that need to be compiled (e.g. .c, .cpp, .st, .stt) -# -############################################################################ - -SOURCES += $(APPSRC)/rheotestMain.cpp - - -############################################################################ -# -# Add any .dbd files that should be included (e.g. from user-defined functions, etc.) -# -############################################################################ - -#DBDS += - - -############################################################################ -# -# Add any header files that should be included in the install (e.g. -# StreamDevice or asyn header files that are used by other modules) -# -############################################################################ - -#HEADERS += - - -############################################################################ -# -# Add any startup scripts that should be installed in the base directory -# -############################################################################ - -SCRIPTS += $(wildcard iocsh/*.iocsh) - - -############################################################################ -# -# If you have any .substitution files, and template files, add them here. -# -############################################################################ - -# SUBS=$(wildcard $(APPDB)/*.substitutions) -# TMPS=$(wildcard $(APPDB)/*.template) - -USR_DBFLAGS += -I . -I .. -USR_DBFLAGS += -I $(EPICS_BASE)/db -USR_DBFLAGS += -I $(APPDB) - -db: $(SUBS) $(TMPS) - -$(SUBS): - @printf "Inflating database ... %44s >>> %40s \n" "$@" "$(basename $(@)).db" - @rm -f $(basename $(@)).db.d $(basename $(@)).db - @$(MSI) -D $(USR_DBFLAGS) -o $(basename $(@)).db -S $@ > $(basename $(@)).db.d - @$(MSI) $(USR_DBFLAGS) -o $(basename $(@)).db -S $@ - -$(TMPS): - @printf "Inflating database ... %44s >>> %40s \n" "$@" "$(basename $(@)).db" - @rm -f $(basename $(@)).db.d $(basename $(@)).db - @$(MSI) -D $(USR_DBFLAGS) -o $(basename $(@)).db $@ > $(basename $(@)).db.d - @$(MSI) $(USR_DBFLAGS) -o $(basename $(@)).db $@ - -.PHONY: db $(SUBS) $(TMPS) - - -vlibs: - -.PHONY: vlibs diff --git a/rheotestApp/Db/.rheo_comm.db.swp b/rheotestApp/Db/.rheo_comm.db.swp deleted file mode 100644 index 701432f58c375804f6ec7c7c332d176f5104532e..0000000000000000000000000000000000000000 Binary files a/rheotestApp/Db/.rheo_comm.db.swp and /dev/null differ diff --git a/rheotestApp/Db/rheo_comm.db b/rheotestApp/Db/rheo_comm.db deleted file mode 100644 index 45dbfde38010f72ba798be7129931b02c6f72177..0000000000000000000000000000000000000000 --- a/rheotestApp/Db/rheo_comm.db +++ /dev/null @@ -1,353 +0,0 @@ -record(ai, $(P):Error){ - field(DTYP, "stream") - field(INP, "@rheo_comm.proto getError rheo") - field(SCAN, "Passive") - #field(SCAN, "I/O Intr") -} - -# ----------------------------------------------------------------------------- -# -# Run commands -# -# ----------------------------------------------------------------------------- - -record(waveform, $(P):Version){ - field(DTYP, "stream") - field(INP, "@rheo_comm.proto getVersion rheo") - field(SCAN, "Passive") - field(FTVL, "STRING") - field(NELM, "10") -} - -record(subArray, $(P):VersionCompany){ - field(DTYP, "Soft Channel") - field(INP, "$(P):Version.VAL CPP") - field(INDX, "1") -} - -record(stringin, $(P):RUN){ - field(DTYP, "stream") - field(INP, "@rheo_comm.proto run rheo") - field(FLNK, "$(P):ResetBuffers.PROC") - -} - -record(stringin, $(P):STOP){ - field(DTYP, "stream") - field(INP, "@rheo_comm.proto stop rheo") -} - - -record(calcout, $(P):DONE) { - field(INPA, "$(P):npoints-RB PP") - field(INPB, "$(P):NUMB-RB PP") - field(VAL, "0") - field(CALC, "(A=B) ? 1 : VAL") - field(OOPT, "When Non-zero") - field(OUT, -} - - -# ------------------------------------------------------------------------------- -# -# Initalization -# -# ------------------------------------------------------------------------------- - -record(stringin, $(P):Init){ - field(DTYP, "stream") - field(INP, "@rheo_comm.proto initRheo rheo") - field(SCAN, "Passive") -} - -record(stringin, $(P):Init-RB){ - field(DTYP, "stream") - field(INP, "@rheo_comm.proto initRheo:end rheo") - field(SCAN, "I/O Intr") -} - -# ------------------------------------------------------------------------------- -# -# -# -# ------------------------------------------------------------------------------- - -record(waveform, $(P):Values){ - field(DTYP, "stream") - field(INP, "@rheo_comm.proto getValues rheo") - field(SCAN, "5 second") - field(FTVL, "STRING") - field(NELM, "38") -} - -record(subArray, $(P):Temperature-RB){ - field(DTYP, "Soft Channel") - field(INP, "$(P):Values.VAL PP") - field(INDX, "5") - field(MALM, "38") - field(NELM, "1") - field(SCAN, "5 second") -} - -record(stringin, $(P):sniff) { - field(DTYP, "stream") - field(INP, "@rheo_comm.proto sniffing rheo") - field(SCAN, "I/O Intr") -} - -record(ao, $(P):setTemperature-S) { - field(DTYP, "stream") - field(OUT, "@rheo_comm.proto setTemperature rheo") - field(DRVL, "295") - field(DRVH, "305") - field(FLNK, "$(P):setTemperature-RB") -} - -record(ai, $(P):setTemperature-RB) { - field(INP, "$(P):setTemperature-S NPP") -} - -record(stringin, $(P):TemperatureSettings-S) { - field(DTYP, "stream") - field(INP, "@rheo_comm.proto setTemperatureSettings rheo") -} - -record(calcout, $(P):loadMeasConfig){ - field(INPA, "$(P):npoints-S PP") - field(INPB, "$(P):FirstMeasInterval-S PP") - field(INPC, "$(P):LastMeasInterval-S PP") - field(INPD, "$(P):FirstMeasTime-S PP") - field(INPE, "$(P):LastMeasTime-S PP") - field(CALC, "0") - field(SCAN, "Passive") - field(DTYP, "stream") - field(OUT, "@rheo_comm.proto loadMeasConfig_viscometry($(P):errMessage) rheo") -} - -record(ai, $(P):npoints-S){ - field(DESC, "Number of measurement points.") - field(VAL, "5") - field(FLNK, "$(P):npoints-RB") -} - -record(ai, $(P):npoints-RB) { - field(INP, "$(P):npoints-S NPP") - field(PINI, "YES") -} - -record(ai, $(P):FirstMeasInterval-S) { - field(VAL, "10") - field(DESC, "Viscometry rotational speed.") - field(FLNK, "$(P):FirstMeasInterval-RB") - field(EGU, "rad/s") -} - -record(ai, $(P):LastMeasInterval-S) { - field(VAL, "4.119995729") - field(DESC, "Viscometry rotational speed.") - field(FLNK, "$(P):LastMeasInterval-RB") - field(EGU, "rad/s") -} -record(ai, $(P):FirstMeasInterval-RB){ - field(INP, "$(P):FirstMeasInterval-S NPP") - field(PINI, "YES") - field(EGU, "rad/s") -} - -record(ai, $(P):LastMeasInterval-RB) { - field(INP, "$(P):LastMeasInterval-S NPP") - field(PINI, "YES") - field(EGU, "rad/s") -} - -record(ai, $(P):FirstMeasTime-S) { - field(DESC, "First point measuring time.") - field(VAL, "0.25") - field(EGU, "s") - field(FLNK, "$(P):FirstMeasTime-RB") -} - -record(ai, $(P):LastMeasTime-S) { - field(DESC, "Last point measuring time.") - field(VAL, "20") - field(EGU, "s") - field(FLNK, "$(P):LastMeasTime-RB") -} - -record(ai, $(P):FirstMeasTime-RB) { - field(INP, "$(P):FirstMeasTime-S NPP") - field(PINI, "YES") - field(EGU, "s") -} - -record(ai, $(P):LastMeasTime-RB) { - field(INP, "$(P):LastMeasTime-S NPP") - field(PINI, "YES") - field(EGU, "s") -} - - -record(stringout, $(P):debug) { - field(DTYP, "stream") - field(OUT, "@rheo_comm.proto debug rheo") -} - -record(stringin, $(P):KCONFIG) { - field(DTYP, "stream") - field(INP, "@rheo_comm.proto Kconfig_viscometry($(P):errMessage) rheo") -} - -record(stringin, $(P):errMessage){ -} - -# --------------------------------------------------------------------------------------# -# # -# Reading measurements # -# # -# --------------------------------------------------------------------------------------# - -#record(waveform, $(P):getMeasurmentHeader) { -# field(DTYP, "stream") -# field(INP, ) -# field(FTVL, "STRING") -#} - -record(longin, $(P):MeasNumber){ - field(DTYP, "stream") - field(INP, "@rheo_comm.proto getMeasurementValues($(P):TEMP-RB,$(P):TORQ-RB,$(P):SPEE-RB,$(P):NUMB-RB) rheo") - field(SCAN, "I/O Intr") - #field(FLNK, "$(P):TriggerBuffers.PROC") -} - -record(ai, $(P):TEMP-RB){ - field(DESC, "Temperature in control system") - field(EGU, "K") - field(FLNK, "$(P):ArrayTEMP-RB.PROC") -} - -record(ai, $(P):TORQ-RB){ - field(DESC, "Torque") - field(EGU, "Nm") - field(FLNK, "$(P):ArrayTORQ-RB.PROC") -} - -record(ai, $(P):SPEE-RB){ - field(DESC, "Rotational speed.") - field(EGU, "Hz (?)") - field(FLNK, "$(P):ArraySPEE-RB.PROC")} - -record(longin, $(P):NUMB-RB) { - field(DESC, "Measurement number.") - field(FLNK, "$(P):ArrayMeasNumber-RB.PROC") -} - -record(stringin, $(P):debugMEAS){ - field(DTYP, "stream") - field(INP, "@rheo_comm.proto debugMeasVal rheo") - field(SCAN, "I/O Intr") -} - -# ------------------------------------------------------------------------------------ -# -# Save measurment values as circular buffer for phoebus x/y plot -# -# ------------------------------------------------------------------------------------ - -record(compress, $(P):ArrayTORQ-RB){ - field(ALG, "Circular Buffer") - field(INP, "$(P):TORQ-RB NPP") - field(NSAM, "20") - field(BALG, "FIFO Buffer") -} - -record(compress, $(P):ArrayTEMP-RB){ - field(ALG, "Circular Buffer") - field(INP, "$(P):TEMP-RB NPP") - field(NSAM, "20") - field(BALG, "FIFO Buffer") -} - -record(compress, $(P):ArraySPEE-RB){ - field(ALG, "Circular Buffer") - field(INP, "$(P):SPEE-RB NPP") - field(NSAM, "20") - field(BALG, "FIFO Buffer") -} - -record(compress, $(P):ArrayMeasNumber-RB){ - field(ALG, "Circular Buffer") - field(INP, "$(P):NUMB-RB NPP") - field(NSAM, "20") - field(BALG, "FIFO Buffer") - field(FLNK, "$(P):arrayViscosity") -} - -#record(fanout, "$(P):TriggerBuffers"){ -# field(LNK0, "$(P):ArrayMeasNumber-RB.PROC") -# field(LNK1, "$(P):ArrayTEMP-RB.PROC") -# field(LNK2, "$(P):ArrayTORQ-RB.PROC") -# field(LNK3, "$(P):ArraySPEE-RB.PROC") -#} - -record(dfanout, $(P):ResetBuffers) { - field(DOL, "1") - field(OUTA, "$(P):ArrayMeasNumber-RB.RES") - field(OUTB, "$(P):ArrayTEMP-RB.RES") - field(OUTC, "$(P):ArrayTORQ-RB.RES") - field(OUTD, "$(P):ArraySPEE-RB.RES") -} - - - -# -------------------------------------------------------------------------------- -# -# Calculate parameters of interest -# -# ------------------------------------------------------------------------------- - -record(ai, $(P):CSSfactor) { - field(DESC, "CSS factor, defined by the measuring system.") - field(VAL, "3876.2") - field(EGU, "Pa/Nm") - -} - -record(ai, $(P):CSRfactor) { - field(DESC, "CSR factor defined by the measuring system.") - field(VAL, "149.382") - field(EGU, "s/s") -} - -record(calc, $(P):ShearStress) { - field(DESC, "CSS form factor * torque") - field(INPA, "$(P):TORQ-RB PP") - field(INPB, "$(P):CSSfactor PP") - field(CALC, "A*B") - field(EGU, "Pa") -} - -record(calc, $(P):ShearRate) { - field(DESC, "Rotational speed / CSR factor") - field(INPA, "$(P):SPEE-RB PP") - field(INPB, "$(P):CSRfactor PP") - field(CALC, "A/B") - field(EGU, "Hz") -} - -record(calc, $(P):Viscosity) { - field(DESC, "shear stress / shear rate") - field(INPA, "$(P):ShearStress PP") - field(INPB, "$(P):ShearRate PP") - field(CALC, "A/B") - field(EGU,"Pa*s") -} - -record(compress, $(P):ArrayViscosity) { - field(ALG, "Circular Buffer") - field(INP, "$(P):Viscosity PP") - field(NSAM, "20") - field(BALG, "FIFO Buffer") -} - - - diff --git a/rheotestApp/Db/rheo_comm.proto b/rheotestApp/Db/rheo_comm.proto deleted file mode 100644 index d2b5d6a485c40c329676bb7bb9627c8fb9d6a71d..0000000000000000000000000000000000000000 --- a/rheotestApp/Db/rheo_comm.proto +++ /dev/null @@ -1,130 +0,0 @@ -#TERMINATOR = LF; -TERMINATOR = SUB; - -initRheo { - - ReadTimeout = 30000; - out ":GETC[\"FHUBINIT[?]\"]"; - in "%s"; - in "%*s"; -} - -initRheo:end { - in ":GETC[\"FHUBINIT[]\"]"; - in "%s"; -} - -getVersion { - - out "#VERS[?]"; - separator = ","; - in "#VERS[%[^,]"; -} - -getError { - out "ERROR?"; - #in "$DERR[%i,'""','""','""']"; - in "$DERR[%i%*s"; -} - -getRand { - out "RAND?"; - in "%f"; - } - -getValues { - ReplyTimeout = 5000; - out ":GETC[\"VALUES[?]\"]"; - separator = ","; - in ":GETC[\"VALUES[%[^,]"; -} - - -sniffing { - in "%s"; -} - -setTemperature { - out ":DEVC[\"KTHERMS[2,1,%f]\"]"; - in "%*s"; -} - -setTemperatureSettings { - out ":DEVC[\"KTHERMO[2,0,123.15,473.15,0,0,0,1,9600,n,8,1,n]\"]"; - in "%s"; -} - -setMSconfig { - # MS = measuring system; - MS_VISC = ":DEVC[\"KCONFIG[0,3876.2,0.000063028,0,116200,9500,149.382,2,1.65,0,0,1,0,0,0,0,1,0,0,0,250,10000,0.25,0.00165,0,0,20,0,0,0.59,0,0,13,0,0,0.00165,0.23,0,26423,1,1,7681,7681,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]\"]" - out MS_VISC; - in "%s"; -} - - -#Add user variables into config mode, later add protocol arguments.; -loadMeasConfig_viscometry { - npoints = "%(A)i"; - interval_mode = "LOG"; - meas_interval = "(%(B)f,%(C)f)"; # VISC_MODE is rotational speed [rad/s ?]; - time_interval = "(%(D)f,%(E)f)"; - time_mode = "LOG"; - out ":PROG[\"Test\",TEST[(PART[(NUMB["$npoints",LAST],DTIM[FUNC["$interval_mode","$meas_interval"],4,REL]),(),(),(),(SRAT[1,FUNC["$time_mode","$time_interval"]]),(),(),,(DAPT[TEMP[2,??T]],DAPT[TORQ[1,??T]],DAPT[SPEE[1,??T]],DAPT[EXCU[1,??T]],DAPT[FORC[1,??T]],DAPT[DIST[1,??T]],GSTR[STAT[1,??T]],DAPT[VELO[1,??T]],DAPT[DGAP[1,??T]],DAPT[TIMA[1,??T]],DAPT[TIMP[1,??T]],DAPT[EXCE[1,??T]],DAPT[ETRQ[1,??T]]),(GENP[0,(IFDT[EX])],SETV[0,(IFST[IN,(16)])]),(EXCU[1,!?])])],EXIT[()],CANC[()]]"; - - in "%(\$1)s"; - -} - -loadMeasConfig_ampltiude_sweep { - - out = ":PROG[\"Test\",TEST[(PART[(NUMB[25,LAST]),(),(),(),(STRA[1,OSCI[FUNC[LOG,(0.0001,1)],1.591549431,SIN]]),(),(),VALF[STRA[1,?&]],(VALF[STRA[1,?&]],DAPT[TEMP[2,??T]],COMP[MODU[1,??F],1,PHAS],COMP[TORQ[1,??F],0,CABS],COMP[TORQ[1,??F],1,CABS],DAPT[KFAC[1,??T]],COMP[SPEE[1,??F],0,CABS],COMP[EXCU[1,??F],0,CABS],COMP[EXCU[1,??F],1,CABS],COMP[FORC[1,??F],0,REAL],DAPT[DIST[1,??T]],GSTR[STAT[1,??T]],DAPT[VELO[1,??T]],DAPT[DGAP[1,??T]],DAPT[TIMA[1,??T]],DAPT[TIMP[1,??T]],COMP[EXCE[1,??F],0,CABS],COMP[EXCE[1,??F],1,CABS],COMP[ETRQ[1,??F],0,CABS],COMP[ETRQ[1,??F],1,CABS]),(GENP[0,(IFST[IN,(17)])],SETV[0,(IFST[IN,(16)])]),()])],EXIT[()],CANC[()]]"; -} - - - - - - -debug { - ExtraInput = Ignore; - out "%s"; - in "%39c"; -} - - -stop { - out ":STOP[]"; - in "%s"; -} - -run { - out ":RUN[]"; - in "%s"; -} - - -Kconfig_viscometry { - ReplyTimeout = 5000; - out ":DEVC[\"KCONFIG[0,3876.2,0.000063028,0,116200,9500,149.382,2,1.65,0,0,1,0,0,0,0,1,0,0,0,250,10000,0.25,0.00165,0,0,20,0,0,0.59,0,0,13,0,0,0.00165,0.23,0,26423,1,1,7681,7681,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]\"]"; - in ":DEVC[\"KCONFIG[1,1]\"]"; - @mismatch { - in "%(\$1)s"; - } -} - -Kconfig_amp_sweep { - ReplyTimeout = 5000; - out ":DEVC[\"KCONFIG[0,3876.2,0.000063028,0,116200,9500,149.382,2,1.65,0,0,1,0,0,0,0,1,0,0,0,250,10000,0.1,0.00165,0,0,20,0,0,0.59,0,0,13,0,0,0.00165,0.23,0,26423,1,1,7681,7681,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]\"]"; - in ":DEVC[\"KCONFIG[1,1]\"]"; - @mismatch { - in "%(\$1)s"; - } -} - -getMeasurementValues { - in ":MEAS[%(\$4)i,%*i,%*f,%*f,%*i,(),(%(\$1)f,%(\$2)f,%(\$3)f,%*f,%*f,%*f,%*s,%*i,%*f,%*f,%*f,%*f)]"; -} - -debugMeasVal { - in "MEAS[%s]"; -} diff --git a/rheotestApp/src/rheotestMain.cpp b/rheotestApp/src/rheotestMain.cpp deleted file mode 100644 index 1ed713fd5c563375dcf953871f29b3de789a43a1..0000000000000000000000000000000000000000 --- a/rheotestApp/src/rheotestMain.cpp +++ /dev/null @@ -1,24 +0,0 @@ -/* rheotestMain.cpp */ -/* Author: Jim Larsson */ -/* Date: 2022-09-05 */ - -#include <stddef.h> -#include <stdlib.h> -#include <stddef.h> -#include <string.h> -#include <stdio.h> - -#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); -}