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: | Making mbbo record write string value instead of index |
From: | "Sobhani, Alex via Tech-talk" <tech-talk at aps.anl.gov> |
To: | "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov> |
Date: | Fri, 26 May 2023 15:01:50 +0000 |
I want multiplexor-like functionality with epics records, where the user can select from a number of PVs to display using a selector PV, and then an output PV displays whatever PV was selected.
My current implementation is this:
record(mbbo, "mot:select"){
field(ZRST, "q8i:ai1 CP")
field(ONST, "q8i:ai2 CP")
field(FLNK, "mot:copy")
}
record(stringout, "mot:copy"){
field(OMSL, "closed_loop")
field(DOL, "mot:select")
field(OUT, "mot:pos.INPA CA")
field(FLNK, "mot:pos")
}
record(calc, "mot:pos"){
field(CALC, "A")
}The mbbo record allows the user to select his choice using a combobox widget in CSS, and then the value of the selected PV is displayed in the mot:pos record.
This works, but I am wondering if this can be done using two records instead of three. I attempted the following:
record(mbbo, "mot:select2"){
field(ZRST, "q8i:ai1 CP")
field(ONST, "q8i:ai2 CP")
field(OUT, "mot:pos2.INPA CA")
}
record(calc, "mot:pos2"){
field(CALC, "A")
}
But this just ends up writing the index of the selection (0 or 1) to mot:pos2.INPA, instead of the pv link ("q8i:ai1 CP" or
"q8i:ai2 CP"), even though
"dbgf mot:select2.VAL" returns "q8i:ai2 CP".
This is not the behavior I would expect because the documentation says:
"If the OUT output link specifies a database link, channel access link, or constant, then the DTYP field must specify either one of the two soft device support modules--
And when I do "dbgf mot:select2.DTYP" it returns "Soft Channel".
So why does the VAL field get converted to an integer?
Alex
|