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

Chapter 6: Run IOCs with iocsh.bash

Run an Input/Output Controller (IOC) using installed module support without compiling an application binary. The iocsh.bash loader resolves module dependencies, loads shared libraries and database definition (DBD) files, and starts softIocPVX with your startup configuration.

Complete Chapter 1 first. Lessons 6.2 and 6.3 reuse the simulator scripts, databases, protocols, and fragments created in Chapters 3 and 4.

iocsh.bash loads installed record and device support. Application-specific C or C++ code requires a compiled IOC application as shown in Chapters 2 through 5.

Chapter exercises

  1. In lesson 6.3, add a ch08 scalar mapping for $(P)$(R)CH08.VAL to tc32_group.json. Stop tc32_emulator.bash in terminal 1 with Ctrl+C, enter exit in terminal 2, start ./tc32_emulator.bash --port 9399 again in terminal 1, and restart iocsh.bash st.cmd in terminal 2. Confirm that pvxgl(1, "*") reports Atomic Members:5 and pvxget LOADER:TC32:Summary includes ch08.value.
  2. In lesson 6.4, add a second ao record named $(P)Limit with field(PINI, "YES") and info(autosaveFields, "VAL"). Write a value with caput, wait 6 seconds, restart the IOC, and verify that settings.sav restores both records.
  3. Run iocsh.bash -n on st.cmd from lesson 6.4 and explain why commonIocsh fragments (linStat.iocsh and autosave.iocsh) use iocshLoad rather than module directives.

Before moving on

  • Every iocsh.bash (softIocPVX) session is stopped with exit.
  • Every tcpserver.bash and tc32_emulator.bash process is stopped with Ctrl+C.
  • ss -ltn 'sport = :9399 or sport = :9400 or sport = :9401' reports no active TCP listeners.
  • Temporary scratch directories from lessons 6.1 and 6.5 are removed or noted outside the EPICS distribution tree.