From 952c14b68b357f651f6c9bca5e00e68c761fb58e Mon Sep 17 00:00:00 2001 From: Kevin Peterson Date: Fri, 5 May 2023 08:45:31 -0500 Subject: [PATCH] Simplified the newfocus8742 example. Made it easier to copy to a different IOC. --- .../newfocus8742.asyn.motor.substitutions | 8 --- .../newfocus8742.asyn.st.cmd.linux-x86 | 64 ------------------- .../iocBoot/iocNewFocus/newfocus8742.cmd | 25 ++++++++ .../iocNewFocus/newfocus8742.substitutions | 8 +++ iocs/newFocusIOC/iocBoot/iocNewFocus/st.cmd | 2 + 5 files changed, 35 insertions(+), 72 deletions(-) delete mode 100644 iocs/newFocusIOC/iocBoot/iocNewFocus/newfocus8742.asyn.motor.substitutions delete mode 100644 iocs/newFocusIOC/iocBoot/iocNewFocus/newfocus8742.asyn.st.cmd.linux-x86 create mode 100644 iocs/newFocusIOC/iocBoot/iocNewFocus/newfocus8742.cmd create mode 100644 iocs/newFocusIOC/iocBoot/iocNewFocus/newfocus8742.substitutions diff --git a/iocs/newFocusIOC/iocBoot/iocNewFocus/newfocus8742.asyn.motor.substitutions b/iocs/newFocusIOC/iocBoot/iocNewFocus/newfocus8742.asyn.motor.substitutions deleted file mode 100644 index 92b6c67..0000000 --- a/iocs/newFocusIOC/iocBoot/iocNewFocus/newfocus8742.asyn.motor.substitutions +++ /dev/null @@ -1,8 +0,0 @@ -file "$(MOTOR)/db/basic_asyn_motor.db" -{ -pattern -{P, N, M, DTYP, PORT, ADDR, C, S, DESC, EGU, DIR, VELO, VBAS, ACCL, BDST, BVEL, BACC, MRES, PREC, DHLM, DLLM, INIT} -{newFocus:, 1, "X", "asynMotor", M0, 1, 0, 0, "X", counts, Pos, 100, 25, 1, 0, 0, 50, 1, 0, 0, 0, ""} -{newFocus:, 2, "Y", "asynMotor", M0, 2, 0, 0, "Y", counts, Pos, 100, 25, 1, 0, 0, 50, 1, 0, 0, 0, ""} -} - diff --git a/iocs/newFocusIOC/iocBoot/iocNewFocus/newfocus8742.asyn.st.cmd.linux-x86 b/iocs/newFocusIOC/iocBoot/iocNewFocus/newfocus8742.asyn.st.cmd.linux-x86 deleted file mode 100644 index f7868f1..0000000 --- a/iocs/newFocusIOC/iocBoot/iocNewFocus/newfocus8742.asyn.st.cmd.linux-x86 +++ /dev/null @@ -1,64 +0,0 @@ -#!../../bin/linux-x86_64/newFocus - -< envPaths - -epicsEnvSet("EPICS_CA_AUTO_ADDR_LIST", "NO") -epicsEnvSet("EPICS_CA_ADDR_LIST", "10.28.0.255") - -epicsEnvSet("Sys", "Sys") -epicsEnvSet("Port", "P0") -epicsEnvSet("ControllerPort", "M0") -epicsEnvSet("MC", "MC:10") -epicsEnvSet("CT", "CT") -epicsEnvSet("IOC_PREFIX", "$(CT){IOC:MC10}") -epicsEnvSet("MC_PREFIX", "$(CT){$(MC)}") - -cd ${TOP} - -## Register all support components -dbLoadDatabase "dbd/newFocus.dbd" -newFocus_registerRecordDeviceDriver pdbbase - -# Setup IP port for 8742 -drvAsynIPPortConfigure("$(Port)", "10.28.2.111:23") -asynOctetSetInputEos("$(Port)",0,"\r\n") -asynOctetSetOutputEos("$(Port)",0,"\r") - -#db asyn debug traces -asynSetTraceMask("$(Port)",-1,0x1) -asynSetTraceIOMask("$(Port)",-1,0x1) - - -# New Focus Picomotor Network Controller (model 87xx) configuration parameters: -# (1) IP asyn port name (string) -# (2) Controller asyn port name (string) -# (3) Number of axes -# (4) Moving poll period (ms) -# (5) Idle poll period (ms) -nf874xCreateController("$(ControllerPort)", "$(Port)", 4, 200, 1000) - -## Load record instances -dbLoadTemplate("iocBoot/iocNewFocus/newfocus8742.asyn.motor.substitutions") - -dbLoadRecords("${ASYN}/db/asynRecord.db", "P=$(MC_PREFIX),R=Asyn,PORT=$(Port),ADDR=,OMAX=80,IMAX=80") - -## autosave/restore machinery -#!save_restoreSet_Debug(0) -#!save_restoreSet_IncompleteSetsOk(1) -#!save_restoreSet_DatedBackupFiles(1) - -#!set_savefile_path("${TOP}/as","/save") -#!set_requestfile_path("${TOP}/as","/req") - -#!set_pass0_restoreFile("info_positions.sav") -#!set_pass0_restoreFile("info_settings.sav") -#!set_pass1_restoreFile("info_settings.sav") - -iocInit() - -## more autosave/restore machinery -#!cd ${TOP}/as/req -#!makeAutosaveFiles() -#!create_monitor_set("info_positions.req", 5 , "") -#!create_monitor_set("info_settings.req", 15 , "") - diff --git a/iocs/newFocusIOC/iocBoot/iocNewFocus/newfocus8742.cmd b/iocs/newFocusIOC/iocBoot/iocNewFocus/newfocus8742.cmd new file mode 100644 index 0000000..8c6154e --- /dev/null +++ b/iocs/newFocusIOC/iocBoot/iocNewFocus/newfocus8742.cmd @@ -0,0 +1,25 @@ + +epicsEnvSet("PORT", "NF1") +epicsEnvSet("IP_ADDR", "10.28.2.211") + +# Setup IP port for 8742 +drvAsynIPPortConfigure("$(PORT)_ETH", "$(IP_ADDR):23") +asynOctetSetInputEos("$(PORT)_ETH",0,"\r\n") +asynOctetSetOutputEos("$(PORT)_ETH",0,"\r") + +#db asyn debug traces +asynSetTraceMask("$(PORT)_ETH",-1,0x1) +asynSetTraceIOMask("$(PORT)_ETH",-1,0x1) + +# New Focus Picomotor Network Controller (model 87xx) configuration parameters: +# (1) Controller asyn port name (string) +# (2) IP asyn port name (string) +# (3) Number of axes +# (4) Moving poll period (ms) +# (5) Idle poll period (ms) +nf874xCreateController("$(PORT)", "$(PORT)_ETH", 3, 200, 1000) + +## Load record instances +dbLoadTemplate("newfocus8742.substitutions", "P=$(PREFIX),PORT=$(PORT)") + +dbLoadRecords("$(ASYN)/db/asynRecord.db", "P=$(PREFIX),R=asyn_1,PORT=$(PORT),ADDR=,OMAX=80,IMAX=80") diff --git a/iocs/newFocusIOC/iocBoot/iocNewFocus/newfocus8742.substitutions b/iocs/newFocusIOC/iocBoot/iocNewFocus/newfocus8742.substitutions new file mode 100644 index 0000000..45ac30d --- /dev/null +++ b/iocs/newFocusIOC/iocBoot/iocNewFocus/newfocus8742.substitutions @@ -0,0 +1,8 @@ +file "$(MOTOR)/db/asyn_motor.db" +{ +pattern +{M, DTYP, ADDR, DESC, EGU, DIR, VELO, VBAS, ACCL, BDST, BVEL, BACC, MRES, PREC, DHLM, DLLM, INIT} +{"m1", "asynMotor", 1, "m1", counts, Pos, 100, 25, 1, 0, 0, 50, 1, 0, 0, 0, ""} +{"m2", "asynMotor", 2, "m2", counts, Pos, 100, 25, 1, 0, 0, 50, 1, 0, 0, 0, ""} +{"m3", "asynMotor", 3, "m3", counts, Pos, 100, 25, 1, 0, 0, 50, 1, 0, 0, 0, ""} +} diff --git a/iocs/newFocusIOC/iocBoot/iocNewFocus/st.cmd b/iocs/newFocusIOC/iocBoot/iocNewFocus/st.cmd index 8087e0c..601c2e0 100644 --- a/iocs/newFocusIOC/iocBoot/iocNewFocus/st.cmd +++ b/iocs/newFocusIOC/iocBoot/iocNewFocus/st.cmd @@ -15,6 +15,8 @@ dbLoadRecords("$(MOTOR)/db/motorUtil.db", "P=newFocus:") ## < PMNC87xx.cmd +## +< newfocus8742.cmd iocInit