## PAD RTEMS startup script for RF Gun Cell PAD in RF Hut PADLAN9118_GEN app ## Set common environment variables #< /boot/lcls/epics/iocCommon/All/Prod/pre_st.cmd should be done by calling script # Setup for generic piece setenv("IPADDR1","172.27.206.12",1) setenv("NETMASK1","255.255.255.0",1) setenv("PADSLOT","2",1) # Must match $(pad) in llrf*.*_substituitions setenv("LOCAs","IN20",1) setenv("UNITs","1",1) #addpath("/boot/g/lcls/users/strauman/epics/dev/app/bin/RTEMS-uC5282/:",1) # Generic piece of Stripline BPM PAD initialization wdStart(20) # Dedicated ethernet + network stack driver ld("lanIpBasic.obj") #check that it finds this # turning on lanIpDebug shows you all the ARP requests on the console lanIpDebug = 0 lanIpSetup(getenv("IPADDR1"),getenv("NETMASK1"),0,0) chdir("/boot/lcls/epics/iocTop/LLRF/Pad4-Prod") ld("bin/RTEMS-uC5282/padLan9118GenApp.obj") lsmod() epicsEnvSet("EPICS_CA_MAX_ARRAY_BYTES","1000000") dbLoadDatabase("dbd/pad4App.dbd") pad4App_registerRecordDeviceDriver(pdbbase) drvPadScalFlag=4 drvPadLan9118DacqFlag=2 ## Load record instances dbLoadTemplate("db/padGN1.gen102_template") dbLoadRecords("db/iocAdmin.db","IOC=EIOC:IN20:RD03") # autosave/restore settings substr=malloc(500) sprintf(substr,"ACCL:LI21:1:L1S") # what about EIOC:IN20:RD03 PVs? Use Null string to match everything? printf("%s\n",substr) save_restoreSet_status_prefix( substr) save_restoreSet_IncompleteSetsOk(1) save_restoreSet_DatedBackupFiles(1) sprintf(substr,"/data/autosave-req") set_requestfile_path(substr) set_requestfile_path("./") # maybe you do need this set_savefile_path("/data","autosave") ## ============================================== ## New method for autosave and restore ## Decide what is saved by specifying it in the ## EPICS databases ## ============================================= #set_pass0_restoreFile("info_positions.sav") set_pass0_restoreFile("info_settings.sav") set_pass1_restoreFile("info_settings.sav") ## ============================================= ## Load Access Security File ## caPutLog now depends on this running. #asSetFilename("db/mpsLinkNode.acf") # New: pre maps /data to /u1/lcls/epics/ioc/data/ #dbRestore("/data/EIOC-IN20-RD03.sav") autosave replaces this iocInit() # force scalar waveforms to read (once) dbpf("GUN:IN20:1:GN1_0_SCL_WF.PROC","1") dbpf("GUN:IN20:1:GN1_1_SCL_WF.PROC","1") dbpf("GUN:IN20:1:GN1_2_SCL_WF.PROC","1") dbpf("GUN:IN20:1:GN1_3_SCL_WF.PROC","1") dbpf("GUN:IN20:1:GN1_4_OFST","0") dbpf("GUN:IN20:1:GN1_5_OFST","0") dbpf("GUN:IN20:1:GN1_6_OFST","0") dbpf("GUN:IN20:1:GN1_7_OFST","0") dbpf("GUN:IN20:1:GN1_4_SIZE","65536") dbpf("GUN:IN20:1:GN1_5_SIZE","65536") dbpf("GUN:IN20:1:GN1_6_SIZE","65536") dbpf("GUN:IN20:1:GN1_7_SIZE","65536") dbpf("GUN:IN20:1:GN1_0_OFST.PROC","1") dbpf("GUN:IN20:1:GN1_1_OFST.PROC","1") dbpf("GUN:IN20:1:GN1_2_OFST.PROC","1") dbpf("GUN:IN20:1:GN1_3_OFST.PROC","1") dbpf("GUN:IN20:1:GN1_0_SIZE.PROC","1") dbpf("GUN:IN20:1:GN1_1_SIZE.PROC","1") dbpf("GUN:IN20:1:GN1_2_SIZE.PROC","1") dbpf("GUN:IN20:1:GN1_3_SIZE.PROC","1") ## ===================================================== ## Turn on caPutLogging: ## Log values only on change to the iocLogServer: #caPutLogInit("172.27.8.31:7004") #caPutLogShow(2) ## =========================================================== ## Start autosave routines to save our data ## =========================================================== # optional, needed if the IOC takes a very long time to boot. epicsThreadSleep( 1.0) ## Handle autosave 'commands' contained in loaded databases. # change directory to ioc startup area to run makeAutosaveFiles() chdir("/data/autosave-req") iocshCmd("makeAutosaveFiles()") ## Explaining the difference: even though there is only field line added ## to the record, it is used in two ways. First, on pass0, the positions ## are saved at the rate of 5 sec. Why you would want to do this more ## than once escapes me. Second, you save the the settings every 30 sec ## to a file (if they change more freq, the values are kept in RAM !? ## ??? create_monitor_set("info_positions.req", 5, "U=USEG:UND1:150:") # 2/2/2009 deliberately leaving off last argument... create_monitor_set("info_settings.req", 30, "U=") free(substr)