EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  <2025 Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  <2025
<== Date ==> <== Thread ==>

Subject: Enable or select records
From: "Dr. Simon Friederich via Tech-talk" <tech-talk at aps.anl.gov>
To: "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov>
Date: Mon, 26 May 2025 22:26:46 +0200

Dear EPICS community,

I have a self-build device that consists of 11 slots.
Each slot can be populated with one of 5 different types of modules (power, remote, reset, input and output).
The remote module of this device allows me to retrieve all information, e.g. which kind of module was installed at which slot position.

Example communication for output module:

>slot 10
Answer (array with 26 floats): 1 4 1 1 1 1 1 1 1 1 1 1 1 1 10.3 21 10.4 21.2 5.3 21.4 10.5 21 10.4 20.9 10.4 20.9

So far I have a "controller.db" managing all global device records.

I am currently working on a "slot.db" database where I wanted to retrieve and control all different types of modules in one file.
This would allow me to change modules (or have more devices with different slot configuration) without changing the dbLoadTemplate or dbLoadRecords commands.

For this I need to select and enable certain records based on the type of module.

I have a calc record mapping numbers 0=input,1=output,2=power,3=remote 4=reset and 5=unkown to the modules (the device itself uses 1,4,252,253,254 and 255, hence the _calc_type; 4CH Unit = input):

record(calc, "$(P)$(R)slot$(SLOT):_calc_type") {
    # map 0,1,2,3,4,5 = 1,4,252,253,254,255
    field(DESC, "Map modules to 0-5")
    field(INPA, "$(P)$(R)slot$(SLOT):info_get.VAL[1] CP")
    field(CALC, "A==1?0:(A==4?1:(A==252?2:(A==253?3:(A==254?4:5))))")
}
record(mbbi, "$(P)$(R)slot$(SLOT):type_get") {
    field(DESC, "Type of module")
    field(INP, "$(P)$(R)slot$(SLOT):_calc_type.VAL CP")
    field(ZRST, "4CH UNIT")   field(ZRVL, 1)
    field(ONST, "OUTPUT")     field(ONVL, 4)
    field(TWST, "AUX POWER")  field(TWVL, 252)
    field(THST, "RESET")      field(THVL, 253)
    field(FRST, "READOUT")    field(FRVL, 254)
    field(FVST, "UNKOWN")     field(FVVL, 255)
}
info_get is an array of 26 elements containing all information about a slot.
Then I have records that are only valid for certain modules
#===========================================
# Valid for OUTPUT and 4CH Unit
#=============== Read data valid ===============
record(bi, "$(P)$(R)slot$(SLOT):validdata_get") {
    field(DESC, "Read data is valid")
    field(INP, "$(P)$(R)slot$(SLOT):info_get.VAL[3] CP")
    field(ZNAM, "NO")   field(ZSV, "MAJOR")
    field(ONAM, "YES")  field(OSV, "NO_ALARM")
    field(DISV, 1) # disabled at first
    field(DISA, 1) # disabled at first, enable by overwriting DISA with different value
}
I thought about using DISA, DISV and SDIS for this purpose but on the one hand I need the oposite behaviour, i.e. "enable record if DISA=DISV", and on the other hand I have not yet understood SDIS well enough to work with it, i.e. I did not get this to work.
Secondly, I was wandering which type of record I should use to select the records that must be enabled for a module (select, aSub, calcout, dfanout, ...)?
I wanted to ask, if you have any advice how I could achive that?
Thank you very much in advance.
Best regards Simon
P.S.: It works, but is CP the correct flag to use if I have records on the same IOC? I thought this was for records on different IOCs, yet I don't know which one to use instead.

-- 
Dr. Simon Friederich
Institut für Kernphysik
Kollaboration B | MESA
Johannes Gutenberg-Universität Mainz
Johann-Joachim-Becher-Weg 45
D 55128 Mainz

Tel.: +49 (0)6131 39-23160
E-Mail: s.friederich at uni-mainz.de

Replies:
Re: Enable or select records Ralph Lange via Tech-talk

Navigate by Date:
Prev: Re: Process PINI-Record again as soon as device is reconnected Dr. Simon Friederich via Tech-talk
Next: EPICS Qt 4.1.3 available [SEC=OFFICIAL] STARRITT, Andrew via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  <2025
Navigate by Thread:
Prev: No motor ui in pydm l123173 via Tech-talk
Next: Re: Enable or select records Ralph Lange via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  <2025
ANJ, 27 May 2025 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions ·
· Download · Search · IRMIS · Talk · Documents · Links · Licensing ·