188 lines
9.3 KiB
Plaintext
188 lines
9.3 KiB
Plaintext
# This is the common part of all vxWorks startup scripts
|
|
# It is included by all generated scripts
|
|
|
|
# The following variables should be set before:
|
|
# EPICS the epics release (e.g "R3.14.12")
|
|
|
|
EPICS_MODULES = "/ioc/modules"
|
|
|
|
# Find a better way later to know current require version
|
|
REQUIRE_VERSION="3.3.1"
|
|
|
|
# autoSR location
|
|
putenv "SRBASE=/ioc/data"
|
|
|
|
# Create some path variables
|
|
sprintf STRINGBUFFER, "EPICS_DRIVER_PATH=.:bin/%s_%s:bin:snl:../bin:%s", EPICS, EPICS_HOST_ARCH, EPICS_MODULES
|
|
putenv STRINGBUFFER
|
|
|
|
sprintf STRINGBUFFER, "FFT_WISDOM_DIR=/ioc/data/%s", IOC
|
|
putenv STRINGBUFFER
|
|
|
|
STREAM_PROTOCOL_DIR=malloc(80)
|
|
sprintf STREAM_PROTOCOL_DIR, "%s/cfg", HOME
|
|
|
|
# Release memory above 32 MB
|
|
# Code loaded after this must be compiled with -mlongcall
|
|
# at the moment snp24 does not work with this
|
|
# Don't use with VxWorks 6 because of EDR memory region!
|
|
EXTENDED_MEMORY=VX6?0:sysPhysMemTop()-sysMemTop()
|
|
memAddToPool sysMemTop(),EXTENDED_MEMORY
|
|
EXTENDED_MEMORY=0
|
|
|
|
# Need to branch a few times on EPICS base release
|
|
R3_13 = strncmp(EPICS,"R3.13.",6)==0
|
|
R3_14 = strncmp(EPICS,"R3.14.",6)==0
|
|
R3_14_8 = strcmp(EPICS,"R3.14.8")==0
|
|
R3_15 = strncmp(EPICS,"R3.15.",6)==0
|
|
R3_16 = strncmp(EPICS,"R3.16.",6)==0
|
|
R3 = strncmp(EPICS,"R3.",3)==0
|
|
R7 = strncmp(EPICS,"R7.",3)==0
|
|
|
|
# Load PVA only on vxWorks 6 with more than 32 MB RAM
|
|
PVA = R7 && VX6 && (PVA||(sysPhysMemTop()&0xfc000000)) && !getenv("NOPVA")
|
|
|
|
# Time server (must be set before loading iocCoreLibrary.munch for 3.14.12)
|
|
# Need EPICS_TS_FORCE_NTPTIME for 7.0
|
|
putenv "EPICS_TS_NTP_INET=129.129.190.1"
|
|
putenv "EPICS_TS_FORCE_NTPTIME=YES"
|
|
|
|
# Load EPICS system core (different names for different EPICS versions)
|
|
# 3.13: "iocCore"
|
|
# 3.14+: "softIoc.munch"
|
|
EPICS_APP = R3_13 ? "iocCore" : PVA ? "softIocPVA.munch" : "softIoc.munch"
|
|
sprintf STRINGBUFFER, "/epics/base-%s/bin/%s/%s", EPICS+1, EPICS_HOST_ARCH, EPICS_APP
|
|
printf "loading %s\n",STRINGBUFFER
|
|
ld 0, 0, STRINGBUFFER
|
|
|
|
# Setup Time (must be set after loading iocCoreLibrary.munch)
|
|
# 2023:
|
|
putenv "EPICS_TIMEZONE=MET::-60:032602:102903"
|
|
putenv "TIMEZONE=MET::-60:032602:102903"
|
|
putenv "EPICS_TS_MIN_WEST=-60"
|
|
|
|
# Allow backward compatible non-monotonic breaktables
|
|
dbBptNotMonotonic=1
|
|
|
|
# Start Logging
|
|
putenv getenv("EPICS_IOC_LOG_INET") ? "" : "EPICS_IOC_LOG_INET=gfa-syslog"
|
|
putenv getenv("EPICS_IOC_LOG_PORT") ? "" : "EPICS_IOC_LOG_PORT=1514"
|
|
#sprintf STRINGBUFFER, R3_13||R3_14_8 ? "putenv \"EPICS_CA_PUT_LOG_PREFIX=%s\"" : "iocLogPrefix \"%s \"", IOC
|
|
sprintf STRINGBUFFER, "putenv \"EPICS_CA_PUT_LOG_PREFIX=%s\"", IOC
|
|
execute STRINGBUFFER
|
|
iocLogInit
|
|
errlogPrintf "Starting EPICS %s\n", EPICS
|
|
|
|
sprintf STRINGBUFFER, R3_13 ? ";" : "dbLoadDatabase \"/epics/base-%s/dbd/softIoc%s.dbd\"", EPICS+1, PVA ? "PVA" : ""
|
|
execute STRINGBUFFER
|
|
|
|
sprintf STRINGBUFFER, R3_13 ? ";" : "softIoc%s_registerRecordDeviceDriver pdbbase", PVA ? "PVA" : ""
|
|
execute STRINGBUFFER
|
|
|
|
# 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"), EPICS_HOST_ARCH
|
|
ld 0, 0, STRINGBUFFER
|
|
|
|
#load standard drivers (allow user to specify version in environment variable)
|
|
require "base", getenv("base_VERSION") ? getenv("base_VERSION") : R3_13 ? "ifexists" : "none"
|
|
|
|
registerModule "require", getenv("require_VERSION"), getenv("require_DIR")
|
|
sprintf STRINGBUFFER, R3_13 ? ";" : "require_registerRecordDeviceDriver pdbbase"
|
|
execute STRINGBUFFER
|
|
require "utilities", getenv("utilities_VERSION")
|
|
require "misc", getenv("misc_VERSION")
|
|
|
|
# caPutLog
|
|
require "caPutLog", getenv("caPutLog_VERSION") ? getenv("caPutLog_VERSION") : "ifexists"
|
|
|
|
# EPICS 3.13 needs this to not use synchronized timestamps
|
|
sprintf STRINGBUFFER, R3_13 ? "TSconfigure(0,10,10,18323,18322,250,1)" : ";"
|
|
execute STRINGBUFFER
|
|
|
|
# Run Channel Access only on 1st network port
|
|
putenv bootInfo("EPICS_CAS_INTF_ADDR_LIST=%e")
|
|
|
|
# Set up CA search lists for different networks
|
|
IP_ADDR=bootInfo("%e")
|
|
|
|
# Office (only official EPICS subnets, not SLS beamlines!)
|
|
ifEnvSet IP_ADDR, "~129.129.130.*", "EPICS_CA_ADDR_LIST", "129.129.131.255 129.129.137.255"
|
|
ifEnvSet IP_ADDR, "~129.129.131.*", "EPICS_CA_ADDR_LIST", "129.129.130.255 129.129.137.255"
|
|
ifEnvSet IP_ADDR, "~129.129.137.*", "EPICS_CA_ADDR_LIST", "129.129.130.255 129.129.131.255"
|
|
|
|
# SLS machine network
|
|
# Some tricks needed because VxWorks 5 command line has max 128 chars, VxWorks 6 has 256 chars.
|
|
# Does not work for EPICS 3.13 because EPICS_CAS_SERVER_PORT is not recognized
|
|
# Thus, 3.13 machine IOCs cannot connect to beamline PVs through gateways
|
|
SLS_CAGW1 = "129.129.98.10 129.129.99.11 129.129.102.10 129.129.101.10 129.129.105.10 129.129.104.10 129.129.107.10"
|
|
SLS_CAGW2 = "129.129.106.10 129.129.110.10 129.129.126.10 129.129.109.10 129.129.113.10 129.129.112.10 129.129.117.10"
|
|
SLS_CAGW3 = "129.129.116.10 129.129.119.10 129.129.118.10 129.129.121.10 129.129.122.10 172.21.110.26"
|
|
SLS_ADDR_LIST = malloc(400)
|
|
SLS_BEACON_ADDR_LIST = malloc(400)
|
|
sprintf SLS_ADDR_LIST, "172.20.255.255:5064 %s %s %s 129.129.130.36:5064", SLS_CAGW1, SLS_CAGW2, SLS_CAGW3
|
|
sprintf SLS_BEACON_ADDR_LIST, "172.20.255.255:5065 %s %s %s 129.129.130.36:5065", SLS_CAGW1, SLS_CAGW2, SLS_CAGW3
|
|
ifEnvSet IP_ADDR, R3_13?"":"~172.20.*", "EPICS_CA_AUTO_ADDR_LIST", "NO"
|
|
ifEnvSet IP_ADDR, R3_13?"":"~172.20.*", "EPICS_CA_SERVER_PORT", "5062"
|
|
ifEnvSet IP_ADDR, R3_13?"":"~172.20.*", "EPICS_CAS_SERVER_PORT", "5064"
|
|
ifEnvSet IP_ADDR, R3_13?"":"~172.20.*", "EPICS_CA_ADDR_LIST", SLS_ADDR_LIST
|
|
|
|
# I am getting erros from V69 IOCs about the beacons...
|
|
ifEnvSet IP_ADDR, R3_13?"":"~172.20.*", "EPICS_CAS_AUTO_BEACON_ADDR_LIST","YES"
|
|
#ifEnvSet IP_ADDR, R3_13?"":"~172.20.*", "EPICS_CAS_AUTO_BEACON_ADDR_LIST", "NO"
|
|
#ifEnvSet IP_ADDR, R3_13?"":"~172.20.*", "EPICS_CAS_BEACON_PORT", "5063"
|
|
#ifEnvSet IP_ADDR, R3_13?"":"~172.20.*", "EPICS_CAS_BEACON_ADDR_LIST", SLS_BEACON_ADDR_LIST
|
|
|
|
# SLS beamlines
|
|
ifEnvSet IP_ADDR, "~129.129.98.*", "EPICS_CA_ADDR_LIST", "172.20.3.11:5800"
|
|
ifEnvSet IP_ADDR, "~129.129.98.*", "EPICS_CAS_BEACON_ADDR_LIST", "172.20.3.11:5801"
|
|
ifEnvSet IP_ADDR, "~129.129.99.*", "EPICS_CA_ADDR_LIST", "172.20.3.11:5802"
|
|
ifEnvSet IP_ADDR, "~129.129.99.*", "EPICS_CAS_BEACON_ADDR_LIST", "172.20.3.11:5803"
|
|
ifEnvSet IP_ADDR, "~129.129.102.*", "EPICS_CA_ADDR_LIST", "172.20.3.11:5804"
|
|
ifEnvSet IP_ADDR, "~129.129.102.*", "EPICS_CAS_BEACON_ADDR_LIST", "172.20.3.11:5805"
|
|
ifEnvSet IP_ADDR, "~129.129.101.*", "EPICS_CA_ADDR_LIST", "172.20.3.11:5806"
|
|
ifEnvSet IP_ADDR, "~129.129.101.*", "EPICS_CAS_BEACON_ADDR_LIST", "172.20.3.11:5807"
|
|
ifEnvSet IP_ADDR, "~129.129.105.*", "EPICS_CA_ADDR_LIST", "172.20.3.11:5808"
|
|
ifEnvSet IP_ADDR, "~129.129.105.*", "EPICS_CAS_BEACON_ADDR_LIST", "172.20.3.11:5809"
|
|
ifEnvSet IP_ADDR, "~129.129.104.*", "EPICS_CA_ADDR_LIST", "172.20.3.11:5810"
|
|
ifEnvSet IP_ADDR, "~129.129.104.*", "EPICS_CAS_BEACON_ADDR_LIST", "172.20.3.11:5811"
|
|
ifEnvSet IP_ADDR, "~129.129.107.*", "EPICS_CA_ADDR_LIST", "172.20.3.11:5812"
|
|
ifEnvSet IP_ADDR, "~129.129.107.*", "EPICS_CAS_BEACON_ADDR_LIST", "172.20.3.11:5813"
|
|
ifEnvSet IP_ADDR, "~129.129.106.*", "EPICS_CA_ADDR_LIST", "172.20.3.11:5814"
|
|
ifEnvSet IP_ADDR, "~129.129.106.*", "EPICS_CAS_BEACON_ADDR_LIST", "172.20.3.11:5815"
|
|
ifEnvSet IP_ADDR, "~129.129.110.*", "EPICS_CA_ADDR_LIST", "172.20.3.11:5816"
|
|
ifEnvSet IP_ADDR, "~129.129.110.*", "EPICS_CAS_BEACON_ADDR_LIST", "172.20.3.11:5817"
|
|
ifEnvSet IP_ADDR, "~129.129.126.*", "EPICS_CA_ADDR_LIST", "172.20.3.11:5818"
|
|
ifEnvSet IP_ADDR, "~129.129.126.*", "EPICS_CAS_BEACON_ADDR_LIST", "172.20.3.11:5818"
|
|
ifEnvSet IP_ADDR, "~129.129.109.*", "EPICS_CA_ADDR_LIST", "172.20.3.11:5820"
|
|
ifEnvSet IP_ADDR, "~129.129.109.*", "EPICS_CAS_BEACON_ADDR_LIST", "172.20.3.11:5821"
|
|
ifEnvSet IP_ADDR, "~129.129.113.*", "EPICS_CA_ADDR_LIST", "172.20.3.11:5822"
|
|
ifEnvSet IP_ADDR, "~129.129.113.*", "EPICS_CAS_BEACON_ADDR_LIST", "172.20.3.11:5823"
|
|
ifEnvSet IP_ADDR, "~129.129.112.*", "EPICS_CA_ADDR_LIST", "172.20.3.11:5824"
|
|
ifEnvSet IP_ADDR, "~129.129.112.*", "EPICS_CAS_BEACON_ADDR_LIST", "172.20.3.11:5825"
|
|
ifEnvSet IP_ADDR, "~129.129.117.*", "EPICS_CA_ADDR_LIST", "172.20.3.11:5826"
|
|
ifEnvSet IP_ADDR, "~129.129.117.*", "EPICS_CAS_BEACON_ADDR_LIST", "172.20.3.11:5827"
|
|
ifEnvSet IP_ADDR, "~129.129.116.*", "EPICS_CA_ADDR_LIST", "172.20.3.11:5828 172.20.3.11:5062"
|
|
ifEnvSet IP_ADDR, "~129.129.116.*", "EPICS_CAS_BEACON_ADDR_LIST", "172.20.3.11:5829 172.20.3.11:5063"
|
|
ifEnvSet IP_ADDR, "~129.129.119.*", "EPICS_CA_ADDR_LIST", "172.20.3.11:5830"
|
|
ifEnvSet IP_ADDR, "~129.129.119.*", "EPICS_CAS_BEACON_ADDR_LIST", "172.20.3.11:5831"
|
|
ifEnvSet IP_ADDR, "~129.129.118.*", "EPICS_CA_ADDR_LIST", "172.20.3.11:5832"
|
|
ifEnvSet IP_ADDR, "~129.129.118.*", "EPICS_CAS_BEACON_ADDR_LIST", "172.20.3.11:5833"
|
|
ifEnvSet IP_ADDR, "~129.129.121.*", "EPICS_CA_ADDR_LIST", "172.20.3.11:5834"
|
|
ifEnvSet IP_ADDR, "~129.129.121.*", "EPICS_CAS_BEACON_ADDR_LIST", "172.20.3.11:5835"
|
|
ifEnvSet IP_ADDR, "~129.129.122.*", "EPICS_CA_ADDR_LIST", "172.20.3.11:5836"
|
|
ifEnvSet IP_ADDR, "~129.129.122.*", "EPICS_CAS_BEACON_ADDR_LIST", "172.20.3.11:5837"
|
|
|
|
# HIPA
|
|
ifEnvSet IP_ADDR, "~172.19.*", "EPICS_CA_ADDR_LIST", "172.19.10.255 172.19.30.255 172.19.32.255"
|
|
ifEnvSet IP_ADDR, "~172.19.*", "EPICS_CA_AUTO_ADDR_LIST", "NO"
|
|
|
|
# PROSCAN
|
|
ifEnvSet IP_ADDR, "~172.25.*", "EPICS_CA_ADDR_LIST", "172.25.60.255 172.25.11.255"
|
|
ifEnvSet IP_ADDR, "~172.25.*", "EPICS_CA_AUTO_ADDR_LIST", "NO"
|
|
|
|
# End of startup.script_common
|