Hi Andrew and Tim,
Thanks you very much for the advices.
I am trying to build an IOC/record to watch and protect a large system, where
I need to access 100+ PVs. Since those PVs have very similiar names, I was
hoping to hard-code the common part of the names, then use something
like the dbNameToAddr function to create an array of links to use in for loops.
Now, I am doing it half-automatic: list all those PVs in the dbd file, then put
them into some arrays in init_record, then use for loops to fetch their values.
This way i almost get what i wanted. If we can avoid the need to list all the PVs
in the dbd file, both the dbd and c files will be even shorter.
Best regards,
Dehong
________________________________________
From: Andrew Johnson [[email protected]]
Sent: Thursday, August 23, 2012 3:06 PM
To: [email protected]
Cc: Zhang, Dehong
Subject: Re: Creating INLINK/OUTLINK in record support
Hi Dehong,
On 2012-08-23 Zhang, Dehong wrote:
>
> Is it possible to create these things dynamically inside a record, so that
> I can access PVs on another IOC, without listing them all in the dbd file
> of my custom record?
>
> In other words, is there something like the
> dbNameToAddr
> to use for creating and accessing LINKs?
Anything is possible if you're willing to write enough code, but...
The dbNameToAddr() routine is only for local PVs; CA links are implemented
using the code in dbCa, and initializing those links happens at iocInit() or
whenever the INP/OUT link value is changed. However there isn't really a
public API for that kind of thing, and I don't really recommend that you try
to do that.
It sounds to me like you're creating a new record type when maybe you should
be writing a State Notation Language program. Why don't you step back a bit
and reconsider what you're trying to do? Feel free to explain here if you
want more advice, but you will need to explain the bigger picture because I
wouldn't recommend trying what you describe above.
HTH,
- Andrew
--
Never interrupt your enemy when he is making a mistake.
-- Napoleon Bonaparte
- Replies:
- RE: Creating INLINK/OUTLINK in record support Laznovsky Michael
- Re: Creating INLINK/OUTLINK in record support Tim Mooney
- Re: Creating INLINK/OUTLINK in record support Benjamin Franksen
- References:
- Creating INLINK/OUTLINK in record support Zhang, Dehong
- Re: Creating INLINK/OUTLINK in record support Andrew Johnson
- Navigate by Date:
- Prev:
Re: Motor Record 6-5-2 backlash issue? Tim Mooney
- Next:
RE: Creating INLINK/OUTLINK in record support Laznovsky Michael
- 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: Creating INLINK/OUTLINK in record support Andrew Johnson
- Next:
RE: Creating INLINK/OUTLINK in record support Laznovsky Michael
- 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
|