Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

4.6 IOC startup sequence

A compiled IOC combines its executable, linked support libraries, and runtime configuration. The startup file joins these parts in an order that lets records find their device support.

Files and runtime responsibilities

ComponentProvides
bin/linux-x86_64/jeonglee_DemoIOC program linked to the selected support
dbd/jeonglee_Demo.dbdRecord types, devices, drivers, and registrars
db/Record instances, templates, substitutions, and protocols
iocsh/Installed reusable configuration fragments
iocBoot/Startup commands and generated envPaths

configure/RELEASE selects build dependencies. The generated envPaths sets their runtime paths and the application’s TOP.

The startup in lesson 4.5 follows this order:

  1. Read envPaths and define paths and macros.
  2. Load the application DBD and call its support registration function.
  3. Configure the asyn port and its newline terminators.
  4. Load database records with their prefix and port macros.
  5. Call iocInit() once.
  6. Run diagnostics such as dbl.

A DBD defines available types and support; it does not instantiate PVs. dbLoadRecords creates record instances, and iocInit() initializes those records and starts database scanning and servers. The IOC becomes ready for clients when it prints iocRun: All initialization complete.

Drivers can create resources or connect to devices during configuration. Do not interpret the pre-initialization phase as a guarantee that no threads or device communication exist.

Initialization and diagnostics

iocInit() runs iocBuild() followed by iocRun() when the build phase succeeds. The first phase prepares records and scanning; the second enables database scanning and registered servers. The initialization reference lists the Base sequence.

dbl lists loaded records even before initialization. Its output alone does not prove that record processing or network access works. Client reads and changing simulator values provide that evidence.

To inspect linked libraries, run this from the application root:

ldd bin/linux-x86_64/jeonglee_Demo

With the Chapter 3 support enabled, the list includes libasyn, libstream, libcalc, libpvxs, and EPICS Base libraries. Every required library must resolve to a file; not found indicates a missing runtime dependency. Paths and memory addresses vary between hosts.