Skip to content

Commit

Permalink
Merge pull request #581 from ISISComputingGroup/Ticket5950_lksh340_ex…
Browse files Browse the repository at this point in the history
…citation

Add excitations logic to lakeshore 340 IOC
  • Loading branch information
Tom-Willemsen authored Feb 3, 2021
2 parents f3c24af + 2412952 commit fab711c
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
2 changes: 2 additions & 0 deletions LKSH340/LKSH340-IOC-01App/src/build.mak
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ $(APPNAME)_DBD += asyn.dbd
$(APPNAME)_DBD += drvAsynSerialPort.dbd
$(APPNAME)_DBD += drvAsynIPPort.dbd
$(APPNAME)_DBD += calcSupport.dbd
$(APPNAME)_DBD += Lakeshore340.dbd
## add other dbd here ##
#$(APPNAME)_DBD += xxx.dbd

Expand All @@ -48,6 +49,7 @@ $(APPNAME)_LIBS += asyn
## Add other libraries here ##
$(APPNAME)_LIBS += calc sscan
$(APPNAME)_LIBS += seq pv
$(APPNAME)_LIBS += Lakeshore340
#$(APPNAME)_LIBS += xxx

# LKSH340-IOC-01_registerRecordDeviceDriver.cpp derives from LKSH340-IOC-01.dbd
Expand Down
3 changes: 2 additions & 1 deletion LKSH340/configure/RELEASE
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@ SSCAN=$(SUPPORT)/sscan/master
STREAMDEVICE=$(SUPPORT)/StreamDevice/master
UTILITIES=$(SUPPORT)/utilities/master
ZLIB=$(SUPPORT)/zlib/master
LKSH340=$(SUPPORT)/lakeshore340/master

# optional extra local definitions here
-include $(TOP)/configure/RELEASE.private

include $(TOP)/../../../ISIS_CONFIG
-include $(TOP)/../../../ISIS_CONFIG.$(EPICS_HOST_ARCH)

LKSH340=$(SUPPORT)/lakeshore340/master
2 changes: 2 additions & 0 deletions LKSH340/iocBoot/iocLKSH340-IOC-01/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
<macro name="BITS" pattern="^[0-9]$" description="Serial communication number of bits, defaults to 7." defaultValue="7" hasDefault="YES" />
<macro name="PARITY" pattern="^(even)|(odd)|(none)$" description="Serial communication parity, defaults to odd." defaultValue="odd" hasDefault="YES" />
<macro name="STOP" pattern="^[0-9]$" description="Serial communication stop bit, defaults to 1." defaultValue="1" hasDefault="YES" />
<macro name="EXCITATION_THRESHOLD_FILE" pattern="^.*" description="The file to get temperature thresholds and excitation values to set from." hasDefault="NO" />
<macro name="USE_EXCITATION_THRESHOLD_FILE" pattern="^.*" description="Whether to use the EXCITATION_THRESHOLD_FILE. YES to use or NO to not. Defaults to NO." defaultValue="NO", hasDefault="YES" />
</macros>
</config_part>
</ioc_config>
11 changes: 10 additions & 1 deletion LKSH340/iocBoot/iocLKSH340-IOC-01/st-common.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ $(IFNOTDEVSIM) $(IFNOTRECSIM) asynSetOption("$(DEVICE)",0,"ixoff","N")
##ISIS## Load common DB records
< $(IOCSTARTUP)/dbload.cmd

stringiftest("USE_EXCITATION_FILE" "$(USE_EXCITATION_THRESHOLD_FILE=NO)" 5 "YES")

## Load our record instances
dbLoadRecords("$(LKSH340)/db/Lakeshore340.db","P=$(MYPVPREFIX)$(IOCNAME):,RECSIM=$(RECSIM=0),DISABLE=$(DISABLE=0),PORT=$(DEVICE)")
dbLoadRecords("$(LKSH340)/db/Lakeshore340.db","P=$(MYPVPREFIX)$(IOCNAME):,RECSIM=$(RECSIM=0),DISABLE=$(DISABLE=0),PORT=$(DEVICE),IFUSE_EXCITATION_FILE=$(IFUSE_EXCITATION_FILE),IFNOTUSE_EXCITATION_FILE=$(IFNOTUSE_EXCITATION_FILE)")
dbLoadRecords("$(LKSH340)/db/Lakeshore340_channel.db","P=$(MYPVPREFIX)$(IOCNAME):,PORT=$(DEVICE)")

##ISIS## Stuff that needs to be done after all records are loaded but before iocInit is called
Expand All @@ -38,5 +40,12 @@ dbLoadRecords("$(LKSH340)/db/Lakeshore340_channel.db","P=$(MYPVPREFIX)$(IOCNAME)
cd "${TOP}/iocBoot/${IOC}"
iocInit

$(IFUSE_EXCITATION_FILE) $(IFNOTDEVSIM) $(IFNOTRECSIM) epicsEnvSet "EXCITATION_THRESHOLD_DIR" "$(ICPCONFIGBASE)/$(INSTRUMENT)"
$(IFUSE_EXCITATION_FILE) $(IFRECSIM) epicsEnvSet "EXCITATION_THRESHOLD_DIR" "$(LKSH340)"
$(IFUSE_EXCITATION_FILE) $(IFDEVSIM) epicsEnvSet "EXCITATION_THRESHOLD_DIR" "$(LKSH340)"
$(IFUSE_EXCITATION_FILE) epicsEnvSet "EXCITATION_THRESHOLD_DIR_AND_FILE" "$(EXCITATION_THRESHOLD_DIR=)/excitation_thresholds/$(EXCITATION_THRESHOLD_FILE=)"

$(IFUSE_EXCITATION_FILE) dbpf "$(MYPVPREFIX)$(IOCNAME):THRESHOLDS:FILE" "$(EXCITATION_THRESHOLD_DIR_AND_FILE=)"

##ISIS## Stuff that needs to be done after iocInit is called e.g. sequence programs
< $(IOCSTARTUP)/postiocinit.cmd

0 comments on commit fab711c

Please sign in to comment.