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