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: Iain Marcuson <Iain.Marcuson@sydorinstruments.com>
To: "Kasemir, Kay" <kasemirk@ornl.gov>, Andrew Johnson <anj@aps.anl.gov>, EPICS Tech Talk <tech-talk@aps.anl.gov>
Date: Thu, 21 Sep 2017 19:03:56 +0000
I used a longin to get the input from the device, and used DTYP "Raw Soft Channel" and set INP to the longin.  I had to add a FLNK from the record that actually did the retrieval.

Thank you,

Iain.

> -----Original Message-----
> From: Kasemir, Kay [mailto:kasemirk@ornl.gov]
> Sent: Thursday, September 21, 2017 2:34 PM
> To: Andrew Johnson <anj@aps.anl.gov>; Iain Marcuson
> <Iain.Marcuson@sydorinstruments.com>; EPICS Tech Talk <tech-
> talk@aps.anl.gov>
> Subject: Re: Enumerated Strings in CSS BOY
> 
> 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

References:
Enumerated Strings in CSS BOY Iain Marcuson
Re: Enumerated Strings in CSS BOY Andrew Johnson
Re: Enumerated Strings in CSS BOY Kasemir, Kay

Navigate by Date:
Prev: RE: new Scaler driver Mark Rivers
Next: PCASpy 0.7 Wang Xiaoqiang (PSI)
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 Kasemir, Kay
Next: PCASpy 0.7 Wang Xiaoqiang (PSI)
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 ·