Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Panel
12. What are the guidelines for creating App-specific st.cmd?

Work is still in progress regarding standardizing App-specific st.cmd.

The IOC engineer has freedom to be creative with this script during development.

But the following are expected as a minimum when the ioc is installed in production.

That is the reason they are included in the default template provided by the icdTemplates module, as a guideline:

    1.  Making available several key paths and variables to your ioc by setting the environment variables.
      These were auto-generated during the application 'make' process and stored the 'envPaths' file under your ioc's boot directory.
      st.cmd should set all these variables using 'envPaths'.
      < envPaths
    2. Set the '<TOP>' variable. You could do this via the macro ${IOC_APP} which was defined in 'iocStartup.cmd' as describe before.
      epicsEnvSet(TOP,"${IOC_APP}")
    3. Load Timing-related databases using standard templates.
    4. Load iocAdmin and iocRelease databases using standard templates
    5. Load database for autosave using standard templates and use "makeAutosaveFiles" to autogenerate the PVs to be autoasaved/restored.

While the above is common guideline for all iocs, the following is specific to linuxRT.

You can set up real-time priorities after iocInit() for your driver threads and this can be done with a script such as as  rtPrioritySetup.cmd.

cd ${IOC_BOOT}

system("/bin/su root -c `pwd`/rtPrioritySetup.cmd")

Look at/afs/slac/g/lcls/epics/R3-14-12-4_1-0/iocTop/MyTest/Development/iocBoot/vioc-b34-bd32/ rtPrioritySetup.cmd as an example.

Panel
13. How do I start my ioc and monitor it?

(a) You can directly ssh to your ioc as 'laci' from any LCLSDEV host:

ssh laci@ioc-b34-bd32

$ cd /afs/slac/g/lcls/epics/iocCommon/ioc-b34-bd32

Alternately, you can get a console to the target ioc-b34-bd32 using iocConsole and ssh as user "laci" from there:

iocConsole ioc-b34-bd32

When prompted to enter the "login" username as below, enter "laci".

Welcome to Buildroot

ioc-b34-bd32 login:

No password is needed. Just hit Enter an you will get the shell prompt "$".

 Ensure the caRepeater process is running on this CPU.

(b) Ensure your IOC is not already running as below:

$ screen -ls

No Sockets found in /tmp/uscreens/S-laci. 

You can also look for your application under all running processes and make sure one is not already running:

If it was running already, then you may get something as below:

$ ps -ef | grep MyTest

 2085 laci       0:07 bin/MyTest iocStartup.cmd 

(c) Change to $IOC/ioc-b34-bd32 and from there start your ioc as a foreground process as below: 

$ pwd

/home/laci

$ ls -lt

total 0

lrwxrwxrwx    1 root     lcls            45 Nov  5 15:11 bld -> /afs/slac/g/lcls/epics/iocCommon/ioc-b34-bd32

$ cd bld
Ensure that 'startupConsole-bd32.cmd' is in your current directory.

$ ls -lt | grep startupConsole-bd32.cmd

-rwxrwxr-x    1 8396     1020          1225 Nov  5 15:22 startupConsole-bd32.cmd

Start the ioc as a foreground process:

./startupConsole-bd32.cmd

You can observe the viocb34bd32 go through the boot process.

If you had an EVR230 and it was initialized correctly, you may see something as below before iocInit():

ErConfigure(0, 0, 0, 0, 1)

Try EvrOpen, device = /dev/era3

EVR Found with Firmware Revision 0x11000007

Found a PMC_EVR /dev/era3

Verify if all your drivers, modules and databases loaded correctly.

If you used iocConsole, you can scroll back and forth in the screen using <CTRL> A-[ and <CTRL>-A-]

If everything went well, you must get your interactive ioc shell prompt as below:

vioc-b34-bd32> 

(d) Once the ioc is started, you can interact with vioc-b34-bd32 from any LCLSDEV host via ssh laci@ioc-b34-bd32:

To attach a screen session:

screen  -r  vioc-b34-bd32

To detach from a screen session:

<CTRL> A D

(e) To exit an EPICS IOC Process type exit at the IOC Shell and you will be back at the "$" prompt:

vioc-b34-bd32>exit

If the IOC hangs too long while trying to exit, use <CTRL> C

...