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 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
<== Date ==> <== Thread ==>

Subject: Re: Enumerated Strings in CSS BOY
From: "Kasemir, Kay" <kasemirk@ornl.gov>
To: Andrew Johnson <anj@aps.anl.gov>, Iain Marcuson <Iain.Marcuson@sydorinstruments.com>, EPICS Tech Talk <tech-talk@aps.anl.gov>
Date: Thu, 21 Sep 2017 18:33:58 +0000
As Andrew explained, you're likely missing one level of indirection.
Give an MBBI with
 field(ONVL, 129)
 field(ONST,"Done")
 field(THVL,1)
 field(THST,"Clearing")

that record will have values 0, 1, 2, 3 represented as ?, Done, ?, Clearing
(didn't see the detail for the ZRVL/ST and TWVL/ST for states 0 and 2)


If you want to map raw value 1 to state 3 (ONVL=1) and raw value 129 to state 1 (ONVL=129), you need to get those raw values into the RVAL field.
For example, you could have an ai record read the 1, 129, ... from your device, and then use INP=that record and DTYP="Raw Soft Channel" for the MBBI.

-Kay

________________________________________
From: tech-talk-bounces@aps.anl.gov <tech-talk-bounces@aps.anl.gov> on behalf of Andrew Johnson <anj@aps.anl.gov>
Sent: Thursday, September 21, 2017 2:26 PM
To: Iain Marcuson; EPICS Tech Talk
Subject: Re: Enumerated Strings in CSS BOY

Hi Iain,

On 09/21/2017 12:45 PM, Iain Marcuson wrote:
> My software queries a status value from a sensor.  I want to display the
> status as a string in my OPI.  The status values are neither sequential
> nor zero-indexed.  I tried to create an mbbi record with the *VL and *ST
> fields set to match the status string with the status value.  CSS BOY,
> however, does not display the string matching the mbbi VAL number, but
> the *ST field corresponding to the VAL number.  For example:
>
> Field(ONVL, 129)
> Field(ONST,"Done")
> Field(THVL,1)
> Field(THST,"Clearing")
>
> If the mbbi VAL field is 1, then CSS BOY will display "Done" as opposed
> to "Clearing".
>
> What is the preferred way of outputting a string with such an enum?

The mbbi record type is designed to compare the *VL fields against the
RVAL field, then it sets the VAL field to the index corresponding to the
matching *VL field. The string representation of the VAL field will then
be the string in the corresponding *ST field, and the alarm severity of
the record is set from the corresponding *SV field.

How is this record connecting to your sensor? The device support for an
mbbi should be setting prec->rval (if you're providing your own device
support). If this mbbi is a soft record though (i.e. DSET is unset or
"Soft Channel" then you need to change it to be "Raw Soft Channel" — the
soft support reads an encoded index value from the INP link directly
into VAL and skips the comparisons with the *VL fields, whereas the raw
soft support reads the INP link value into RVAL and goes through the *VL
comparisons.

HTH,

- Andrew

--
Arguing for surveillance because you have nothing to hide is no
different than making the claim, "I don't care about freedom of
speech because I have nothing to say." -- Edward Snowdon

Replies:
RE: Enumerated Strings in CSS BOY Iain Marcuson
References:
Enumerated Strings in CSS BOY Iain Marcuson
Re: Enumerated Strings in CSS BOY Andrew Johnson

Navigate by Date:
Prev: Re: Enumerated Strings in CSS BOY Andrew Johnson
Next: RE: new Scaler driver Mark Rivers
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
Navigate by Thread:
Prev: Re: Enumerated Strings in CSS BOY Andrew Johnson
Next: RE: Enumerated Strings in CSS BOY Iain Marcuson
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
ANJ, 21 Sep 2017 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·