![]() |
![]() ![]()
Experimental Physics and
| ||||||||||||||
|
Dear EPICS community, I have a self-build
device that consists of 11 slots. Example communication
for output module: >slot 10 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. 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
| ||||||||||||||
ANJ, 27 May 2025 |
![]() · Download · Search · IRMIS · Talk · Documents · Links · Licensing · |