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: Andrew Johnson <anj@aps.anl.gov>
To: Iain Marcuson <Iain.Marcuson@sydorinstruments.com>, EPICS Tech Talk <tech-talk@aps.anl.gov>
Date: Thu, 21 Sep 2017 13:26:05 -0500
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 Kasemir, Kay
References:
Enumerated Strings in CSS BOY Iain Marcuson

Navigate by Date:
Prev: Enumerated Strings in CSS BOY Iain Marcuson
Next: Re: Enumerated Strings in CSS BOY Kasemir, Kay
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: Enumerated Strings in CSS BOY Iain Marcuson
Next: Re: Enumerated Strings in CSS BOY Kasemir, Kay
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 ·