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: aai to multiple states
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, 2 Jun 2025 16:20:46 +0200

Dear EPICS community,

I have an aai record "info_get" that contains multiple values.

#=============== Information array ===============
record(aai, "$(P)$(R)slot$(SLOT):info_get") {
    field(DESC, "Retrieve slot status")
    field(DTYP, "stream")
    field(INP, "@infus.proto getSingleSlotconf($(SLOT)) $(PORT)")
    field(NELM, "26")
    field(FTVL, "DOUBLE")
    field(PREC, 1)
}

9 values of these are booleans representing different outputs that are on or off (0 or 1).

I could create now, e.g. 9 binary inputs to map these values.

record(bi, "$(P)$(R)slot$(SLOT):output_preAB_get") {
    field(INP,  "$(P)$(R)slot$(SLOT):info_get.VAL[4] CP")
    field(ZNAM, "OPEN")
    field(ONAM, "CLOSED")
}
record(bi, "$(P)$(R)slot$(SLOT):output_preCD_get") {
    field(INP,  "$(P)$(R)slot$(SLOT):info_get.VAL[5] CP")
    field(ZNAM, "OPEN")
    field(ONAM, "CLOSED")
}
...# and so on

Yet, I wanted to ask, if there is another way of mapping this subarray to one record containing the states.
I thought the mbbi would suite, but unfortunately, it does not work as expected:

record(calc, "$(P)$(R)slot$(SLOT):_calc_output") {
    field(DESC, "OUTPUT module: aai to byte")
    field(CALC, "(A<<8) | (B<<7) | (C<<6) | (D<<5) | (E<<4) | (F<<3) | (G<<2) | (H<<1) | I")
    field(INPA, "$(P)$(R)slot$(SLOT):info_get.VAL[4] CP")
    field(INPB, "$(P)$(R)slot$(SLOT):info_get.VAL[5]")
    field(INPC, "$(P)$(R)slot$(SLOT):info_get.VAL[6]")
    field(INPD, "$(P)$(R)slot$(SLOT):info_get.VAL[7]")
    field(INPE, "$(P)$(R)slot$(SLOT):info_get.VAL[8]")
    field(INPF, "$(P)$(R)slot$(SLOT):info_get.VAL[9]")
    field(INPG, "$(P)$(R)slot$(SLOT):info_get.VAL[10]")
    field(INPH, "$(P)$(R)slot$(SLOT):info_get.VAL[11]")
    field(INPI, "$(P)$(R)slot$(SLOT):info_get.VAL[12]")
}
record(mbbi, "$(P)$(R)slot$(SLOT):output_get") {
    field(DESC, "OUTPUT module: Outputs")
    field(DTYP, "Raw Soft Channel")
    field(INP,  "$(P)$(R)slot$(SLOT):_calc_output CP")
    field(ZRST, "Ausgang Vorstufe A,B")
    field(ONST, "Ausgang Vorstufe C,D")
    field(TWST, "Ausgang Vorstufe E,F")
    field(THST, "Ausgang A")
    field(FRST, "Ausgang B")
    field(FVST, "Ausgang C")
    field(SXST, "Ausgang D")
    field(SVST, "Ausgang E")
    field(EIST, "Ausgang F")
}

(By the way:
The CP flag at INPA does not seem to be sufficient to process my calc record. At least for my tests I needed to caput .._calc_output.PROC 1 to process it).

Thank you very much in advance!

Best regards
Simon


  






Replies:
RE: aai to multiple states Žiga Oven via Tech-talk

Navigate by Date:
Prev: Job Openings at BESSY/HZB Gotz, Malte via Tech-talk
Next: Re: AreaDetector Collaboration Meeting - June **12th** Érico Nogueira Rolim 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: Job Openings at BESSY/HZB Gotz, Malte via Tech-talk
Next: RE: aai to multiple states Žiga Oven 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, 03 Jun 2025 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions ·
· Download · Search · IRMIS · Talk · Documents · Links · Licensing ·