Good Day,
Yes there is a way, and to get around the single use of iocInit() I believe... but I confess I didn't try it out myself yet very much (no use cases specifically came up for me yet), so you may find a couple of sticky issues. Here is what I think would work:
First you need a redundant setup. So you have your current IOC that I'll call A and it has a signal or PV you want to display called Signal1_A. You make nearly identical IOCs B and C that do the same thing, same inputs and outputs and calculations, but using Signal1_B,
and Signal1_C. The only differences being the name to avoid name conflicts on the channel access. Which one do
you display on edm? You make yet another called hmiIOC or masterIOC that will take all three signals (Signal1_A, Signal1_B, Signal1_C)
and determine the most common one. if A=B=C pick A,.... if A=B !=C pick A, if B=C != A pick B.... . That is the signal that gets routed to the display record. You'll need to do something similar for output control too.
You
now have a redundant systems, if IOC A goes down, then B and C still run. Giving you time to reboot or check out IOC A.
Now
you have the redundant system, you probably see you can also update all the records in IOC A to do different things, change ranges, add calculations, remove subroutines, scripts, recompile with an upgraded synapps tool. While B and C still run. Once A is
happy, do B, then C with the same. The interface records between IOC A, B, and C and the masterIOC or hmiIOC needs to be the
same of course.
But
now you are essentially updating your records and IOC on the fly, and seamlessly.
Keep anything you want to change that needs an iocInit() on the IOC A, B, and C side or course. If comparing floating points
in the master you want to avoid the floating point compare problem (to decide which signal, A, B, C is correct you want to use, so use an epsilon. That is not: if A - B = 0 but more: if ABS(A-B) <= EPSILON (= 0.00...001). Also you may have to handle the
link errors somehow.
Note
that there is still a single point of failure on this hmiIOC, but that would only be deciding which signal to pipe to the display record, and would be otherwise only using well known / well tested records - so it should be stable.
So I think this would work, and hopes it helps you get around your iocInit problem.
Cheers
James Larsson
From: Tech-talk <tech-talk-bounces at aps.anl.gov> on behalf of Mostafa, Jalal (IPE) via Tech-talk <tech-talk at aps.anl.gov>
Sent: June 17, 2020 9:25 AM
To: tech-talk at aps.anl.gov <tech-talk at aps.anl.gov>
Subject: EPICS Records at Runtime
Hi all!
We have quite "dynamic" configuration files for EPICS i.e. records can change very often (new records, change in the unit of measurement, ...).
Is there a way to load a new database record
file after `iocInit` without restarting the IOC? or even adding records at runtime?
Best,
Jalal
|