Hi Andrew W.:
If you do not want to hack “streamReload”, you may try this:
https://github.com/NSLS-II/elauncher
It is an EPICS device support for easy script launcher: one can run a Python (or shell, or anything you can use in a Linux terminal) script inside an IOC through a bo record. Michael Davidsaver developed it at NSLS-II a few years ago, specifically
for use cases like yours.
You can change how fast you want to execute your script by simply changing the field of SCAN either from a command caput or from a CS-Studio button:
caput elauncherTestShell.SCAN 3
caput elauncherTestShell.SCAN Passive
caget -d GR_ENUM elauncherTestShell.SCAN
elauncherTestShell.SCAN
Native data type: DBF_ENUM
Request type: DBR_GR_ENUM
Element count: 1
Value: 1 second
Status: NO_ALARM
Severity: NO_ALARM
Enums: (10)
[ 0] Passive
[ 1] Event
[ 2] I/O Intr
[ 3] 10 second
[ 4] 5 second
[ 5] 2 second
[ 6] 1 second
[ 7] .5 second
[ 8] .2 second
[ 9] .1 second
Cheers,
Yong
From: Tech-talk <tech-talk-bounces at aps.anl.gov> on behalf of "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov>
Reply-To: Ralph Lange <ralph.lange at gmx.de>
Date: Thursday, October 14, 2021 at 4:56 AM
To: "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov>
Subject: Re: Periodically calling shell functions in an IOC
I have a question regarding the use of shell functions with in the IOC shell. There is a shell function from StreamDevice called streamReload that I am interested in using periodically
like every 30 seconds. What is the preferred method, if there are any, for doing so? Also, is there a potential way for calling that shell function within the SNL sequencer?
This is unusual as operating mode. The reload function is intended for development / rapid prototyping (testing a protocol change without rebooting the IOC).
So - please be careful with respect to possible side effects: What happens if the protocol file gets corrupted, a typo is being introduced, the disk (or nfs) is down etc. How do you detect such a situation? How do you fix it?