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")
record(bi,
"$(P)$(R)slot$(SLOT):output_preCD_get")
{
field(INP,
"$(P)$(R)slot$(SLOT):info_get.B5
CP")
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
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(INP,
"@infus.proto getSingleSlotconf($(SLOT))
$(PORT)")
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")
record(bi,
"$(P)$(R)slot$(SLOT):output_preCD_get")
{
field(INP, "$(P)$(R)slot$(SLOT):info_get.VAL[5]
CP")
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")
(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
|