g+
g+ Communities
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  <20102011  2012  2013  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  <20102011  2012  2013 
<== Date ==> <== Thread ==>

Subject: Re: sCalcout - again
From: Pierrick Hanlet <hanlet@fnal.gov>
To: Kurt Goetze <goetze@aps.anl.gov>
Cc: "tech-talk@aps.anl.gov" <tech-talk@aps.anl.gov>
Date: Mon, 23 Aug 2010 09:24:06 -0500
Hi Kurt,
I'm still having trouble with my db.  This is actually what I have.  The problem
appears to be in the definition of INAA, INBB, INCC.  When I do a caget or
camonitor of  MICE-ENV-AC-LEAK-04:calStatus.AA, I find that I have no value
stored there.  I do see the fields INAA, etc, defined in the dbd file.

The calculation works correctly, as I get the expected 1,0,-1 if I use the
uncommented CALC line.

record(scalcout,"MICE-ENV-AC-LEAK-04:calStatus") {
        field(DESC,"Water leak status determination")
        field(SCAN,"10 second")
        field(INPA,"MICE-ENV-SECPRB-01:WaterLeakStatus4")
        field(INPB,"MICE-ENV-SECPRB-01:WaterLeakValue4")
        field(INAA,"Dry")
        field(INBB,"Leak detected")
        field(INCC,"Error")
#       field(CALC,"(A=2||A=4)&&B=0?AA:(A=2||A=4)&&B=BB?1:CC")
        field(CALC,"(A=2||A=4)&&B=0?0:(A=2||A=4)&&B=1?1:-1")
        field(SVAL,"MICE-ENV-AC-LEAK-04:Status")
        field(FLNK,"MICE-ENV-AC-LEAK-04:Status.PROC")
}
#record(stringout,"MICE-ENV-AC-LEAK-04:Status") {
record(ao,"MICE-ENV-AC-LEAK-04:Status") {
        field(DESC,"AC unit water drip status")
        field(SCAN,"Passive")
        field(FLNK,"MICE-ENV-AC-LEAK-01:foStatus.PROC")
}

Any ideas?  Thanks,
Pierrick

-----------------------------------------------------------------------------------------
Pierrick Hanlet
Fermilab, P.O. Box 500, M.S. 122
Batavia, IL 60510
hanlet@fnal.gov
(630)840-5555/8871/6039         office/lab/fax 
http://www-d0.fnal.gov/~hanlet 

"Whether you think you can or think you can't, either way, you are correct" -- Henry Ford


----- Original Message -----
From: Kurt Goetze <goetze@aps.anl.gov>
Date: Wednesday, August 18, 2010 9:26 am
Subject: Re: sCalcout
To: Pierrick Hanlet <hanlet@fnal.gov>
Cc: "tech-talk@aps.anl.gov" <tech-talk@aps.anl.gov>


> Hi Pierrick,
> 
> I don't see a problem with your conditional expression.  Note that in
> the second example, your desired output will appear in the record's ".SVAL'
> field.
> 
> Kurt
> 
> Pierrick Hanlet wrote:
> > Hello,
> > I don't understand the online documentation regarding the string 
> output of sCalcout.  I want to write
> > a string based on the results of a calculation.  Ex:
> > record(scalcout,"myrecord")
> >   field(INPA,"xxx")
> >   field(INPB,"yyy")
> >   field(CALC,"(A=1&&B=0?1:A=0&&B=1?0:-1")
> >
> > What I would really like is 
> >   field(INPA,"xxx")
> >   field(INPB,"yyy")
> >   field(INAA,"Good")
> >   field(INBB,"Bad")
> >   field(INCC,"Ugly")
> >   field(CALC,"(A=1&&B=0?AA:A=0&&B=1?BB:CC")
> >
> > What is the correct syntax for affecting this?
> > Thanks in advance,
> > Pierrick
> >
> > -----------------------------------------------------------------------------------------
> > Pierrick Hanlet
> > Fermilab, P.O. Box 500, M.S. 122
> > Batavia, IL 60510
> > hanlet@fnal.gov
> > (630)840-5555/8871/6039         office/lab/fax 
> > http://www-d0.fnal.gov/~hanlet 
> >
> > "Whether you think you can or think you can't, either way, you are 
> correct" -- Henry Ford
> >
> >   
> 

Replies:
Re: sCalcout - again Kurt Goetze
Re: sCalcout - again J. Lewis Muir
RE: sCalcout - again peter.owens
References:
sCalcout Pierrick Hanlet
Re: sCalcout Kurt Goetze

Navigate by Date:
Prev: Re: msi again Ralph Lange
Next: Re: sCalcout - again Kurt Goetze
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  <20102011  2012  2013 
Navigate by Thread:
Prev: Re: sCalcout emmanuel_mayssat
Next: Re: sCalcout - again Kurt Goetze
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  <20102011  2012  2013 
ANJ, 02 Sep 2010 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· EPICSv4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·