An e3 IOC¶
In e3, there is no IOC application build step. Each IOC runs iocsh, and startup scripts
use require to dynamically load libraries and set up data-file search paths at runtime.
A startup script¶
Tip
The examples below assume you have activated the e3 environment created in the previous section,
with iocstats installed as shown in Getting started.
A minimal startup script:
# st.cmd
require iocstats
Caution
The last line of the file must end in a newline or that line will not be executed.
Run it with:
(e3) $ iocsh st.cmd
Show IOC output
Note
iocInit() is called implicitly. You can skip this with iocsh --no-init. See
iocsh --help for more options.
A slightly more complete example¶
A more realistic startup script might look like:
# st.cmd
require device
require sequencer
epicsEnvSet("P", "Foo")
epicsEnvSet("R", "Bar")
iocshLoad("${device_DIR}init.iocsh", "PREFIX=$(P)-$(R):")
dbLoadRecords("${device_DIR}device.template", "PREFIX=$(P)-$(R):")
afterInit("seq device_control")