The Cexp module registers cexpsh with iocsh so that it may be called from the latter:
For more information on Cexp interactive shell, look here:What is Cexp?
(1) From EPICS iocsh, invoke this interactive shell with the command cexpsh() as shown below:
vioc-b34-bd32>cexpsh()
Type 'cexpsh.help()' for help (no quotes)
(2) cexpsh>cexpsh.help()
int cexpsh (char* cmdline)
A few Cexp builtin routines are:
lkup - lookup a symbol
lkaddr - find the address closest to a symbol
cexpModuleLoad - load an object file
cexpModuleName - return a module name given its handle
cexpModuleFindByName - find a module given its name
cexpModuleInfo - dump info about one or all modules
cexpDisassemble - disassemble memory
cexpsh("scriptfile") - run cexp recursively - e.g. for evaluating a script
Use 'symbol.help(level)' for getting info about a symbol:
lkup.help(1)
Type a C expression, e.g.
printf("hello %s\n","cruelworld" + 5)
(3) Terminate Cexp shell by typing '<CTRL>-D'.
(4) One can also supply arguments in which case cexpsh() returns to iocsh immediately after executing:
vioc-b34-bd32>cexpsh("-c",'printf("hello\n")')
hello
0x00000006 (6)
(5) Here's a practical use of cexpsh() that initializes an EVR in st.cmd before iocInit():
# PCIe-based EVR (EVR300) - For Industrial PCs
ErConfigure(0, 0, 0, 0, 4)
Try EvrOpen, device = /dev/era3
ErConfigure@515(EvrOpen): No such file or directory.
Try EvrOpen, device = /dev/er3a3
EVR Found with Firmware Revision 0x17000005
Found a PCIE_EVR /dev/era3
# Add evrInitialize (after ErConfigure) if a fiducial routine will be registered before iocInit driver initialization:
cexpsh("-c",'evrInitialize()')
CPU Clock Estimation: 2700.077907 MHz
0x00000000 (0)
# ======= EVR Setup Complete ============================================