EPICS Controls 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  2018  2019  2020  2021  <20222023  2024  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  <20222023  2024 
<== Date ==> <== Thread ==>

Subject: RE: StreamDevice return state error
From: "Barrett \(US\), Patrick E via Tech-talk" <tech-talk at aps.anl.gov>
To: "dirk.zimoch at psi.ch" <dirk.zimoch at psi.ch>, "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov>
Date: Wed, 29 Jun 2022 13:35:05 +0000
Thank you, I am able to use that to get it to work.

Patrick

-----Original Message-----
From: Zimoch Dirk (PSI) <dirk.zimoch at psi.ch>
Sent: Wednesday, June 29, 2022 3:41 AM
To: Barrett (US), Patrick E <patrick.e.barrett at boeing.com>; tech-talk at aps.anl.gov
Subject: [EXTERNAL] Re: StreamDevice return state error

EXT email: be mindful of links/attachments.



On Wed, 2022-06-29 at 09:28 +0200, Zimoch Dirk wrote:
> On Wed, 2022-06-29 at 07:25 +0000, Zimoch Dirk (PSI) via Tech-talk wrote:
> > Hi Patrick,
> >
> > The error "Record does not accept input" happens when you send a
> > string (parsed with %s) to a record with an enum VAL like your mbbi,
> > but the string does not match any of the enum strings in the record.
> > As your record only has "STANDBY", "OPERATE" and "SELFTEST", it does not accept the input "MONITOR".
> >
> > Dirk
> >
>
> The mbbi should be in INVALID/CALC alarm state after that.

Except.... that your record is "I/O Intr". Such records get all the available input but process only matching input.
Non-matching input is silently ignored. That is by design how StreamDevice implements I/O Intr.

Instead of %s you can use a more specific input format like "%{STANDBY|OPERATE|SELFTEST|}%*s". This one returns 0,1,2 on the known strings (actually on anything starting with a known string) and 3 on anything else (which is then ignored so that the format does not fail)). Set an alarm for state 3.

readSystemState
{
    in "SYSTEM:STATE %{STANDBY|OPERATE|SELFTEST|}%*s";
    out "%(\$1)s";
}

record(mbbi, "RCV_STATE")
{
    field(DESC, "SYSTEM:STATE P01")
    field(DTYP, "stream")
    field(SCAN, "I/O Intr")
    field(INP,  "@simCmd.proto readSystemState(STATE_RTN) $(PORT) 0")
    field(ZRST, "STANDBY")
    field(ONST, "OPERATE")
    field(TWST, "SELFTEST")
    field(THST, "ERROR")
    field(THSV, "MAJOR")
    field(UNSV, "INVALID")
}

As now StreamDevice returns the index number and not the string, you can even use different Strings in your *ST fields.

>
>
> >
> > On Tue, 2022-06-28 at 16:37 +0000, Barrett (US), Patrick E via Tech-talk wrote:
> > > I am working to simulate a SCPI type device with an IOC.  I am
> > > using I/O Intr records to read in the SCPI and set the state of
> > > the mbbi record.  The IOC should return ERROR if an error occurs,
> > > such as if an invalid state is requested.
> > > I
> > > can see the error message in the IOC when an invalid state is
> > > requested, but do not know how to capture the error in the
> > > protocol file or db setup to send a return string of “ERROR”.
> > >
> > > The error I get is when sending the IOC “SYSTEM:STATE MONITOR” is:
> > > ’… RCV_STATE: Record does not accept input "MONITOR"’
> > >
> > > Proto definition:
> > > readSystemState
> > > {
> > >    in "SYSTEM:STATE %s";
> > >    out "%(\$1)s";
> > > }
> > >
> > > Record definition:
> > > record(mbbi, "RCV_STATE")
> > > {
> > >    field(DESC, "SYSTEM:STATE P01")
> > >    field(DTYP, "stream")
> > >    field(SCAN, "I/O Intr")
> > >    field(INP,  "@simCmd.proto readSystemState(STATE_RTN) $(PORT) 0")
> > >    field(ZRST, "STANDBY")
> > >    field(ZRVL, "0")
> > >    field(ONST, "OPERATE")
> > >    field(ONVL, "1")
> > >    field(TWST, "SELFTEST")
> > >    field(TWVL, "2")
> > >    field(UNSV, "INVALID")
> > > }
> > > record(bi, " STATE_RTN ")
> > > {
> > >    field(DESC, "State Return")
> > >    field(DTYP, "Soft Channel")
> > >    field(SCAN, "Passive")
> > >    field(ZNAM, "OK")
> > >    field(ONAM, "ERROR")
> > >    field(VAL, 0)
> > >    field(PINI, 1)
> > > }
> > > Patrick Barrett
> > > Software Engineer
> > > The Boeing Company
> > >

References:
StreamDevice return state error Barrett (US), Patrick E via Tech-talk
Re: StreamDevice return state error Zimoch Dirk (PSI) via Tech-talk
Re: StreamDevice return state error Zimoch Dirk (PSI) via Tech-talk
Re: StreamDevice return state error Zimoch Dirk (PSI) via Tech-talk

Navigate by Date:
Prev: Re: [EXTERNAL] Re: Phoebus connection to alarm server / Kafka Kasemir, Kay via Tech-talk
Next: Re: EPICS IOC BOOTP timeout at RTEMS on MVME6100 Heinz Junkes via Tech-talk
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  <20222023  2024 
Navigate by Thread:
Prev: Re: StreamDevice return state error Zimoch Dirk (PSI) via Tech-talk
Next: Re: [EXTERNAL] Re: Phoebus connection to alarm server / Kafka Kasemir, Kay via Tech-talk
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  <20222023  2024 
ANJ, 14 Sep 2022 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·