Hi Andrew,
Thank you very much for the clarification. I was trying to add protections against
"none existing PV", "fail to read PV" and "PV in alarm".
Best regards,
Dehong
________________________________________
From: Andrew Johnson [[email protected]]
Sent: Monday, October 28, 2013 9:39 AM
To: Zhang, Dehong
Cc: [email protected]
Subject: Re: dbGetLink with options
Hi Dehong,
On 10/26/2013 11:35 AM, Zhang, Dehong wrote:
> I am trying to fetch the value from a PV in another IOC. I would like to get the connection
> status and alarm severity in one call. According to the developer's guide, these can be done
> by setting the options (3.14.12), but whenever I set the options to none-zero (with the proper
> return structure), it fails.
>
> I did a "grep dbGetLink *" in base/***/src/rec. It seems nobody uses options.
You are correct for that API, DB links do support options but CA links
and CONST links don't (if you pass in a non-zero pointer for poptions
they will set *poptions=0 before returning to tell you that they don't
support any option bits). In 3.15 if you try and pass a non-zero value
at *options you'll get a warning message at runtime (and the value will
be zeroed again).
> Do I need to explicitly call dbCaGetLink, and check the link status and alarm severity by
> calling dbCaIsLinkConnected and dbCaGetSevr?
I would advise against using the dbCa routines directly if you can avoid
doing so, they will lock your code into using Channel Access when future
releases may provide pvAccess links too.
For the link connection status, call dbIsLinkConnected(plink) which
returns a true/false value.
The dbGetLink() routine automatically sets the alarm condition (status
and severity) of the record that owns the link, based on the link flags
and the alarm condition of the link target. What else were you planning
to do with the that alarm information?
> By the way, dbGetLink always returns "0", even when it fails or when the link is not there.
A disconnected link is not seen as an error, the IOC code should be able
to continue despite another part of the control system being down. The
dbGetLink() routine can return a non-zero status, but disconnection does
not cause it to do that.
Note that in 3.15 and later we have been changing the implementation of
the link code to allow additional link types to be added in the future,
although we're not at that stage yet.
HTH,
- Andrew
--
Advertising may be described as the science of arresting the human
intelligence long enough to get money from it. -- Stephen Leacock
- Replies:
- Re: dbGetLink with options Andrew Johnson
- References:
- dbGetLink with options Zhang, Dehong
- Re: dbGetLink with options Andrew Johnson
- Navigate by Date:
- Prev:
Re: dbGetLink with options Andrew Johnson
- Next:
Re: dbGetLink with options Andrew Johnson
- 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: dbGetLink with options Andrew Johnson
- Next:
Re: dbGetLink with options Andrew Johnson
- 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
|