The iocsh executable¶
The iocsh executable is the entry point for starting EPICS IOCs in e3. It wraps the EPICS
softIocPVX executable and provides convenient options for loading modules and executing commands.
Description¶
iocsh starts an EPICS IOC shell (based on softIocPVX) with support for dynamic module loading
via require. It can execute a startup script, load modules directly from the command line,
and perform automatic initialization.
The IOC shell is an interactive command environment where you can:
Load and configure EPICS modules
Create and load database records
Set environment variables
Execute IOC shell commands
Initialize and run the IOC
Options¶
$ iocsh --help
usage: IOC shell for e3 [-h] [-V] [-r MODULE] [-c COMMAND] [-d DATABASE]
[--debugger [{gdb,lldb,valgrind}]]
[--debugger-args DEBUGGER_ARGS] [--debug] [-i]
[--iocname IOCNAME]
[file]
ESS EPICS environment (e3) wrapper for softIocPVA
positional arguments:
file Path to startup script
options:
-h, --help show this help message and exit
-V, --version Print version and exit
-r, --require MODULE Load module(s), optionally with version using the
syntax `module,version`
-c, --command COMMAND
Execute command(s)
-d, --database DATABASE
Load database file(s) (`dbLoadRecords`)
--debugger [{gdb,lldb,valgrind}]
Run with selected debugger. To pass arguments, use
--debuger-args "args"
--debugger-args DEBUGGER_ARGS
Arguments to pass to debugger
--debug
-i, --no-init
--iocname IOCNAME IOC name (generates fallback if not set)
Examples¶
Start interactive shell¶
$ iocsh
Run a startup script¶
$ iocsh st.cmd
Load modules from command line¶
$ iocsh -r iocstats -r asyn
Quick testing with commands¶
$ iocsh -r iocstats -c 'dbpr "*", 1'
Run under debugger¶
$ iocsh --debugger gdb st.cmd
How it works¶
Internally, iocsh:
Creates a temporary startup script combining all command-line options
Automatically loads the
requiremoduleProcesses
-r,-c, and-doptions in orderAppends
iocInitunless--no-initis specified oriocInitis already in the scriptExecutes
softIocPVXwith the temporary script
See also
Related topics:
An e3 IOC - Creating startup scripts
requirefunction - Loading modules in scriptsEnvironments - Setting up e3 environments