ISIS Logo
GALIL
GALIL IOC
st-common.cmd
Go to the documentation of this file.
1 
2 ##ISIS## Run IOC initialisation
3 epicsEnvSet("IFIOC_GALIL_01", "#")
4 epicsEnvSet("IFIOC_GALIL_02", "#")
5 epicsEnvSet("IFIOC_GALIL_03", "#")
6 epicsEnvSet("IFIOC_GALIL_04", "#")
7 epicsEnvSet("IFIOC_GALIL_05", "#")
8 epicsEnvSet("IFIOC_GALIL_06", "#")
9 epicsEnvSet("IFIOC_GALIL_07", "#")
10 epicsEnvSet("IFIOC_GALIL_08", "#")
11 epicsEnvSet("IFIOC_GALIL_09", "#")
12 epicsEnvSet("IFIOC_GALIL_10", "#")
13 < $(IOCSTARTUP)/init.cmd
14 
15 ##ISIS## Load common DB records
16 < $(IOCSTARTUP)/dbload.cmd
17 
18 ### Scan-support software
19 # crate-resident scan. This executes 1D, 2D, 3D, and 4D scans, and caches
20 # 1D data, but it doesn't store anything to disk. (See 'saveData' below for that.)
21 #dbLoadRecords("$(SSCAN)/sscanApp/Db/scan.db","P=$(MYPVPREFIX)$(IOCNAME):,MAXPTS1=8000,MAXPTS2=1000,MAXPTS3=10,MAXPTS4=10,MAXPTSH=8000")
22 
23 ### autosave
24 # specify additional directories in which to to search for included request files
25 set_requestfile_path("${GALIL}/GalilSup/Db", "")
26 set_requestfile_path("${MOTOR}/motorApp/Db", "")
27 
28 ## as all Galils cd to GALIL-IOC-01 need to add this explicitly so info generated req files are found
29 set_requestfile_path("${TOP}/iocBoot/iocGALIL-IOC-01", "")
30 
31 ## Make sure controller number is 2 digits long
32 calc("MTRCTRL", "$(MTRCTRL)", 2, 2)
33 
34 epicsEnvSet("GALILCONFIG","$(GALILCONFIGDIR=$(ICPCONFIGROOT)/galil)")
35 
36 ## uncomment to see every command sent to every galil, of define in st.cmd for just one galil
37 #epicsEnvSet("GALIL_DEBUG_FILE", "galil_debug.txt")
38 
39 ## create simulated motor if required (asyn port "GalilSim")
40 $(IFDEVSIM) < motorsim.cmd
41 $(IFRECSIM) < motorsim.cmd
42 
43 ## configure the galil, if we are simulated this will not be used to drive the
44 ## actual device, but creating this asyn port at least allows record initialisation
45 ## to complete
46 < $(GALILCONFIG)/galil$(MTRCTRL).cmd
47 
48 ## GALIL_MTR_PORT is the asyn port used to load just the motor record, other records
49 ## are loaded with "Galil" as the asyn port
50 $(IFDEVSIM) epicsEnvSet("GALIL_MTR_PORT", "GalilSim")
51 $(IFRECSIM) epicsEnvSet("GALIL_MTR_PORT", "GalilSim")
52 $(IFNOTDEVSIM) $(IFNOTRECSIM) epicsEnvSet("GALIL_MTR_PORT", "Galil")
53 
54 ## load the galil db files
55 < galildb.cmd
56 
57 ## load the generic ISIS axis db for each axis
58 iocshCmdLoop("< st-axis.cmd", "MN=\$(I)", "I", 1, 8)
59 
60 ## configure jaws
61 < $(GALILCONFIG)/jaws.cmd
62 
63 ## configure barndoors
64 < $(GALILCONFIG)/barndoors.cmd
65 
66 ## configure axes
67 < $(GALILCONFIG)/axes.cmd
68 
69 ## motion set points
70 < $(GALILCONFIG)/motionsetpoints.cmd
71 
72 ## sample changer
73 < $(GALILCONFIG)/sampleChanger.cmd
74 
75 # motor extensions
76 < $(GALILCONFIG)/motorExtensions.cmd
77 
78 ## motor util package
79 dbLoadRecords("$(MOTOR)/db/motorUtil.db","P=$(MYPVPREFIX)$(IOCNAME):,$(IFIOC)= ,PVPREFIX=$(MYPVPREFIX)")
80 
81 stringiftest("MOTORCONFIG", "$(MOTORCONFIG=)", 0, 0)
82 $(IFMOTORCONFIG) dbLoadRecords("$(AUTOSAVE)/asApp/Db/configMenu.db","P=$(MYPVPREFIX)$(IOCNAME):CONFIG:,CONFIG=$(MOTORCONFIG=)")
83 
84 ##ISIS## Stuff that needs to be done after all records are loaded but before iocInit is called
85 < $(IOCSTARTUP)/preiocinit.cmd
86 
87 ## trace mask: 0x1=trace_error,0x2=traceio_device,0x4=traceio_filter, 0x8=traceio_driver, 0x10=trace_flow, 0x20=trace_warning
88 #asynSetTraceMask("Galil",-1,0x39)
89 #asynSetTraceFile("Galil",-1,"galil.trace")
90 #asynSetTraceIOMask("Galil",-1,0x2)
91 
92 iocInit()
93 
94 ## motor util package
95 #var motorUtil_debug 1
96 motorUtilInit("$(MYPVPREFIX)$(IOCNAME):")
97 
98 ##ISIS## Stuff that needs to be done after iocInit is called e.g. sequence programs
99 < $(IOCSTARTUP)/postiocinit.cmd
100 
101 stringiftest("HASMTRCTRL", "$(MTRCTRL=)", 0, 0)
102 $(IFNOTHASMTRCTRL) errlogSev(2, "MTRCTRL has not been set")
103 
104 # Save motor positions every 5 seconds
105 $(IFHASMTRCTRL) $(IFNOTDEVSIM) $(IFNOTRECSIM) create_monitor_set("$(IOCNAME)_positions.req", 5, "P=$(MYPVPREFIX)MOT:,CCP=$(MTRCTRL)")
106 
107 # Save motor settings every 30 seconds
108 $(IFHASMTRCTRL) $(IFNOTDEVSIM) $(IFNOTRECSIM) create_monitor_set("$(IOCNAME)_settings.req", 30, "P=$(MYPVPREFIX)MOT:,CCP=$(MTRCTRL)")
109 
110 $(IFHASMTRCTRL) $(IFMOTORCONFIG) create_manual_set("$(MOTORCONFIG=)Menu.req","P=$(MYPVPREFIX)MOT:,CMP=$(MYPVPREFIX)$(IOCNAME):CONFIG:,CONFIG=$(MOTORCONFIG=),IOCNAME=$(IOCNAME),MTRCTRL=$(MTRCTRL),CONFIGMENU=1")
111 
112 ## Start any sequence programs
113 #seq sncxxx,"user=icsHost"
epicsEnvSet("AMOTORNAME","MTR$(MTRCTRL)0$(MN)")
set_requestfile_path("${GALIL}/GalilSup/Db","")
ISIS## Load common DB records ;.
Copyright © 2013 Science and Technology Facilities Council | Generated by   doxygen 1.8.5