You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
config.xml - improve usage so doesn't conflict with st.cmd [TIMEBOX: 4.5 days] #8445
As a developer I would like the information in the iocBoot config.xml to reflect what really happens in the ioc. Currently the information in config.xml is used by the GUI to define macros, it also has entries like hasDefault="YES" and default="0x0" but these are for information only in the GUI and do not influence, or necessarily correctly reflect, what the IOC actually does. We should have a single source of truth consistent between the IOC and GUI
Acceptance Criteria
Discussion held (virtually or as meeting) to decide on appropriate solution and agreed approach documented
Develop approach to enable default IOC macro values specified in only one place and correctly reflected by IOC and GUI display on new IOCs (as agreed in discussion)
Start applying this to existing IOCs
Create tickets to continue this work
Extra Information
An initial discussion of approach will be needed. There are various potential options e.g.
use existing config.xml as source of truth and add a new IOC command that reads file on IOC startup and creates macros. We already do something similar with configurations - IOC reads XML from disk and creates macros, so necessary XML reading code and an example of how to define a macro from an XML file already exists in IOC.
use existing config.xml as source of truth but at build time this file is parsed by a stand-alone program (e.g. a python script) that generates a default-macros.cmd file with necessary epicsEnvSet commands, this file can then be loaded by the IOC. This will need a new common Makefile build rule adding to automatically rebuild the macros file, but this is reasonable straightforward
(You could also create a new source of truth file and use it to generate config.xml and an IOC loadable file, but as config.xml is in a readily readable format that is not really worth it)
Note that you will not need to edit every IOC to either load default-macros.cmd or run a new command, all iocs already run init.cmd from the iocstartup common directory, so the command can be added to central init.cmd to apply to all IOCs
How to Test
should be a matter of just editing a config.xml for a chosen IOC and then looking at the screen output of the IOC to check macros defined as expected
changed the title [-]config.xml - improve usage so doesn't conflict with st.cmd[/-][+]config.xml - improve usage so doesn't conflict with st.cmd [TIMEBOX: 4.5 days][/+]on Jul 18, 2024
alternatively we could open the file and just use https://www.lua.org/pil/20.1.html to find lines starting with "<macro" and/or "<xi:include" which are the nested XML files in COMMON (which would then need to be opened) as we only care about the name and defaultValue attrs.
i don't like the idea of doing it at build time as much as it makes identifying patches more difficult because the config.xmls generated at build time are presumably not going to be pushed upstream
[2026-02-18 13:52:04.174299] MAJOR: Could not load last configuration. Message was: Element '{http://epics.isis.rl.ac.uk/schema/iocs/1.0}macro', attribute 'useDefault': The attribute 'useDefault' is not allowed., line 5
Activity
[-]config.xml - improve usage so doesn't conflict with st.cmd[/-][+]config.xml - improve usage so doesn't conflict with st.cmd [TIMEBOX: 4.5 days][/+]rerpha commentedon Jul 20, 2024
Can we use a common lua script for this to do the
epicsEnvSets at ioc startup?from a quick play around lua's XML support is not very good (actually it's nonexistent), but it is doable with a library.... we'd probably need to use an external one by doing this: https://epics-modules.github.io/lua/libraries/adding-libraries.html using a lib like https://github.com/manoelcampos/xml2lua
alternatively we could open the file and just use https://www.lua.org/pil/20.1.html to find lines starting with "<macro" and/or "<xi:include" which are the nested XML files in
COMMON(which would then need to be opened) as we only care about thenameanddefaultValueattrs.i don't like the idea of doing it at build time as much as it makes identifying patches more difficult because the config.xmls generated at build time are presumably not going to be pushed upstream
50 remaining items
LowriJenkins commentedon Feb 16, 2026
config.xml's matched actual defaultsTom-Willemsen commentedon Feb 18, 2026
As mentioned in-person:
I suspect https://github.com/ISISComputingGroup/server_common/blob/main/src/server_common/schema/iocs.xsd needs to be updated
We may also need an upgrade step to migrate existing configs - unless it handles that element not existing?