EPICS Home

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: Re: aai to multiple states
From: "Paduan Donadio, Marcio via Tech-talk" <tech-talk at aps.anl.gov>
To: "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov>
Date: Tue, 3 Jun 2025 22:26:15 +0000
Hi, Simon.

I think that what Žiga suggested was that you kept the ai records, while reading individual bits from mbbiDirect, like:

record(bi,

"$(P)$(R)slot$(SLOT):output_preAB_get")

{

 

    field(INP,  "$(P)$(R)slot$(SLOT):info_get.B4

CP")

 

    field(ZNAM,

"OPEN")

 

    field(ONAM,

"CLOSED")

 

}

 

record(bi,

"$(P)$(R)slot$(SLOT):output_preCD_get")

{

 

    field(INP,  "$(P)$(R)slot$(SLOT):info_get.B5

CP")

 

    field(ZNAM,

"OPEN")

 

    field(ONAM,

"CLOSED")

 

}


Do you need a record to provide a string for you, instead? Would using the DESC field of the bi records work for you?

Cheers,

Marcio Donadio
Embedded Systems Engineer | TID-ID-CSE
B 084 | on site (Tue-Wed)
P 650.926.5007
SLAC National Accelerator Laboratory 


From: Tech-talk <tech-talk-bounces at aps.anl.gov> on behalf of Dr. Simon Friederich via Tech-talk <tech-talk at aps.anl.gov>
Sent: Tuesday, June 3, 2025 07:23
To: Žiga Oven <ziga.oven at cosylab.com>; tech-talk at aps.anl.gov <tech-talk at aps.anl.gov>
Subject: Re: aai to multiple states
 

Hi Ziga,

Thanks for your reply. I thought about mbbiDirect too, but I don't see how to set individual labels? I can only find the B0-BF and B10-B1F fields.

https://epics-base.github.io/epics-base/mbbiDirectRecord.html

Can you show me an example how to do that?

Best regards
Simon

Am 03.06.2025 um 11:42 schrieb Žiga Oven:

Hi Simon,

 

If you substitute your mbbi record for mbbiDirect [1] you can access individual bits by fields B1, B2, …
The 9 bi records give you a way to individually label and alarm states for each individual Boolean value.

Regarding the processing of your calc_output record: is the value in info_get record changing?
You can also set your aai record (info_get) to post monitor every time it processes by configuring the MPST field [2] to Always (this should be  a default setting, but you should verify or set it specifically if needed).

 

Best regards,

 

Žiga Oven


[1] https://docs.epics-controls.org/projects/base/en/latest/mbbiDirectRecord.html

[2] https://docs.epics-controls.org/projects/base/en/latest/aaiRecord.html#monitor-parameters

 

From: Tech-talk <tech-talk-bounces at aps.anl.gov> On Behalf Of Dr. Simon Friederich via Tech-talk
Sent: Monday, June 2, 2025 16:21
To: tech-talk at aps.anl.gov
Subject: aai to multiple states

 

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

 

References:
aai to multiple states Dr. Simon Friederich via Tech-talk
RE: aai to multiple states Žiga Oven via Tech-talk
Re: aai to multiple states Dr. Simon Friederich via Tech-talk

Navigate by Date:
Prev: Re: [EXTERNAL] Re: Suggestions wanted on IOC hardware Steven Hunt via Tech-talk
Next: Re: aai to multiple states Dr. Simon Friederich 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: Re: aai to multiple states Dr. Simon Friederich via Tech-talk
Next: Re: aai to multiple states Dr. Simon Friederich 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