# $Source: /cvs/A/CS/startup/startup.script_common,v $ # This is the common part of all startup scripts # It is included by all generated scripts # The following variables should be set before: # * IOC the system name of the ioc # * INSTBASE where to boot from # * EPICS the epics release (e.g "R3.13.9") # * ARCH the vxWorks architecture (e.g. "T1-ppc604") # do the NFS mounts < ../../startup/network # find a better way later to know current require version REQUIRE_VERSION="2.1.7" STRINGBUFFER=malloc(256) sprintf STRINGBUFFER, "IOC=%s", IOC putenv STRINGBUFFER # set the prompt sprintf STRINGBUFFER, "%s (startup.script aborted) > ", IOC shellPromptSet STRINGBUFFER BOOTPC=&sysBootHost # setup logging on boot PC sprintf STRINGBUFFER, "EPICS_IOC_LOG_INET=%s", BOOTPC putenv STRINGBUFFER putenv "EPICS_IOC_LOG_PORT=6500" # create some path variables HOME=malloc(80) sprintf HOME, "/ioc/%s", IOC cd HOME CFG=malloc(80) sprintf CFG, "%s/cfg", HOME STREAM_PROTOCOL_DIR=malloc(80) sprintf STREAM_PROTOCOL_DIR, "%s/cfg", HOME LIB=malloc(80) sprintf LIB, "%s/iocBoot/%s/%s", INSTBASE, EPICS, ARCH EPICS_MODULES = "/work/iocBoot/modules" DBD=malloc(80) sprintf DBD, "dbd:%s/iocBoot/%s/dbd", INSTBASE, EPICS sprintf STRINGBUFFER, "EPICS_DRIVER_PATH=.:bin:snl:%s:%s", EPICS_MODULES, LIB putenv STRINGBUFFER TEMPLATES=malloc(80) sprintf TEMPLATES, ".:%s/iocBoot/templates", INSTBASE # time server (must be set before any drivers are configured) putenv "EPICS_TS_NTP_INET=129.129.190.1" # Release memory above 32 MB # Code loaded after this must be compiled with -mlongcall # at the moment snp24 does not work with this #memAddToPool (sysMemTop(),sysPhysMemTop()-sysMemTop()) #EXTENDED_MEMORY=0 EXTENDED_MEMORY=sysPhysMemTop()-sysMemTop() # load EPICS system core (different names for 3.13 and 3.14) sprintf STRINGBUFFER, "%s/iocCore%s", LIB, strncmp(EPICS,"R3.13",5) ? "Library.munch" : "" ld 0, 0, STRINGBUFFER # TIMEZONE must be set after iocCoreLibrary.munch and before iocInit # 2016: putenv "TIMEZONE=MET::-60:032702:103003" putenv "EPICS_TS_MIN_WEST=-60" # try for user-defined menus scan and convert dbLoadDatabase "dbd/scan.dbd" dbLoadDatabase "dbd/convert.dbd" dbLoadDatabase "dbd/slsConvert.dbd" taskDelay sysClkRateGet() # load "require" sprintf STRINGBUFFER, "require_VERSION=%s", getenv("require_VERSION") ? getenv("require_VERSION") : REQUIRE_VERSION putenv STRINGBUFFER sprintf STRINGBUFFER, "require_DIR=%s/require/%s/%s/", EPICS_MODULES, getenv("require_VERSION"), EPICS putenv STRINGBUFFER sprintf STRINGBUFFER, "%s/lib/%s/requireLib.munch", getenv("require_DIR"), ARCH ld 0, 0, STRINGBUFFER #load standard drivers (allow user to specify version in environment variable) require "base", getenv("base_VERSION") registerModule "require", getenv("require_VERSION"), getenv("require_DIR") require "utilities", getenv("utilities_VERSION") require "misc", getenv("misc_VERSION") require "seq", getenv("seq_VERSION") require "iocmon", getenv("iocmon_VERSION") AUTOSRHOST=BOOTPC # run EPICS only on 1st network port putenv "EPICS_CA_AUTO_ADDR_LIST=NO" putenv bootInfo("EPICS_CA_ADDR_LIST=%B") putenv bootInfo("EPICS_CAS_INTF_ADDR_LIST=%e") putenv "EPICS_CAS_AUTO_BEACON_ADDR_LIST=NO" putenv bootInfo("EPICS_CAS_BEACON_ADDR_LIST=%B") # insert boot infos into database bootNotify INSTBASE, "sls/bin/iocBootNotify.sh" # end of startup.script_common