## PAD RTEMS startup script for Laser PAD in RF Hut PADLAN9118_LSR app ## Set common environment variables #< /boot/lcls/epics/iocCommon/All/Prod/pre_st.cmd should be done by calling script epicsEnvSet("EPICS_CA_MAX_ARRAY_BYTES","1000000") # Setup for generic piece setenv("IPADDR1","172.27.206.11",1) setenv("NETMASK1","255.255.255.0",1) setenv("PADSLOT","1",1) # Must match llrf*.*_substitutions 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/padLan9118LsrApp.obj") lsmod() dbLoadDatabase("dbd/pad4App.dbd") pad4App_registerRecordDeviceDriver(pdbbase) drvPadScalFlag=4 drvPadLan9118DacqFlag=2 ## Load record instances dbLoadTemplate("db/padLSR.lsr_template") dbLoadRecords("db/iocAdmin.db","IOC=EIOC:IN20:RD02") # autosave/restore settings substr=malloc(500) sprintf(substr,"LASR:IN20:1:LSR") # what about EIOC:IN20:RD02 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-RD02.sav") autosave replaces this iocInit() # force scalar waveforms to read (once) dbpf("LASR:IN20:1:LSR_0_SCL_WF.PROC","1") dbpf("LASR:IN20:1:LSR_1_SCL_WF.PROC","1") dbpf("LASR:IN20:1:LSR_2_SLI_WF.PROC","1") dbpf("LASR:IN20:1:LSR_2_SLQ_WF.PROC","1") dbpf("LASR:IN20:1:LSR_3_SLI_WF.PROC","1") dbpf("LASR:IN20:1:LSR_3_SLQ_WF.PROC","1") dbpf("LASR:IN20:1:LSR_4_OFST","0") dbpf("LASR:IN20:1:LSR_5_OFST","0") dbpf("LASR:IN20:1:LSR_6_OFST","0") dbpf("LASR:IN20:1:LSR_7_OFST","0") dbpf("LASR:IN20:1:LSR_4_SIZE","65536") dbpf("LASR:IN20:1:LSR_5_SIZE","65536") dbpf("LASR:IN20:1:LSR_6_SIZE","65536") dbpf("LASR:IN20:1:LSR_7_SIZE","65536") dbpf("LASR:IN20:1:LSR_0_OFST.PROC","1") dbpf("LASR:IN20:1:LSR_1_OFST.PROC","1") dbpf("LASR:IN20:1:LSR_2_OFST.PROC","1") dbpf("LASR:IN20:1:LSR_3_OFST.PROC","1") dbpf("LASR:IN20:1:LSR_0_SIZE.PROC","1") dbpf("LASR:IN20:1:LSR_1_SIZE.PROC","1") dbpf("LASR:IN20:1:LSR_2_SIZE.PROC","1") dbpf("LASR:IN20:1:LSR_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)