Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add REMOTE_ON_SET macro #807

Merged
merged 9 commits into from
May 28, 2024
1 change: 1 addition & 0 deletions KEPCO/iocBoot/iocKEPCO-IOC-01/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<macro name="AUTO_RAMP" pattern="^(ON|OFF)$" description="Whether to turn ramping on automatically when field/curr is set." hasDefault="YES" defaultValue="OFF" />
<macro name="CURRENT_RANGE" pattern="^(Auto|Full|Quarter)$" description="Operating range for control of output current" hasDefault="YES" defaultValue="Auto" />
<macro name="VOLTAGE_RANGE" pattern="^(Auto|Full|Quarter)$" description="Operating range for control of output voltage" hasDefault="YES" defaultValue="Auto" />
<macro name="REMOTE_ON_SET" pattern="^(YES|NO)$" description="Send go REMOTE command on every current/voltage set" hasDefault="YES" defaultValue="YES" />
</macros>
</config_part>
</ioc_config>
11 changes: 9 additions & 2 deletions KEPCO/iocBoot/iocKEPCO-IOC-01/st-common.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ cd ${TOP}

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"
$(IFNOTLOCALCALIB) epicsEnvSet "SENS_DIR" "magnets"

Expand Down Expand Up @@ -38,6 +42,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
Expand All @@ -48,8 +55,8 @@ 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_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.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)")


##ISIS## Stuff that needs to be done after all records are loaded but before iocInit is called
Expand Down
5 changes: 3 additions & 2 deletions ZFMAGFLD/iocBoot/iocZFMAGFLD-IOC-01/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@
<macro name="Z_DAQ_CHANNEL" pattern="^ai[0-9]+$" description="DAQ channel to read for the Z axis" defaultValue="ai2" hasDefault="YES" />

<macro name="EXTRA_DAQ_CHANNEL" pattern="^.*$" description="DAQ channel for the optional extra channel. Leave empty to disable. (e.g. ai3)" defaultValue="" hasDefault="YES" />

<macro name="NUM_SAMPLES" pattern="" description="The number of samples to compress into 1 record for smoothing" defaultValue="1" hasDefault="YES" />

<macro name="NUM_SAMPLES" pattern="" description="The number of samples to compress into 1 record for smoothing" defaultValue="1" hasDefault="YES" />
<macro name="DAQ_SAMPLES" pattern="" description="The number of samples from CDAQ averaged by DAQmx at a time - aids smoothing and performance" defaultValue="1" hasDefault="YES" />

</macros>
<pvsets>
Expand Down
8 changes: 4 additions & 4 deletions ZFMAGFLD/iocBoot/iocZFMAGFLD-IOC-01/st-daq.cmd
Original file line number Diff line number Diff line change
@@ -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=$(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=1 F=1000")
$(IFNOTRECSIM) $(IFHAS_EXTRA_DAQ_CHANNEL) DAQmxConfig("R0", "$(CDAQ)/$(EXTRA_DAQ_CHANNEL=ai3)", 3, "AI","MONSTER TerminalDiff N=$(DAQ_SAMPLES=1) F=1000")