Pierrick,
You could do a simple numeric calculation in a calc record and send the
output to an mbbi record to give you the string interpretations:
record(calcout,"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(CALC,"(A=2||A=4)&&B=0?0:(A=2||A=4)&&B=1?1:2")
field(OUT,"MICE-ENV-AC-LEAK-04:status PP")
}
record(mbbi,"MICE-ENV-AC-LEAK-04:status") {
field(ZRST,"Dry")
field(ONST,"Leak detected")
field(TWST,"Error")
}
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Pierrick Hanlet
Sent: 23 August 2010 15:24
To: Kurt Goetze
Cc: [email protected]
Subject: Re: sCalcout - again
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
[email protected]
(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 <[email protected]>
Date: Wednesday, August 18, 2010 9:26 am
Subject: Re: sCalcout
To: Pierrick Hanlet <[email protected]>
Cc: "[email protected]" <[email protected]>
> 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
> > [email protected]
> > (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
> >
> >
>
--
Scanned by iCritical.
- References:
- sCalcout Pierrick Hanlet
- Re: sCalcout Kurt Goetze
- Re: sCalcout - again Pierrick Hanlet
- Navigate by Date:
- Prev:
RE: Windows XP Cygwin cannot find -lCom M . VERDIER
- Next:
Re: Windows XP Cygwin cannot find -lCom J. Lewis Muir
- 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
2022
2023
2024
- Navigate by Thread:
- Prev:
Re: sCalcout - again J. Lewis Muir
- Next:
Re: sCalcout Tim Mooney
- 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
2022
2023
2024
|