Hi Patrick –
The method that we use at ESS (based on the one at PSI) does handle the necessary build and load steps to deal with the situation that you describe. In short, we build
and package EPICS modules (including sequencer-based applications) in a special way that allows you to have an IOC run using nothing more than a text file as a startup script, something like:
require my_snl_program
# other configuration
seq my_snl_program
iocInit
Since this simply a text file, it would of course be very simple to modify it based on whatever configuration needs you have.
For more documentation, please checkout our documentation here:
http://e3.pages.esss.lu.se/
If you have any questions, feel free to ask.
Cheers,
Simon
From:
Tech-talk <tech-talk-bounces at aps.anl.gov> on behalf of "Johnson, Andrew N. via Tech-talk" <tech-talk at aps.anl.gov>
Reply to: "Johnson, Andrew N." <anj at anl.gov>
Date: Monday, 25 March 2024 at 19:46
To: "Barrett (US), Patrick E" <patrick.e.barrett at boeing.com>, "'jure.varlec at cosylab.com'" <jure.varlec at cosylab.com>, "'tech-talk at aps.anl.gov'" <tech-talk at aps.anl.gov>
Subject: Re: [EXTERNAL] Re: Creating SNL in loadable library
Hi Patrick,
It is possible to build and load SNL programs as loadable plugins, we made that possible using the IOC's dlload command back in 3.15. I believe the PSI and ESS methods
of building and booting IOCs use that, but I haven't tried it for a while and I forget what you have to do to create and load the DBD file that tells the IOC where the SNL code is. Someone from one of those EPICS sites may be able to help.
One other possibility you can consider is to build your SNL into a stand-alone program, so that code runs in a completely separate process from the IOC. That decouples
the two and allows you to start and stop them independently, although you do have to ensure that the SNL code is properly written to handle waiting for all its CA connections at startup, and for the PVs going away and coming back when the IOC comes online
again.
- Andrew
Complexity comes for free, Simplicity you have to work for.
On 3/25/24, 12:13 PM, "Tech-talk" <tech-talk-bounces at aps.anl.gov> wrote:
Hello Jure,
Thanks for your thoughts. It actually have me thinking of ways to change the SNL programs which run based on our configuration. I think I can make that work. The
issue I was trying to get around is it seems the IOC has to be built with knowledge of the SNL programs it can run. That was what I was trying to work around, but if I may be able to build with all of them and just start the ones I need at runtime.
Thanks,
Patrick
From: Jure Varlec <jure.varlec at cosylab.com>
Sent: Monday, March 25, 2024 3:23 AM
To: Barrett (US), Patrick E <patrick.e.barrett at boeing.com>
Subject: [EXTERNAL] Re: Creating SNL in loadable library
|
EXT email: be mindful of links/attachments.
|
|
Hello Patrick,
While I'm sure it's possible to create loadable plugins from SNL code using some clever tricks, are you sure it's necessary? I don't see much difference if you simply add several different programs to the IOC.
In the end, which program runs is a matter of starting it with the seq command. In other words, choosing which SNL program to run
is a matter of configuration by default.
Best,
Jure
On 3/23/24 03:32, Barrett (US), Patrick E via Tech-talk wrote:
|
Caution: This email originated from outside of Cosylab.
|
Hello,
I have an IOC which would load different SNL definitions based on a configuration file. There are some state sets which are the same and some different ones dependent
on the configuration. Has anyone build SNL into libraries which could be dynamically loaded dependent on a configuration, instead of being build into the IOC code directly?
Thanks,
Patrick Barrett