Maren Purves wrote:
Hi all,
I need/partly have the following application:
An IOC provides a (floating point, if that matters)
number that
depends on something in this IOC to another IOC where it
needs
to be added into a calc record. We do this in other
places, and
in itself it isn't a problem. The question I have is:
What happens if the first IOC is switched off?
(The number it contributes should be switched to 0.0
before it
is turned off. This IOC may be switched off for months at
a
time.)
Will the calc record treat the non-existing input as a 0?
Will it also do so when it is rebooted?
Thanks,
Maren
(trying to avoid putting in a switch)
The calc record will continue to use the value it last
obtained or 0.0 if it never got a value from the other
ioc. If you specify MS on the link the calc record will go
into alarm if the other IOC is down.
Here is a way to do what you require. Create the following
two additional records
record(ai,"<actualLink>") {
field(INP,"<pvInOtherIOC> CP MS")
}
record(calc,"<checkStatus>") {
field(INPA,"<actualLink> ")
field(INPB,"<actualLink>.SEVR")
#SEVR=3 means INVALID_ALARM
field(CALC,"(B=3)?0.0:A") }
Than have your original calc record link to <checkStatus>
instead of <pvInOtherIOC>, e.g.
field(INP<X>,"<checkStatus> PP")
Perhaps someone can think of a more clever way that does
not require two additional records.
Marty Kraimer