From 0888b42e6c7cc7593e3cc32665e3e5a74d35f2d1 Mon Sep 17 00:00:00 2001 From: Freddie Akeroyd Date: Mon, 4 Sep 2023 23:51:44 +0100 Subject: [PATCH 1/6] Add REMOTE_ON_SET macro Add new macro to allow not to send a go remote on every command set. This is to speed up muon zerofield --- KEPCO/iocBoot/iocKEPCO-IOC-01/config.xml | 1 + KEPCO/iocBoot/iocKEPCO-IOC-01/st-common.cmd | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/KEPCO/iocBoot/iocKEPCO-IOC-01/config.xml b/KEPCO/iocBoot/iocKEPCO-IOC-01/config.xml index 372569517..2be100478 100644 --- a/KEPCO/iocBoot/iocKEPCO-IOC-01/config.xml +++ b/KEPCO/iocBoot/iocKEPCO-IOC-01/config.xml @@ -12,6 +12,7 @@ + diff --git a/KEPCO/iocBoot/iocKEPCO-IOC-01/st-common.cmd b/KEPCO/iocBoot/iocKEPCO-IOC-01/st-common.cmd index 55b6b46cb..241cb72ae 100644 --- a/KEPCO/iocBoot/iocKEPCO-IOC-01/st-common.cmd +++ b/KEPCO/iocBoot/iocKEPCO-IOC-01/st-common.cmd @@ -6,6 +6,7 @@ cd ${TOP} < $(IOCSTARTUP)/init.cmd stringiftest "LOCALCALIB" "$(LOCAL_CALIB="no")" 5 "yes" +stringiftest "REMOTE_ON_SET" "$(REMOTE_ON_SET=YES)" 5 "YES" $(IFNOTLOCALCALIB) epicsEnvSet "CALIB_BASE_DIR" "$(ICPSETTINGSDIR)/config/common" $(IFNOTLOCALCALIB) epicsEnvSet "SENS_DIR" "magnets" @@ -38,6 +39,9 @@ $(IFNOTDEVSIM) $(IFNOTRECSIM) asynSetOption("L0", 0, "crtscts", "N") $(IFNOTDEVSIM) $(IFNOTRECSIM) asynSetOption("L0", -1, "ixon", "Y") $(IFNOTDEVSIM) $(IFNOTRECSIM) asynSetOption("L0", -1, "ixoff", "Y") +# put a limit on minimum time between writes to device +asynInterposeThrottleConfig("L0", 0, 0.01) + ## Load record instances ##ISIS## Load common DB records @@ -48,7 +52,7 @@ ReadASCIIConfigure("READASCII", "", $(RAMP_RATE=1.0), $(STEP_NUMBER=20), 1) ## Load record instances dbLoadRecords($(FILELIST)/db/calibration.db, "P=$(MYPVPREFIX)$(IOCNAME):, DEFAULT_FILE=default_calib.dat, CALIB_BASE_DIR=$(CALIB_BASE_DIR), SDIR=$(SENS_DIR), CALIBLIST=SENSORFILELIST, CONV_TO_PV=FIELD, CONV_FROM_PV=CURRENT:, CONV_TO_DESC=Field, CONV_TO_EGU=G") -dbLoadRecords("$(KEPCO)/db/kepco.db","P=$(MYPVPREFIX)$(IOCNAME):,PORT=L0,RESET=NO,DISABLE=$(DISABLE=0),RECSIM=$(RECSIM=0),RESET_ON_START=$(RESET_ON_START=0),CURRENT_RANGE=$(CURRENT_RANGE=Auto),VOLTAGE_RANGE=$(VOLTAGE_RANGE=Auto)") +dbLoadRecords("$(KEPCO)/db/kepco.db","P=$(MYPVPREFIX)$(IOCNAME):,PORT=L0,RESET=NO,DISABLE=$(DISABLE=0),RECSIM=$(RECSIM=0),RESET_ON_START=$(RESET_ON_START=0),CURRENT_RANGE=$(CURRENT_RANGE=Auto),VOLTAGE_RANGE=$(VOLTAGE_RANGE=Auto),IFREMOTE_ON_SET=$(IFREMOTE_ON_SET),IFNOTREMOTE_ON_SET=$(IFNOTREMOTE_ON_SET)") dbLoadRecords("$(KEPCO)/db/kepco_ramping.db","P=$(MYPVPREFIX)$(IOCNAME):, READ=READASCII, CURRENT_MAX=$(CURRENT_MAX=0),AUTOSAVE_CURRENT=$(AUTOSAVE_CURRENT=NO),AUTO_RAMP=$(AUTO_RAMP=OFF)") From 436c982c6a67f271a4002e20ae97cb57126369c7 Mon Sep 17 00:00:00 2001 From: Freddie Akeroyd Date: Fri, 27 Oct 2023 12:21:37 +0100 Subject: [PATCH 2/6] Pass REMOTE_ON_SET --- KEPCO/iocBoot/iocKEPCO-IOC-01/st-common.cmd | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/KEPCO/iocBoot/iocKEPCO-IOC-01/st-common.cmd b/KEPCO/iocBoot/iocKEPCO-IOC-01/st-common.cmd index 241cb72ae..2bb8fb163 100644 --- a/KEPCO/iocBoot/iocKEPCO-IOC-01/st-common.cmd +++ b/KEPCO/iocBoot/iocKEPCO-IOC-01/st-common.cmd @@ -6,6 +6,9 @@ cd ${TOP} < $(IOCSTARTUP)/init.cmd stringiftest "LOCALCALIB" "$(LOCAL_CALIB="no")" 5 "yes" + +## do we send a "go remote" commmand on every set? Usually we do +## but for muon zero field we do not as we send a lot rapidly stringiftest "REMOTE_ON_SET" "$(REMOTE_ON_SET=YES)" 5 "YES" $(IFNOTLOCALCALIB) epicsEnvSet "CALIB_BASE_DIR" "$(ICPSETTINGSDIR)/config/common" @@ -53,7 +56,7 @@ ReadASCIIConfigure("READASCII", "", $(RAMP_RATE=1.0), $(STEP_NUMBER=20), 1) dbLoadRecords($(FILELIST)/db/calibration.db, "P=$(MYPVPREFIX)$(IOCNAME):, DEFAULT_FILE=default_calib.dat, CALIB_BASE_DIR=$(CALIB_BASE_DIR), SDIR=$(SENS_DIR), CALIBLIST=SENSORFILELIST, CONV_TO_PV=FIELD, CONV_FROM_PV=CURRENT:, CONV_TO_DESC=Field, CONV_TO_EGU=G") dbLoadRecords("$(KEPCO)/db/kepco.db","P=$(MYPVPREFIX)$(IOCNAME):,PORT=L0,RESET=NO,DISABLE=$(DISABLE=0),RECSIM=$(RECSIM=0),RESET_ON_START=$(RESET_ON_START=0),CURRENT_RANGE=$(CURRENT_RANGE=Auto),VOLTAGE_RANGE=$(VOLTAGE_RANGE=Auto),IFREMOTE_ON_SET=$(IFREMOTE_ON_SET),IFNOTREMOTE_ON_SET=$(IFNOTREMOTE_ON_SET)") -dbLoadRecords("$(KEPCO)/db/kepco_ramping.db","P=$(MYPVPREFIX)$(IOCNAME):, READ=READASCII, CURRENT_MAX=$(CURRENT_MAX=0),AUTOSAVE_CURRENT=$(AUTOSAVE_CURRENT=NO),AUTO_RAMP=$(AUTO_RAMP=OFF)") +dbLoadRecords("$(KEPCO)/db/kepco_ramping.db","P=$(MYPVPREFIX)$(IOCNAME):, READ=READASCII, CURRENT_MAX=$(CURRENT_MAX=0),AUTOSAVE_CURRENT=$(AUTOSAVE_CURRENT=NO),AUTO_RAMP=$(AUTO_RAMP=OFF),IFREMOTE_ON_SET=$(IFREMOTE_ON_SET),IFNOTREMOTE_ON_SET=$(IFNOTREMOTE_ON_SET)") ##ISIS## Stuff that needs to be done after all records are loaded but before iocInit is called From 02ba4431872cc881b10064fde35645424cc77171 Mon Sep 17 00:00:00 2001 From: Freddie Akeroyd Date: Fri, 22 Dec 2023 20:45:50 +0000 Subject: [PATCH 3/6] pass remote_on_set to ramping --- KEPCO/iocBoot/iocKEPCO-IOC-01/st-common.cmd | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/KEPCO/iocBoot/iocKEPCO-IOC-01/st-common.cmd b/KEPCO/iocBoot/iocKEPCO-IOC-01/st-common.cmd index 241cb72ae..2bb8fb163 100644 --- a/KEPCO/iocBoot/iocKEPCO-IOC-01/st-common.cmd +++ b/KEPCO/iocBoot/iocKEPCO-IOC-01/st-common.cmd @@ -6,6 +6,9 @@ cd ${TOP} < $(IOCSTARTUP)/init.cmd stringiftest "LOCALCALIB" "$(LOCAL_CALIB="no")" 5 "yes" + +## do we send a "go remote" commmand on every set? Usually we do +## but for muon zero field we do not as we send a lot rapidly stringiftest "REMOTE_ON_SET" "$(REMOTE_ON_SET=YES)" 5 "YES" $(IFNOTLOCALCALIB) epicsEnvSet "CALIB_BASE_DIR" "$(ICPSETTINGSDIR)/config/common" @@ -53,7 +56,7 @@ ReadASCIIConfigure("READASCII", "", $(RAMP_RATE=1.0), $(STEP_NUMBER=20), 1) dbLoadRecords($(FILELIST)/db/calibration.db, "P=$(MYPVPREFIX)$(IOCNAME):, DEFAULT_FILE=default_calib.dat, CALIB_BASE_DIR=$(CALIB_BASE_DIR), SDIR=$(SENS_DIR), CALIBLIST=SENSORFILELIST, CONV_TO_PV=FIELD, CONV_FROM_PV=CURRENT:, CONV_TO_DESC=Field, CONV_TO_EGU=G") dbLoadRecords("$(KEPCO)/db/kepco.db","P=$(MYPVPREFIX)$(IOCNAME):,PORT=L0,RESET=NO,DISABLE=$(DISABLE=0),RECSIM=$(RECSIM=0),RESET_ON_START=$(RESET_ON_START=0),CURRENT_RANGE=$(CURRENT_RANGE=Auto),VOLTAGE_RANGE=$(VOLTAGE_RANGE=Auto),IFREMOTE_ON_SET=$(IFREMOTE_ON_SET),IFNOTREMOTE_ON_SET=$(IFNOTREMOTE_ON_SET)") -dbLoadRecords("$(KEPCO)/db/kepco_ramping.db","P=$(MYPVPREFIX)$(IOCNAME):, READ=READASCII, CURRENT_MAX=$(CURRENT_MAX=0),AUTOSAVE_CURRENT=$(AUTOSAVE_CURRENT=NO),AUTO_RAMP=$(AUTO_RAMP=OFF)") +dbLoadRecords("$(KEPCO)/db/kepco_ramping.db","P=$(MYPVPREFIX)$(IOCNAME):, READ=READASCII, CURRENT_MAX=$(CURRENT_MAX=0),AUTOSAVE_CURRENT=$(AUTOSAVE_CURRENT=NO),AUTO_RAMP=$(AUTO_RAMP=OFF),IFREMOTE_ON_SET=$(IFREMOTE_ON_SET),IFNOTREMOTE_ON_SET=$(IFNOTREMOTE_ON_SET)") ##ISIS## Stuff that needs to be done after all records are loaded but before iocInit is called From 85fe3e357cff51ce8114ee98637fba434b4db00b Mon Sep 17 00:00:00 2001 From: Freddie Akeroyd Date: Mon, 1 Jan 2024 20:46:25 +0000 Subject: [PATCH 4/6] Average over 100 values --- ZFMAGFLD/iocBoot/iocZFMAGFLD-IOC-01/st-daq.cmd | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ZFMAGFLD/iocBoot/iocZFMAGFLD-IOC-01/st-daq.cmd b/ZFMAGFLD/iocBoot/iocZFMAGFLD-IOC-01/st-daq.cmd index ff6ffb720..68a2711a0 100644 --- a/ZFMAGFLD/iocBoot/iocZFMAGFLD-IOC-01/st-daq.cmd +++ b/ZFMAGFLD/iocBoot/iocZFMAGFLD-IOC-01/st-daq.cmd @@ -1,8 +1,8 @@ epicsEnvSet("CDAQ","$(HOST=cDAQ9181-1B0C1FCMod1)") ## 3xAI inputs from a cDAQ 9181, one input per magnetometer channel -$(IFNOTRECSIM) DAQmxConfig("R0", "$(CDAQ)/$(X_DAQ_CHANNEL=ai0)", 0, "AI","MONSTER TerminalDiff N=1 F=1000") # X (horizontal transverse - parallel to the floor) -$(IFNOTRECSIM) DAQmxConfig("R0", "$(CDAQ)/$(Y_DAQ_CHANNEL=ai1)", 1, "AI","MONSTER TerminalDiff N=1 F=1000") # Y (vertical transverse - perpendicular to the floor) -$(IFNOTRECSIM) DAQmxConfig("R0", "$(CDAQ)/$(Z_DAQ_CHANNEL=ai2)", 2, "AI","MONSTER TerminalDiff N=1 F=1000") # Z (along the beam, in the direction of the beam) +$(IFNOTRECSIM) DAQmxConfig("R0", "$(CDAQ)/$(X_DAQ_CHANNEL=ai0)", 0, "AI","MONSTER TerminalDiff N=100 F=1000") # X (horizontal transverse - parallel to the floor) +$(IFNOTRECSIM) DAQmxConfig("R0", "$(CDAQ)/$(Y_DAQ_CHANNEL=ai1)", 1, "AI","MONSTER TerminalDiff N=100 F=1000") # Y (vertical transverse - perpendicular to the floor) +$(IFNOTRECSIM) DAQmxConfig("R0", "$(CDAQ)/$(Z_DAQ_CHANNEL=ai2)", 2, "AI","MONSTER TerminalDiff N=100 F=1000") # Z (along the beam, in the direction of the beam) -$(IFNOTRECSIM) $(IFHAS_EXTRA_DAQ_CHANNEL) DAQmxConfig("R0", "$(CDAQ)/$(EXTRA_DAQ_CHANNEL=ai3)", 3, "AI","MONSTER TerminalDiff N=1 F=1000") +$(IFNOTRECSIM) $(IFHAS_EXTRA_DAQ_CHANNEL) DAQmxConfig("R0", "$(CDAQ)/$(EXTRA_DAQ_CHANNEL=ai3)", 3, "AI","MONSTER TerminalDiff N=100 F=1000") From 1f6e4c8991a8d9001070fe50152e2a0cd716a520 Mon Sep 17 00:00:00 2001 From: Freddie Akeroyd Date: Mon, 1 Jan 2024 20:47:51 +0000 Subject: [PATCH 5/6] KEPCO: Pass current max --- KEPCO/iocBoot/iocKEPCO-IOC-01/st-common.cmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/KEPCO/iocBoot/iocKEPCO-IOC-01/st-common.cmd b/KEPCO/iocBoot/iocKEPCO-IOC-01/st-common.cmd index 2bb8fb163..c9c7b7182 100644 --- a/KEPCO/iocBoot/iocKEPCO-IOC-01/st-common.cmd +++ b/KEPCO/iocBoot/iocKEPCO-IOC-01/st-common.cmd @@ -55,7 +55,7 @@ ReadASCIIConfigure("READASCII", "", $(RAMP_RATE=1.0), $(STEP_NUMBER=20), 1) ## Load record instances dbLoadRecords($(FILELIST)/db/calibration.db, "P=$(MYPVPREFIX)$(IOCNAME):, DEFAULT_FILE=default_calib.dat, CALIB_BASE_DIR=$(CALIB_BASE_DIR), SDIR=$(SENS_DIR), CALIBLIST=SENSORFILELIST, CONV_TO_PV=FIELD, CONV_FROM_PV=CURRENT:, CONV_TO_DESC=Field, CONV_TO_EGU=G") -dbLoadRecords("$(KEPCO)/db/kepco.db","P=$(MYPVPREFIX)$(IOCNAME):,PORT=L0,RESET=NO,DISABLE=$(DISABLE=0),RECSIM=$(RECSIM=0),RESET_ON_START=$(RESET_ON_START=0),CURRENT_RANGE=$(CURRENT_RANGE=Auto),VOLTAGE_RANGE=$(VOLTAGE_RANGE=Auto),IFREMOTE_ON_SET=$(IFREMOTE_ON_SET),IFNOTREMOTE_ON_SET=$(IFNOTREMOTE_ON_SET)") +dbLoadRecords("$(KEPCO)/db/kepco.db","P=$(MYPVPREFIX)$(IOCNAME):,PORT=L0,RESET=NO,DISABLE=$(DISABLE=0),RECSIM=$(RECSIM=0),RESET_ON_START=$(RESET_ON_START=0),CURRENT_RANGE=$(CURRENT_RANGE=Auto),VOLTAGE_RANGE=$(VOLTAGE_RANGE=Auto),CURRENT_MAX=$(CURRENT_MAX=0),IFREMOTE_ON_SET=$(IFREMOTE_ON_SET),IFNOTREMOTE_ON_SET=$(IFNOTREMOTE_ON_SET)") dbLoadRecords("$(KEPCO)/db/kepco_ramping.db","P=$(MYPVPREFIX)$(IOCNAME):, READ=READASCII, CURRENT_MAX=$(CURRENT_MAX=0),AUTOSAVE_CURRENT=$(AUTOSAVE_CURRENT=NO),AUTO_RAMP=$(AUTO_RAMP=OFF),IFREMOTE_ON_SET=$(IFREMOTE_ON_SET),IFNOTREMOTE_ON_SET=$(IFNOTREMOTE_ON_SET)") From 58b6128b42396cfaa9f3fc64d40e3cb3ea73e69a Mon Sep 17 00:00:00 2001 From: Freddie Akeroyd Date: Fri, 3 May 2024 15:45:49 +0100 Subject: [PATCH 6/6] Make DAQ sample configurable --- ZFMAGFLD/iocBoot/iocZFMAGFLD-IOC-01/config.xml | 5 +++-- ZFMAGFLD/iocBoot/iocZFMAGFLD-IOC-01/st-daq.cmd | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/ZFMAGFLD/iocBoot/iocZFMAGFLD-IOC-01/config.xml b/ZFMAGFLD/iocBoot/iocZFMAGFLD-IOC-01/config.xml index 3374dce00..4329de3cc 100644 --- a/ZFMAGFLD/iocBoot/iocZFMAGFLD-IOC-01/config.xml +++ b/ZFMAGFLD/iocBoot/iocZFMAGFLD-IOC-01/config.xml @@ -28,8 +28,9 @@ - - + + + diff --git a/ZFMAGFLD/iocBoot/iocZFMAGFLD-IOC-01/st-daq.cmd b/ZFMAGFLD/iocBoot/iocZFMAGFLD-IOC-01/st-daq.cmd index 68a2711a0..145bbff63 100644 --- a/ZFMAGFLD/iocBoot/iocZFMAGFLD-IOC-01/st-daq.cmd +++ b/ZFMAGFLD/iocBoot/iocZFMAGFLD-IOC-01/st-daq.cmd @@ -1,8 +1,8 @@ epicsEnvSet("CDAQ","$(HOST=cDAQ9181-1B0C1FCMod1)") ## 3xAI inputs from a cDAQ 9181, one input per magnetometer channel -$(IFNOTRECSIM) DAQmxConfig("R0", "$(CDAQ)/$(X_DAQ_CHANNEL=ai0)", 0, "AI","MONSTER TerminalDiff N=100 F=1000") # X (horizontal transverse - parallel to the floor) -$(IFNOTRECSIM) DAQmxConfig("R0", "$(CDAQ)/$(Y_DAQ_CHANNEL=ai1)", 1, "AI","MONSTER TerminalDiff N=100 F=1000") # Y (vertical transverse - perpendicular to the floor) -$(IFNOTRECSIM) DAQmxConfig("R0", "$(CDAQ)/$(Z_DAQ_CHANNEL=ai2)", 2, "AI","MONSTER TerminalDiff N=100 F=1000") # Z (along the beam, in the direction of the beam) +$(IFNOTRECSIM) DAQmxConfig("R0", "$(CDAQ)/$(X_DAQ_CHANNEL=ai0)", 0, "AI","MONSTER TerminalDiff N=$(DAQ_SAMPLES=1) F=1000") # X (horizontal transverse - parallel to the floor) +$(IFNOTRECSIM) DAQmxConfig("R0", "$(CDAQ)/$(Y_DAQ_CHANNEL=ai1)", 1, "AI","MONSTER TerminalDiff N=$(DAQ_SAMPLES=1) F=1000") # Y (vertical transverse - perpendicular to the floor) +$(IFNOTRECSIM) DAQmxConfig("R0", "$(CDAQ)/$(Z_DAQ_CHANNEL=ai2)", 2, "AI","MONSTER TerminalDiff N=$(DAQ_SAMPLES=1) F=1000") # Z (along the beam, in the direction of the beam) -$(IFNOTRECSIM) $(IFHAS_EXTRA_DAQ_CHANNEL) DAQmxConfig("R0", "$(CDAQ)/$(EXTRA_DAQ_CHANNEL=ai3)", 3, "AI","MONSTER TerminalDiff N=100 F=1000") +$(IFNOTRECSIM) $(IFHAS_EXTRA_DAQ_CHANNEL) DAQmxConfig("R0", "$(CDAQ)/$(EXTRA_DAQ_CHANNEL=ai3)", 3, "AI","MONSTER TerminalDiff N=$(DAQ_SAMPLES=1) F=1000")