The require function¶
The require function is used in IOC startup scripts to dynamically load EPICS modules
and make their libraries, database definitions, and data files available to the IOC.
Syntax¶
require module
Behavior¶
When require is called, it:
Loads the module’s shared library (
.sofile)Loads the module’s database definition file (
.dbd)Sets up environment variables pointing to the module’s data files (
${<module>_DIR},${<module>_DB})
Examples¶
You can access a module’s data files through its environment variables:
require iocstats
# Load a database from the iocstats module
dbLoadRecords("${iocstats_DB}/iocAdminSoft.db", "IOC=$(IOCNAME)")
Environment information PVs¶
require creates debugging PVs that expose information about loaded modules and components:
$(IOCNAME):Require-Version- require version$(IOCNAME):Require-RtComponents- runtime components (Q-group)$(IOCNAME):Require-LoadedModules- loaded modules (Q-group)
Tip
Set the IOC name using the --iocname flag:
$ iocsh --iocname MY-IOC-01 st.cmd
If not specified, an auto-generated name is used.
See also
Related topics:
An e3 IOC - Creating startup scripts
IOCs and modules - Module concepts
iocshexecutable - Command-line interface