...
Tell the IOC where to find the list of record names that and where they will be autosaved.
Besides the auto-generated record names for autosave, copy the manually generated list of records to be autosaved.
Load the PLL EPICS records.
Load the YAML hierarchy and register configuration.
11.5MHz PLL:
Code Block | ||
---|---|---|
| ||
# **** Environment variables for YCPSWASYN ****
# CPSW Port name
epicsEnvSet("CPSW_PORT", "SIM1")
# Yaml File
epicsEnvSet("YAML_FILE", "yaml/Gen1Lcls2PrlMaster_project.yaml/000TopLevel.yaml")
# FPGA IP address
# SIM module for 11.5MHz PLL
epicsEnvSet("FPGA_IP", "192.168.1.17")
# Use Automatic generation of records from the YAML definition
# 0 = No, 1 = Yes
epicsEnvSet("AUTO_GEN", 1)
# Automatically generated record prefix
epicsEnvSet("SIM_PREFIX", "SIM07")
# Dictionary file for manual (empty string if none)
epicsEnvSet("DICT_FILE", "")
# ===========================================
# DRIVER SETUP
# ===========================================
cpswLoadYamlFile("${YAML_FILE}", "NetIODev", "yaml/Gen1Lcls2PrlMaster_project.yaml", "${FPGA_IP}")
cpswLoadConfigFile("yaml/config/sioc-sys0-ms07.yaml", "mmio", "yaml/config")
# ************************************
# **** Driver setup for YCPSWAsyn ****
# YCPSWASYNConfig(
# PORT_NAME, # the name given to this port driver
# ROOT_PATH, # root path to start the generation, if empty, the root will be used
# PREFIX, # record name prefix
# AUTO_GEN_MODE, # 0: disable auto-generation, 1: enable autogeneration using mapped names
# # 2: enable autogeneration using hashed names
# DICIT_FILE # dictionary file path with registers to load, an empty string will disable this function
# )
YCPSWASYNConfig("${CPSW_PORT}","", "${SIM_PREFIX}", "${AUTO_GEN}", "${DICT_FILE}") |
476MHz PLL:
Also, restore previously autosaved values.
Code Block | ||
---|---|---|
| ||
# =====================================================================
# Load database for autosave status
# =====================================================================
dbLoadRecords("db/save_restoreStatus.db", "P=${IOC_NAME}:")
# ============================================================
# If all PVs don't connect continue anyway
# ============================================================
save_restoreSet_IncompleteSetsOk(1)
# ============================================================
# created save/restore backup files with date string
# useful for recovery.
# ============================================================
save_restoreSet_DatedBackupFiles(1)
# ============================================================
# Where to find the list of PVs to save
# ============================================================
set_requestfile_path("${IOC_DATA}/${IOC}/autosave-req")
# ============================================================
# Where to write the save files that will be used to restore
# ============================================================
set_savefile_path("${IOC_DATA}/${IOC}/autosave")
# ============================================================
# Prefix that is use to update save/restore status database
# records
# ============================================================
save_restoreSet_status_prefix("${IOC_NAME}:")
## Restore datasets
set_pass0_restoreFile("info_positions.sav")
set_pass1_restoreFile("info_positions.sav")
set_pass0_restoreFile("info_settings.sav")
set_pass1_restoreFile("info_settings.sav")
|
Besides the auto-generated record names for autosave, copy the manually generated list of records to be autosaved.
Load the PLL EPICS records.
Code Block | ||
---|---|---|
| ||
# **************************************
# PLL for Linac Locking
dbLoadRecords("db/pll_linacLock.db", "P=$(P),SIM_PREFIX=$(SIM_PREFIX)")
|
Load the YAML hierarchy and register configuration.
11.5MHz PLL:
Code Block | ||
---|---|---|
| ||
# **** Environment variables for YCPSWASYN ****
# CPSW Port name
epicsEnvSet("CPSW_PORT", "SIM1")
# Yaml File
epicsEnvSet("YAML_FILE", "yaml/Gen1Lcls2PrlMaster_project.yaml/000TopLevel.yaml")
# FPGA IP address
# SIM module for 11.5MHz PLL
epicsEnvSet("FPGA_IP", "192.168.1.17")
# Use Automatic generation of records from the YAML definition
# 0 = No, 1 = Yes
epicsEnvSet("AUTO_GEN", 1)
# Automatically generated record prefix
epicsEnvSet("SIM_PREFIX", "SIM07")
# Dictionary file for manual (empty string if none)
epicsEnvSet("DICT_FILE", "")
# ===========================================
# DRIVER SETUP
# ===========================================
cpswLoadYamlFile("${YAML_FILE}", "NetIODev", "yaml/Gen1Lcls2PrlMaster_project.yaml", "${FPGA_IP}")
cpswLoadConfigFile("yaml/config/sioc-sys0-ms07.yaml", "mmio", "yaml/config")
# ************************************
# **** Driver setup for YCPSWAsyn ****
# YCPSWASYNConfig(
# PORT_NAME, # the name given to this port driver
# ROOT_PATH, # root path to start the generation, if empty, the root will be used
# PREFIX, # record name prefix
# AUTO_GEN_MODE, # 0: disable auto-generation, 1: enable autogeneration using mapped names
# # 2: enable autogeneration using hashed names
# DICIT_FILE # dictionary file path with registers to load, an empty string will disable this function
# )
YCPSWASYNConfig("${CPSW_PORT}","", "${SIM_PREFIX}", "${AUTO_GEN}", "${DICT_FILE}") |
476MHz PLL:
Code Block | ||
---|---|---|
| ||
# **** Environment variables for YCPSWASYN ****
# CPSW Port name
epicsEnvSet("CPSW_PORT", "SIM1")
# FPGA IP address
# SIM module for 476MHz PLL
epicsEnvSet("FPGA_IP", "192.168.1.18")
# Use Automatic generation of records from the YAML definition
# 0 = No, 1 = Yes
epicsEnvSet("AUTO_GEN", 1)
# Automatically generated record prefix
epicsEnvSet("SIM_PREFIX", "SIM08")
# Dictionary file for manual (empty string if none)
epicsEnvSet("DICT_FILE", "")
# ===========================================
# DRIVER SETUP
# ===========================================
cpswLoadYamlFile("${YAML_FILE}", "NetIODev", "yaml/Gen1Lcls2PrlMaster_project.yaml", "${FPGA_IP}")
cpswLoadConfigFile("yaml/config/sioc-sys0-ms08.yaml", "mmio", "yaml/config")
# ************************************
# **** Driver setup for YCPSWAsyn ****
# YCPSWASYNConfig(
# PORT_NAME, # the name given to this port driver
# ROOT_PATH, # root path to start the generation, if empty, the root will be used
# PREFIX, # record name prefix
# AUTO_GEN_MODE, # 0: disable auto-generation, 1: enable autogeneration using mapped names
# | ||
Code Block | ||
| ||
# **** Environment variables for YCPSWASYN **** # CPSW Port name epicsEnvSet("CPSW_PORT", "SIM1") # FPGA IP address # SIM module for 476MHz PLL epicsEnvSet("FPGA_IP", "192.168.1.18") # Use Automatic generation of records from the YAML definition # 0 = No, 1 = Yes epicsEnvSet("AUTO_GEN", 1) # Automatically generated record prefix epicsEnvSet("SIM_PREFIX", "SIM08") # Dictionary file for manual (empty string if none) epicsEnvSet("DICT_FILE", "") # =========================================== # DRIVER SETUP # =========================================== cpswLoadYamlFile("${YAML_FILE}", "NetIODev", "yaml/Gen1Lcls2PrlMaster_project.yaml", "${FPGA_IP}") cpswLoadConfigFile("yaml/config/sioc-sys0-ms08.yaml", "mmio", "yaml/config") # ************************************ # **** Driver setup for YCPSWAsyn **** # YCPSWASYNConfig( # PORT_NAME, # the2: nameenable givenautogeneration tousing thishashed port drivernames # ROOT_PATH, # root path to start the generation, if empty, the root will be used # PREFIX, # record name prefix # AUTO_GEN_MODE, # 0: disable auto-generation, 1: enable autogeneration using mapped names # # 2: enable autogeneration using hashed names # DICIT_FILE # dictionary file path with registers to load, an empty string will disable this function # ) YCPSWASYNConfig("${CPSW_PORT}","", "${SIM_PREFIX}", "${AUTO_GEN}", "${DICT_FILE}") |
A complete list of the records to archive is provided below.
...
DICIT_FILE # dictionary file path with registers to load, an empty string will disable this function
# )
YCPSWASYNConfig("${CPSW_PORT}","", "${SIM_PREFIX}", "${AUTO_GEN}", "${DICT_FILE}") |
A complete list of the records to archive is provided below.
Initialize the IOC and logging capability.
Code Block | ||
---|---|---|
| ||
# ===========================================
# IOC INIT
# ===========================================
iocInit()
# ===========================================
# CAPUTLOG
# ===========================================
# Turn on caPutLogging:
# Log values only on change to the iocLogServer:
caPutLogInit("${EPICS_CA_PUT_LOG_ADDR}")
caPutLogShow(2)
|
Start the autosave process.
...